* [Patch net] sch_hhf: fix return value of hhf_drop()
@ 2015-10-07 23:47 Cong Wang
2015-10-11 11:50 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Cong Wang @ 2015-10-07 23:47 UTC (permalink / raw)
To: netdev; +Cc: Cong Wang, Jamal Hadi Salim, Terry Lam, Cong Wang
Similar to commit c0afd9ce4d6a ("fq_codel: fix return value of fq_codel_drop()")
->drop() is supposed to return the number of bytes it dropped,
but hhf_drop () returns the id of the bucket where it drops
a packet from.
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: Terry Lam <vtlam@google.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Cong Wang <cwang@twopensource.com>
---
net/sched/sch_hhf.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/net/sched/sch_hhf.c b/net/sched/sch_hhf.c
index 9d15cb6..86b04e3 100644
--- a/net/sched/sch_hhf.c
+++ b/net/sched/sch_hhf.c
@@ -368,6 +368,15 @@ static unsigned int hhf_drop(struct Qdisc *sch)
return bucket - q->buckets;
}
+static unsigned int hhf_qdisc_drop(struct Qdisc *sch)
+{
+ unsigned int prev_backlog;
+
+ prev_backlog = sch->qstats.backlog;
+ hhf_drop(sch);
+ return prev_backlog - sch->qstats.backlog;
+}
+
static int hhf_enqueue(struct sk_buff *skb, struct Qdisc *sch)
{
struct hhf_sched_data *q = qdisc_priv(sch);
@@ -696,7 +705,7 @@ static struct Qdisc_ops hhf_qdisc_ops __read_mostly = {
.enqueue = hhf_enqueue,
.dequeue = hhf_dequeue,
.peek = qdisc_peek_dequeued,
- .drop = hhf_drop,
+ .drop = hhf_qdisc_drop,
.init = hhf_init,
.reset = hhf_reset,
.destroy = hhf_destroy,
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Patch net] sch_hhf: fix return value of hhf_drop()
2015-10-07 23:47 [Patch net] sch_hhf: fix return value of hhf_drop() Cong Wang
@ 2015-10-11 11:50 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2015-10-11 11:50 UTC (permalink / raw)
To: xiyou.wangcong; +Cc: netdev, jhs, vtlam, cwang
From: Cong Wang <xiyou.wangcong@gmail.com>
Date: Wed, 7 Oct 2015 16:47:32 -0700
> Similar to commit c0afd9ce4d6a ("fq_codel: fix return value of fq_codel_drop()")
> ->drop() is supposed to return the number of bytes it dropped,
> but hhf_drop () returns the id of the bucket where it drops
> a packet from.
>
> Cc: Jamal Hadi Salim <jhs@mojatatu.com>
> Cc: Terry Lam <vtlam@google.com>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
> Signed-off-by: Cong Wang <cwang@twopensource.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-10-11 11:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-07 23:47 [Patch net] sch_hhf: fix return value of hhf_drop() Cong Wang
2015-10-11 11:50 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).