Commit 13566c44 authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller

[PKT_SCHED]: Fix netem qlen accounting.

Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 69509eca
...@@ -195,7 +195,11 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch) ...@@ -195,7 +195,11 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch)
++q->counter; ++q->counter;
ret = q->qdisc->enqueue(skb, q->qdisc); ret = q->qdisc->enqueue(skb, q->qdisc);
if (ret) if (likely(ret == NET_XMIT_SUCCESS)) {
sch->q.qlen++;
sch->bstats.bytes += skb->len;
sch->bstats.packets++;
} else
sch->qstats.drops++; sch->qstats.drops++;
return ret; return ret;
} }
...@@ -487,7 +491,7 @@ static int netem_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new, ...@@ -487,7 +491,7 @@ static int netem_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,
sch_tree_lock(sch); sch_tree_lock(sch);
*old = xchg(&q->qdisc, new); *old = xchg(&q->qdisc, new);
qdisc_reset(*old); qdisc_reset(*old);
sch->q.qlen = 0; sch->q.qlen = q->delayed.qlen;
sch_tree_unlock(sch); sch_tree_unlock(sch);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment