From fbf307c89eb08c51da4dd039f68c19afbcf5949d Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Sat, 16 Oct 2021 10:49:02 +0200 Subject: gen_stats: Add instead Set the value in __gnet_stats_copy_basic(). __gnet_stats_copy_basic() always assigns the value to the bstats argument overwriting the previous value. The later added per-CPU version always accumulated the values in the returning gnet_stats_basic_packed argument. Based on review there are five users of that function as of today: - est_fetch_counters(), ___gnet_stats_copy_basic() memsets() bstats to zero, single invocation. - mq_dump(), mqprio_dump(), mqprio_dump_class_stats() memsets() bstats to zero, multiple invocation but does not use the function due to !qdisc_is_percpu_stats(). Add the values in __gnet_stats_copy_basic() instead overwriting. Rename the function to gnet_stats_add_basic() to make it more obvious. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: David S. Miller --- net/sched/sch_mq.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'net/sched/sch_mq.c') diff --git a/net/sched/sch_mq.c b/net/sched/sch_mq.c index e04f1a87642b..1edd98a50e33 100644 --- a/net/sched/sch_mq.c +++ b/net/sched/sch_mq.c @@ -147,9 +147,8 @@ static int mq_dump(struct Qdisc *sch, struct sk_buff *skb) if (qdisc_is_percpu_stats(qdisc)) { qlen = qdisc_qlen_sum(qdisc); - __gnet_stats_copy_basic(NULL, &sch->bstats, - qdisc->cpu_bstats, - &qdisc->bstats); + gnet_stats_add_basic(NULL, &sch->bstats, + qdisc->cpu_bstats, &qdisc->bstats); __gnet_stats_copy_queue(&sch->qstats, qdisc->cpu_qstats, &qdisc->qstats, qlen); -- cgit v1.2.3