diff options
| author | Sebastian Andrzej Siewior <[email protected]> | 2021-10-16 08:49:02 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2021-10-18 11:54:40 +0000 |
| commit | fbf307c89eb08c51da4dd039f68c19afbcf5949d (patch) | |
| tree | 8959dbffc0540940976953e50a2b3421b7f8fe5a /net/core/gen_estimator.c | |
| parent | net: make use of helper netif_is_bridge_master() (diff) | |
| download | kernel-fbf307c89eb08c51da4dd039f68c19afbcf5949d.tar.gz kernel-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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/core/gen_estimator.c')
| -rw-r--r-- | net/core/gen_estimator.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/gen_estimator.c b/net/core/gen_estimator.c index 8e582e29a41e..205df8b5116e 100644 --- a/net/core/gen_estimator.c +++ b/net/core/gen_estimator.c @@ -66,7 +66,7 @@ static void est_fetch_counters(struct net_rate_estimator *e, if (e->stats_lock) spin_lock(e->stats_lock); - __gnet_stats_copy_basic(e->running, b, e->cpu_bstats, e->bstats); + gnet_stats_add_basic(e->running, b, e->cpu_bstats, e->bstats); if (e->stats_lock) spin_unlock(e->stats_lock); |
