Skip to content

Commit

Permalink
net_sched: gen_estimator: fix broken estimators based on percpu stats
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Dumazet authored and davem330 committed Feb 23, 2018
1 parent 2217009 commit a5f7add
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/core/gen_estimator.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ struct net_rate_estimator {
static void est_fetch_counters(struct net_rate_estimator *e,
struct gnet_stats_basic_packed *b)
{
memset(b, 0, sizeof(*b));
if (e->stats_lock)
spin_lock(e->stats_lock);

Expand Down

0 comments on commit a5f7add

Please sign in to comment.