net_sched: gen_estimator: fix broken estimators based on percpu stats
authorEric Dumazet <edumazet@google.com>
Fri, 23 Feb 2018 03:45:27 +0000 (19:45 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Mar 2018 06:41:13 +0000 (22:41 -0800)
commita01550d778a4dd00bfcc548f2bfd57184192cd32
treecee3df4823d44c2afb38aad3d0741fc15355e52e
parent5b5be45ed1f283bd4d9eeef93ac4491df25d6c92
net_sched: gen_estimator: fix broken estimators based on percpu stats

[ Upstream commit a5f7add332b4ea6d4b9480971b3b0f5e66466ae9 ]

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/core/gen_estimator.c