Commit a5f7add3 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

net_sched: gen_estimator: fix broken estimators based on percpu stats

pfifo_fast got percpu stats lately, uncovering a bug I introduced last
year in linux-4.10.

I missed the fact that we have to clear our temporary storage
before calling __gnet_stats_copy_basic() in the case of percpu stats.

Without this fix, rate estimators (tc qd replace dev xxx root est 1sec
4sec pfifo_fast) are utterly broken.

Fixes: 1c0d32fd ("net_sched: gen_estimator: complete rewrite of rate estimators")
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 22170094
...@@ -66,6 +66,7 @@ struct net_rate_estimator { ...@@ -66,6 +66,7 @@ struct net_rate_estimator {
static void est_fetch_counters(struct net_rate_estimator *e, static void est_fetch_counters(struct net_rate_estimator *e,
struct gnet_stats_basic_packed *b) struct gnet_stats_basic_packed *b)
{ {
memset(b, 0, sizeof(*b));
if (e->stats_lock) if (e->stats_lock)
spin_lock(e->stats_lock); spin_lock(e->stats_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment