netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] sch_hhf: fix comparison of qlen and limit
@ 2014-05-09  8:49 Yang Yingliang
  2014-05-12 18:55 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Yang Yingliang @ 2014-05-09  8:49 UTC (permalink / raw)
  To: netdev; +Cc: eric.dumazet, vtlam, nanditad, davem

When I use the following command, eth0 cannot send any packets.
 #tc qdisc add dev eth0 root handle 1: hhf limit 1

Because qlen need be smaller than limit, all packets were dropped.
Fix this by qlen *<=* limit.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 net/sched/sch_hhf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/sched/sch_hhf.c b/net/sched/sch_hhf.c
index a9051d0fff52..9544c5caadb9 100644
--- a/net/sched/sch_hhf.c
+++ b/net/sched/sch_hhf.c
@@ -414,7 +414,7 @@ static int hhf_enqueue(struct sk_buff *skb, struct Qdisc *sch)
 		}
 		bucket->deficit = weight * q->quantum;
 	}
-	if (++sch->q.qlen < sch->limit)
+	if (++sch->q.qlen <= sch->limit)
 		return NET_XMIT_SUCCESS;
 
 	q->drop_overlimit++;
-- 
1.8.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] sch_hhf: fix comparison of qlen and limit
  2014-05-09  8:49 [PATCH net-next] sch_hhf: fix comparison of qlen and limit Yang Yingliang
@ 2014-05-12 18:55 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2014-05-12 18:55 UTC (permalink / raw)
  To: yangyingliang; +Cc: netdev, eric.dumazet, vtlam, nanditad

From: Yang Yingliang <yangyingliang@huawei.com>
Date: Fri, 9 May 2014 16:49:05 +0800

> When I use the following command, eth0 cannot send any packets.
>  #tc qdisc add dev eth0 root handle 1: hhf limit 1
> 
> Because qlen need be smaller than limit, all packets were dropped.
> Fix this by qlen *<=* limit.
> 
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-05-12 18:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-09  8:49 [PATCH net-next] sch_hhf: fix comparison of qlen and limit Yang Yingliang
2014-05-12 18:55 ` 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).