netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] netem: fix dequeue
@ 2012-02-16  6:28 Eric Dumazet
  2012-02-20  0:00 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2012-02-16  6:28 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

commit 50612537e9 (netem: fix classful handling) added two errors in
netem_dequeue() 

1) After checking skb at the head of tfifo queue for time constraints,
   it dequeues tail skb, thus adding unwanted reordering.

2) qdisc stats are updated twice per packet
   (one when packet dequeued from tfifo, once when delivered)

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
 net/sched/sch_netem.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
index e83d61c..5da548f 100644
--- a/net/sched/sch_netem.c
+++ b/net/sched/sch_netem.c
@@ -501,9 +501,8 @@ tfifo_dequeue:
 
 		/* if more time remaining? */
 		if (cb->time_to_send <= psched_get_time()) {
-			skb = qdisc_dequeue_tail(sch);
-			if (unlikely(!skb))
-				goto qdisc_dequeue;
+			__skb_unlink(skb, &sch->q);
+			sch->qstats.backlog -= qdisc_pkt_len(skb);
 
 #ifdef CONFIG_NET_CLS_ACT
 			/*
@@ -539,7 +538,6 @@ deliver:
 		qdisc_watchdog_schedule(&q->watchdog, cb->time_to_send);
 	}
 
-qdisc_dequeue:
 	if (q->qdisc) {
 		skb = q->qdisc->ops->dequeue(q->qdisc);
 		if (skb)

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

* Re: [PATCH] netem: fix dequeue
  2012-02-16  6:28 [PATCH] netem: fix dequeue Eric Dumazet
@ 2012-02-20  0:00 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2012-02-20  0:00 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 16 Feb 2012 07:28:25 +0100

> commit 50612537e9 (netem: fix classful handling) added two errors in
> netem_dequeue() 
> 
> 1) After checking skb at the head of tfifo queue for time constraints,
>    it dequeues tail skb, thus adding unwanted reordering.
> 
> 2) qdisc stats are updated twice per packet
>    (one when packet dequeued from tfifo, once when delivered)
> 
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>

Applied.

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

end of thread, other threads:[~2012-02-20  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-16  6:28 [PATCH] netem: fix dequeue Eric Dumazet
2012-02-20  0:00 ` 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).