summaryrefslogtreecommitdiffstats
path: root/net/sched/sch_mqprio.c
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2021-10-16 10:49:02 +0200
committerDavid S. Miller <davem@davemloft.net>2021-10-18 13:54:40 +0200
commitfbf307c89eb08c51da4dd039f68c19afbcf5949d (patch)
tree8959dbffc0540940976953e50a2b3421b7f8fe5a /net/sched/sch_mqprio.c
parentnet: make use of helper netif_is_bridge_master() (diff)
downloadlinux-fbf307c89eb08c51da4dd039f68c19afbcf5949d.tar.xz
linux-fbf307c89eb08c51da4dd039f68c19afbcf5949d.zip
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 <bigeasy@linutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_mqprio.c')
-rw-r--r--net/sched/sch_mqprio.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/net/sched/sch_mqprio.c b/net/sched/sch_mqprio.c
index e1904e62425e..4bae601e15e1 100644
--- a/net/sched/sch_mqprio.c
+++ b/net/sched/sch_mqprio.c
@@ -405,9 +405,8 @@ static int mqprio_dump(struct Qdisc *sch, struct sk_buff *skb)
if (qdisc_is_percpu_stats(qdisc)) {
__u32 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);
@@ -535,9 +534,9 @@ static int mqprio_dump_class_stats(struct Qdisc *sch, unsigned long cl,
if (qdisc_is_percpu_stats(qdisc)) {
qlen = qdisc_qlen_sum(qdisc);
- __gnet_stats_copy_basic(NULL, &bstats,
- qdisc->cpu_bstats,
- &qdisc->bstats);
+ gnet_stats_add_basic(NULL, &bstats,
+ qdisc->cpu_bstats,
+ &qdisc->bstats);
__gnet_stats_copy_queue(&qstats,
qdisc->cpu_qstats,
&qdisc->qstats,