diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2021-10-16 11:49:02 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-10-18 14:54:40 +0300 |
commit | fbf307c89eb08c51da4dd039f68c19afbcf5949d (patch) | |
tree | 8959dbffc0540940976953e50a2b3421b7f8fe5a /include/net/gen_stats.h | |
parent | 254ec036db1123b10e23e1412c191a3cf70dce71 (diff) | |
download | linux-fbf307c89eb08c51da4dd039f68c19afbcf5949d.tar.xz |
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 'include/net/gen_stats.h')
-rw-r--r-- | include/net/gen_stats.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/net/gen_stats.h b/include/net/gen_stats.h index 1424e02cef90..25740d004bdb 100644 --- a/include/net/gen_stats.h +++ b/include/net/gen_stats.h @@ -46,10 +46,10 @@ int gnet_stats_copy_basic(const seqcount_t *running, struct gnet_dump *d, struct gnet_stats_basic_cpu __percpu *cpu, struct gnet_stats_basic_packed *b); -void __gnet_stats_copy_basic(const seqcount_t *running, - struct gnet_stats_basic_packed *bstats, - struct gnet_stats_basic_cpu __percpu *cpu, - struct gnet_stats_basic_packed *b); +void gnet_stats_add_basic(const seqcount_t *running, + struct gnet_stats_basic_packed *bstats, + struct gnet_stats_basic_cpu __percpu *cpu, + struct gnet_stats_basic_packed *b); int gnet_stats_copy_basic_hw(const seqcount_t *running, struct gnet_dump *d, struct gnet_stats_basic_cpu __percpu *cpu, |