summaryrefslogtreecommitdiff
path: root/net/sched/sch_mqprio.c
diff options
context:
space:
mode:
authorDust Li <dust.li@linux.alibaba.com>2019-11-28 14:29:09 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-12-05 15:27:16 +0100
commitbdeadedaf82e168c7a5073436d45ab6d1c0029b1 (patch)
treee88686daaf118f9aeba3697d1e8d777b8b901d5d /net/sched/sch_mqprio.c
parent03725d91a8c949540209de629e64e3dbf65fe3f7 (diff)
net: sched: fix `tc -s class show` no bstats on class with nolock subqueues
[ Upstream commit 14e54ab9143fa60794d13ea0a66c792a2046a8f3 ] 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 5dd431b6b9 ("net: sched: introduce and use qstats read...") and bstats still remains buggy. Fixes: 22e0f8b9322c ("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/sched/sch_mqprio.c')
-rw-r--r--net/sched/sch_mqprio.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/sched/sch_mqprio.c b/net/sched/sch_mqprio.c
index 66bccc5ff4ea..03c19adb2e61 100644
--- a/net/sched/sch_mqprio.c
+++ b/net/sched/sch_mqprio.c
@@ -355,7 +355,8 @@ static int mqprio_dump_class_stats(struct Qdisc *sch, unsigned long cl,
struct netdev_queue *dev_queue = mqprio_queue_get(sch, cl);
sch = dev_queue->qdisc_sleeping;
- if (gnet_stats_copy_basic(d, NULL, &sch->bstats) < 0 ||
+ if (gnet_stats_copy_basic(d, sch->cpu_bstats,
+ &sch->bstats) < 0 ||
gnet_stats_copy_queue(d, NULL,
&sch->qstats, sch->q.qlen) < 0)
return -1;