net_sched: update hierarchical backlog too

When the bottom qdisc decides to, for example, drop some packet,
it calls qdisc_tree_decrease_qlen() to update the queue length
for all its ancestors, we need to update the backlog too to
keep the stats on root qdisc accurate.

Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
WANG Cong
2016-02-25 14:55:01 -08:00
committed by David S. Miller
parent 86a7996cc8
commit 2ccccf5fb4
21 changed files with 91 additions and 49 deletions

View File

@@ -598,7 +598,8 @@ deliver:
if (unlikely(err != NET_XMIT_SUCCESS)) {
if (net_xmit_drop_count(err)) {
qdisc_qstats_drop(sch);
qdisc_tree_decrease_qlen(sch, 1);
qdisc_tree_reduce_backlog(sch, 1,
qdisc_pkt_len(skb));
}
}
goto tfifo_dequeue;