Skip to content

Commit a5f7add

Browse files
Eric Dumazetdavem330
Eric Dumazet
authored andcommitted
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: 1c0d32f ("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>
1 parent 2217009 commit a5f7add

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/core/gen_estimator.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ struct net_rate_estimator {
6666
static void est_fetch_counters(struct net_rate_estimator *e,
6767
struct gnet_stats_basic_packed *b)
6868
{
69+
memset(b, 0, sizeof(*b));
6970
if (e->stats_lock)
7071
spin_lock(e->stats_lock);
7172

0 commit comments

Comments
 (0)