Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1701371

[PATCH net 5/7] gtp: Initialize 64-bit per-cpu stats correctly

From Florian Fainelli <f.fainelli@gmail.com>
Newsgroups linux.kernel
Subject [PATCH net 5/7] gtp: Initialize 64-bit per-cpu stats correctly
Date 2017-08-01 21:20 +0200
Message-ID <u9KS0-82o-63@gated-at.bofh.it> (permalink)
References <u9KRX-82o-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 32-bit hosts and with CONFIG_DEBUG_LOCK_ALLOC we should be seeing a
lockdep splat indicating this seqcount is not correctly initialized, fix
that by using netdev_alloc_pcpu_stats() instead of an open coded
allocation.

Fixes: 459aa660eb1d ("gtp: add initial driver for datapath of GPRS Tunneling Protocol (GTP-U)")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/gtp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c
index 1542e837fdfa..f38e32a7ec9c 100644
--- a/drivers/net/gtp.c
+++ b/drivers/net/gtp.c
@@ -364,7 +364,7 @@ static int gtp_dev_init(struct net_device *dev)
 
 	gtp->dev = dev;
 
-	dev->tstats = alloc_percpu(struct pcpu_sw_netstats);
+	dev->tstats = netdev_alloc_pcpu_stats(struct pcpu_sw_netstats);
 	if (!dev->tstats)
 		return -ENOMEM;
 
-- 
2.9.3

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH net 5/7] gtp: Initialize 64-bit per-cpu stats correctly Florian Fainelli <f.fainelli@gmail.com> - 2017-08-01 21:20 +0200
  Re: [PATCH net 5/7] gtp: Initialize 64-bit per-cpu stats correctly Pablo Neira Ayuso <pablo@netfilter.org> - 2017-08-02 12:50 +0200

csiph-web