]> git.baikalelectronics.ru Git - kernel.git/commit
net: sched: fix `tc -s class show` no bstats on class with nolock subqueues
authorDust Li <dust.li@linux.alibaba.com>
Thu, 28 Nov 2019 06:29:09 +0000 (14:29 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 30 Nov 2019 18:38:40 +0000 (10:38 -0800)
commit91e603df98dfa284c12706fcff5a4e3dc105efd5
tree225370a19f639a570d6213833c6a5fb492928977
parent2512278279b29905ed0f8dfda050a2ab627fd1d1
net: sched: fix `tc -s class show` no bstats on class with nolock subqueues

When a classful qdisc's child qdisc has set the flag
TCQ_F_CPUSTATS (pfifo_fast for example), the child qdisc's
cpu_bstats should be passed to gnet_stats_copy_basic(),
but many classful qdisc didn't do that. As a result,
`tc -s class show dev DEV` always return 0 for bytes and
packets in this case.

Pass the child qdisc's cpu_bstats to gnet_stats_copy_basic()
to fix this issue.

The qstats also has this problem, but it has been fixed
in 7b5138f78f ("net: sched: introduce and use qstats read...")
and bstats still remains buggy.

Fixes: e827cb38ab42 ("net: sched: make bstats per cpu and estimator RCU safe")
Signed-off-by: Dust Li <dust.li@linux.alibaba.com>
Signed-off-by: Tony Lu <tonylu@linux.alibaba.com>
Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_mq.c
net/sched/sch_mqprio.c
net/sched/sch_multiq.c
net/sched/sch_prio.c