Skip to content

Commit

Permalink
netem: fix dequeue
Browse files Browse the repository at this point in the history
commit 5061253 (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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Eric Dumazet authored and davem330 committed Feb 19, 2012
1 parent b01543d commit cd961c2
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions net/sched/sch_netem.c
Original file line number Diff line number Diff line change
Expand Up @@ -501,9 +501,8 @@ static struct sk_buff *netem_dequeue(struct Qdisc *sch)

/* 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
/*
Expand Down Expand Up @@ -539,7 +538,6 @@ static struct sk_buff *netem_dequeue(struct Qdisc *sch)
qdisc_watchdog_schedule(&q->watchdog, cb->time_to_send);
}

qdisc_dequeue:
if (q->qdisc) {
skb = q->qdisc->ops->dequeue(q->qdisc);
if (skb)
Expand Down

0 comments on commit cd961c2

Please sign in to comment.