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

net: sched: initialize bstats syncp

Use netdev_alloc_pcpu_stats to allocate percpu stats and initialize syncp.

Fixes: 22e0f8b9322c "net: sched: make bstats per cpu and estimator RCU safe"
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Acked-by: Cong Wang <cwang@twopensource.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Sabrina Dubroca and committed by
David S. Miller
7c1c97d5 32bf08a6

+1 -1
+1 -1
net/sched/sch_api.c
··· 947 947 if (!ops->init || (err = ops->init(sch, tca[TCA_OPTIONS])) == 0) { 948 948 if (qdisc_is_percpu_stats(sch)) { 949 949 sch->cpu_bstats = 950 - alloc_percpu(struct gnet_stats_basic_cpu); 950 + netdev_alloc_pcpu_stats(struct gnet_stats_basic_cpu); 951 951 if (!sch->cpu_bstats) 952 952 goto err_out4; 953 953