From: Florian Fainelli <f.fainelli@gmail.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, edumazet@google.com,
Florian Fainelli <f.fainelli@gmail.com>,
Pablo Neira Ayuso <pablo@netfilter.org>,
Harald Welte <laforge@gnumonks.org>,
osmocom-net-gprs@lists.osmocom.org (open list:GTP (GPRS
Tunneling Protocol)), linux-kernel@vger.kernel.org (open list)
Subject: [PATCH net 5/7] gtp: Initialize 64-bit per-cpu stats correctly
Date: Tue, 1 Aug 2017 12:11:10 -0700 [thread overview]
Message-ID: <20170801191113.8754-6-f.fainelli@gmail.com> (raw)
In-Reply-To: <20170801191113.8754-1-f.fainelli@gmail.com>
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
next prev parent reply other threads:[~2017-08-01 19:11 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20170801191113.8754-1-f.fainelli@gmail.com>
2017-08-01 19:11 ` [PATCH net 1/7] b44: Initialize 64-bit stats seqcount Florian Fainelli
2017-08-01 20:41 ` Michael Chan
2017-08-01 19:11 ` [PATCH net 2/7] i40e: Initialize 64-bit statistics TX ring seqcount Florian Fainelli
2017-08-01 19:11 ` [PATCH net 3/7] ixgbe: Initialize 64-bit stats seqcounts Florian Fainelli
2017-08-01 19:11 ` [PATCH net 4/7] nfp: Initialize RX and TX ring " Florian Fainelli
2017-08-01 20:04 ` Simon Horman
2017-08-01 19:11 ` Florian Fainelli [this message]
2017-08-02 10:46 ` [PATCH net 5/7] gtp: Initialize 64-bit per-cpu stats correctly Pablo Neira Ayuso
2017-08-01 19:11 ` [PATCH net 6/7] netvsc: Initialize 64-bit stats seqcount Florian Fainelli
2017-08-01 19:11 ` Florian Fainelli
2017-08-02 2:42 ` Stephen Hemminger
2017-08-01 19:11 ` [PATCH net 7/7] ipvlan: Fix 64-bit statistics seqcount initialization Florian Fainelli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170801191113.8754-6-f.fainelli@gmail.com \
--to=f.fainelli@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=laforge@gnumonks.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=osmocom-net-gprs@lists.osmocom.org \
--cc=pablo@netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome