提交 cd961c2c 编写于 作者: E Eric Dumazet 提交者: David S. Miller

netem: fix dequeue

commit 50612537 (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: NEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 b01543df
...@@ -501,9 +501,8 @@ static struct sk_buff *netem_dequeue(struct Qdisc *sch) ...@@ -501,9 +501,8 @@ static struct sk_buff *netem_dequeue(struct Qdisc *sch)
/* if more time remaining? */ /* if more time remaining? */
if (cb->time_to_send <= psched_get_time()) { if (cb->time_to_send <= psched_get_time()) {
skb = qdisc_dequeue_tail(sch); __skb_unlink(skb, &sch->q);
if (unlikely(!skb)) sch->qstats.backlog -= qdisc_pkt_len(skb);
goto qdisc_dequeue;
#ifdef CONFIG_NET_CLS_ACT #ifdef CONFIG_NET_CLS_ACT
/* /*
...@@ -539,7 +538,6 @@ static struct sk_buff *netem_dequeue(struct Qdisc *sch) ...@@ -539,7 +538,6 @@ static struct sk_buff *netem_dequeue(struct Qdisc *sch)
qdisc_watchdog_schedule(&q->watchdog, cb->time_to_send); qdisc_watchdog_schedule(&q->watchdog, cb->time_to_send);
} }
qdisc_dequeue:
if (q->qdisc) { if (q->qdisc) {
skb = q->qdisc->ops->dequeue(q->qdisc); skb = q->qdisc->ops->dequeue(q->qdisc);
if (skb) if (skb)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册