aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched
diff options
context:
space:
mode:
authorWANG Cong <xiyou.wangcong@gmail.com>2015-07-14 14:21:58 -0400
committerDavid S. Miller <davem@davemloft.net>2015-07-16 00:36:35 -0400
commitc0afd9ce4d6a646fb6433536f95a418bb348fab1 (patch)
tree25faa506001a9836892255ab9ac41da19b5ce878 /net/sched
parente8d092aafd9e68c04d7b468e95ff7a617998a796 (diff)
fq_codel: fix return value of fq_codel_drop()
The ->drop() is supposed to return the number of bytes it dropped, however fq_codel_drop() returns the index of the flow where it drops a packet from. Fix this by introducing a helper to wrap fq_codel_drop(). Cc: Eric Dumazet <edumazet@google.com> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: Cong Wang <cwang@twopensource.com> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/sch_fq_codel.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/net/sched/sch_fq_codel.c b/net/sched/sch_fq_codel.c
index 06e7c845e24d..21ca33c9f036 100644
--- a/net/sched/sch_fq_codel.c
+++ b/net/sched/sch_fq_codel.c
@@ -163,6 +163,15 @@ static unsigned int fq_codel_drop(struct Qdisc *sch)
163 return idx; 163 return idx;
164} 164}
165 165
166static unsigned int fq_codel_qdisc_drop(struct Qdisc *sch)
167{
168 unsigned int prev_backlog;
169
170 prev_backlog = sch->qstats.backlog;
171 fq_codel_drop(sch);
172 return prev_backlog - sch->qstats.backlog;
173}
174
166static int fq_codel_enqueue(struct sk_buff *skb, struct Qdisc *sch) 175static int fq_codel_enqueue(struct sk_buff *skb, struct Qdisc *sch)
167{ 176{
168 struct fq_codel_sched_data *q = qdisc_priv(sch); 177 struct fq_codel_sched_data *q = qdisc_priv(sch);
@@ -604,7 +613,7 @@ static struct Qdisc_ops fq_codel_qdisc_ops __read_mostly = {
604 .enqueue = fq_codel_enqueue, 613 .enqueue = fq_codel_enqueue,
605 .dequeue = fq_codel_dequeue, 614 .dequeue = fq_codel_dequeue,
606 .peek = qdisc_peek_dequeued, 615 .peek = qdisc_peek_dequeued,
607 .drop = fq_codel_drop, 616 .drop = fq_codel_qdisc_drop,
608 .init = fq_codel_init, 617 .init = fq_codel_init,
609 .reset = fq_codel_reset, 618 .reset = fq_codel_reset,
610 .destroy = fq_codel_destroy, 619 .destroy = fq_codel_destroy,