Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 1c0d32fde5bd ("net_sched: gen_estimator: complete rewrite of rate estimators")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Eric Dumazet and committed by
David S. Miller
a5f7add3 22170094

+1
+1
net/core/gen_estimator.c
··· 66 66 static void est_fetch_counters(struct net_rate_estimator *e, 67 67 struct gnet_stats_basic_packed *b) 68 68 { 69 + memset(b, 0, sizeof(*b)); 69 70 if (e->stats_lock) 70 71 spin_lock(e->stats_lock); 71 72