All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/7] drivers: net: Fix 64-bit statistics seqcount init
@ 2017-08-01 19:11 Florian Fainelli
  2017-08-01 19:11 ` [PATCH net 1/7] b44: Initialize 64-bit stats seqcount Florian Fainelli
                   ` (8 more replies)
  0 siblings, 9 replies; 20+ messages in thread
From: Florian Fainelli @ 2017-08-01 19:11 UTC (permalink / raw)
  To: netdev; +Cc: davem, edumazet, Florian Fainelli

Hi all,

This patch series fixes a bunch of drivers to have their 64-bit statistics
seqcount cookie be initialized correctly. Most of these drivers (except b44,
gtp) are probably used on 64-bit only hosts and so the lockdep splat might have
never been seen.

Florian Fainelli (7):
  b44: Initialize 64-bit stats seqcount
  i40e: Initialize 64-bit statistics TX ring seqcount
  ixgbe: Initialize 64-bit stats seqcounts
  nfp: Initialize RX and TX ring 64-bit stats seqcounts
  gtp: Initialize 64-bit per-cpu stats correctly
  netvsc: Initialize 64-bit stats seqcount
  ipvlan: Fix 64-bit statistics seqcount initialization

 drivers/net/ethernet/broadcom/b44.c                 | 1 +
 drivers/net/ethernet/intel/i40e/i40e_txrx.c         | 2 ++
 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c   | 4 ++++
 drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 2 ++
 drivers/net/gtp.c                                   | 2 +-
 drivers/net/hyperv/netvsc.c                         | 2 ++
 drivers/net/ipvlan/ipvlan_main.c                    | 2 +-
 7 files changed, 13 insertions(+), 2 deletions(-)

-- 
2.9.3

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH net 1/7] b44: Initialize 64-bit stats seqcount
  2017-08-01 19:11 [PATCH net 0/7] drivers: net: Fix 64-bit statistics seqcount init Florian Fainelli
@ 2017-08-01 19:11 ` Florian Fainelli
  2017-08-01 20:41   ` Michael Chan
  2017-08-01 19:11   ` [Intel-wired-lan] " Florian Fainelli
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 20+ messages in thread
From: Florian Fainelli @ 2017-08-01 19:11 UTC (permalink / raw)
  To: netdev; +Cc: davem, edumazet, Florian Fainelli, Michael Chan, open list

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.

Fixes: eeda8585522b ("b44: add 64 bit stats")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/ethernet/broadcom/b44.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/broadcom/b44.c b/drivers/net/ethernet/broadcom/b44.c
index f411936b744c..a1125d10c825 100644
--- a/drivers/net/ethernet/broadcom/b44.c
+++ b/drivers/net/ethernet/broadcom/b44.c
@@ -2368,6 +2368,7 @@ static int b44_init_one(struct ssb_device *sdev,
 	bp->msg_enable = netif_msg_init(b44_debug, B44_DEF_MSG_ENABLE);
 
 	spin_lock_init(&bp->lock);
+	u64_stats_init(&bp->hw_stats.syncp);
 
 	bp->rx_pending = B44_DEF_RX_RING_PENDING;
 	bp->tx_pending = B44_DEF_TX_RING_PENDING;
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH net 2/7] i40e: Initialize 64-bit statistics TX ring seqcount
  2017-08-01 19:11 [PATCH net 0/7] drivers: net: Fix 64-bit statistics seqcount init Florian Fainelli
@ 2017-08-01 19:11   ` Florian Fainelli
  2017-08-01 19:11   ` [Intel-wired-lan] " Florian Fainelli
                     ` (7 subsequent siblings)
  8 siblings, 0 replies; 20+ messages in thread
From: Florian Fainelli @ 2017-08-01 19:11 UTC (permalink / raw)
  To: netdev
  Cc: davem, edumazet, Florian Fainelli, Jeff Kirsher,
	moderated list:INTEL ETHERNET DRIVERS, open list

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.

Fixes: 980e9b118642 ("i40e: Add support for 64 bit netstats")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/ethernet/intel/i40e/i40e_txrx.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index b936febc315a..2194960d5855 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -1113,6 +1113,8 @@ int i40e_setup_tx_descriptors(struct i40e_ring *tx_ring)
 	if (!tx_ring->tx_bi)
 		goto err;
 
+	u64_stats_init(&tx_ring->syncp);
+
 	/* round up to nearest 4K */
 	tx_ring->size = tx_ring->count * sizeof(struct i40e_tx_desc);
 	/* add u32 for head writeback, align after this takes care of
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [Intel-wired-lan] [PATCH net 2/7] i40e: Initialize 64-bit statistics TX ring seqcount
@ 2017-08-01 19:11   ` Florian Fainelli
  0 siblings, 0 replies; 20+ messages in thread
From: Florian Fainelli @ 2017-08-01 19:11 UTC (permalink / raw)
  To: intel-wired-lan

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.

Fixes: 980e9b118642 ("i40e: Add support for 64 bit netstats")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/ethernet/intel/i40e/i40e_txrx.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index b936febc315a..2194960d5855 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -1113,6 +1113,8 @@ int i40e_setup_tx_descriptors(struct i40e_ring *tx_ring)
 	if (!tx_ring->tx_bi)
 		goto err;
 
+	u64_stats_init(&tx_ring->syncp);
+
 	/* round up to nearest 4K */
 	tx_ring->size = tx_ring->count * sizeof(struct i40e_tx_desc);
 	/* add u32 for head writeback, align after this takes care of
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH net 3/7] ixgbe: Initialize 64-bit stats seqcounts
  2017-08-01 19:11 [PATCH net 0/7] drivers: net: Fix 64-bit statistics seqcount init Florian Fainelli
@ 2017-08-01 19:11   ` Florian Fainelli
  2017-08-01 19:11   ` [Intel-wired-lan] " Florian Fainelli
                     ` (7 subsequent siblings)
  8 siblings, 0 replies; 20+ messages in thread
From: Florian Fainelli @ 2017-08-01 19:11 UTC (permalink / raw)
  To: netdev
  Cc: davem, edumazet, Florian Fainelli, Jeff Kirsher,
	moderated list:INTEL ETHERNET DRIVERS, open list

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.

Fixes: 4197aa7bb818 ("ixgbevf: provide 64 bit statistics")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
index 084c53582793..032f8ac06357 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
@@ -2988,6 +2988,8 @@ int ixgbevf_setup_tx_resources(struct ixgbevf_ring *tx_ring)
 	if (!tx_ring->tx_buffer_info)
 		goto err;
 
+	u64_stats_init(&tx_ring->syncp);
+
 	/* round up to nearest 4K */
 	tx_ring->size = tx_ring->count * sizeof(union ixgbe_adv_tx_desc);
 	tx_ring->size = ALIGN(tx_ring->size, 4096);
@@ -3046,6 +3048,8 @@ int ixgbevf_setup_rx_resources(struct ixgbevf_ring *rx_ring)
 	if (!rx_ring->rx_buffer_info)
 		goto err;
 
+	u64_stats_init(&rx_ring->syncp);
+
 	/* Round up to nearest 4K */
 	rx_ring->size = rx_ring->count * sizeof(union ixgbe_adv_rx_desc);
 	rx_ring->size = ALIGN(rx_ring->size, 4096);
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [Intel-wired-lan] [PATCH net 3/7] ixgbe: Initialize 64-bit stats seqcounts
@ 2017-08-01 19:11   ` Florian Fainelli
  0 siblings, 0 replies; 20+ messages in thread
From: Florian Fainelli @ 2017-08-01 19:11 UTC (permalink / raw)
  To: intel-wired-lan

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.

Fixes: 4197aa7bb818 ("ixgbevf: provide 64 bit statistics")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
index 084c53582793..032f8ac06357 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
@@ -2988,6 +2988,8 @@ int ixgbevf_setup_tx_resources(struct ixgbevf_ring *tx_ring)
 	if (!tx_ring->tx_buffer_info)
 		goto err;
 
+	u64_stats_init(&tx_ring->syncp);
+
 	/* round up to nearest 4K */
 	tx_ring->size = tx_ring->count * sizeof(union ixgbe_adv_tx_desc);
 	tx_ring->size = ALIGN(tx_ring->size, 4096);
@@ -3046,6 +3048,8 @@ int ixgbevf_setup_rx_resources(struct ixgbevf_ring *rx_ring)
 	if (!rx_ring->rx_buffer_info)
 		goto err;
 
+	u64_stats_init(&rx_ring->syncp);
+
 	/* Round up to nearest 4K */
 	rx_ring->size = rx_ring->count * sizeof(union ixgbe_adv_rx_desc);
 	rx_ring->size = ALIGN(rx_ring->size, 4096);
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH net 4/7] nfp: Initialize RX and TX ring 64-bit stats seqcounts
  2017-08-01 19:11 [PATCH net 0/7] drivers: net: Fix 64-bit statistics seqcount init Florian Fainelli
                   ` (2 preceding siblings ...)
  2017-08-01 19:11   ` [Intel-wired-lan] " Florian Fainelli
@ 2017-08-01 19:11 ` Florian Fainelli
  2017-08-01 20:04   ` Simon Horman
  2017-08-01 19:11 ` [PATCH net 5/7] gtp: Initialize 64-bit per-cpu stats correctly Florian Fainelli
                   ` (4 subsequent siblings)
  8 siblings, 1 reply; 20+ messages in thread
From: Florian Fainelli @ 2017-08-01 19:11 UTC (permalink / raw)
  To: netdev
  Cc: davem, edumazet, Florian Fainelli, Jakub Kicinski, Simon Horman,
	Daniel Borkmann, open list:NETRONOME ETHERNET DRIVERS, open list

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.

Fixes: 4c3523623dc0 ("net: add driver for Netronome NFP4000/NFP6000 NIC VFs")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
index 18750ff0ede6..4631ca8b8eb2 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
@@ -513,6 +513,7 @@ nfp_net_tx_ring_init(struct nfp_net_tx_ring *tx_ring,
 	tx_ring->idx = idx;
 	tx_ring->r_vec = r_vec;
 	tx_ring->is_xdp = is_xdp;
+	u64_stats_init(&tx_ring->r_vec->tx_sync);
 
 	tx_ring->qcidx = tx_ring->idx * nn->stride_tx;
 	tx_ring->qcp_q = nn->tx_bar + NFP_QCP_QUEUE_OFF(tx_ring->qcidx);
@@ -532,6 +533,7 @@ nfp_net_rx_ring_init(struct nfp_net_rx_ring *rx_ring,
 
 	rx_ring->idx = idx;
 	rx_ring->r_vec = r_vec;
+	u64_stats_init(&rx_ring->r_vec->rx_sync);
 
 	rx_ring->fl_qcidx = rx_ring->idx * nn->stride_rx;
 	rx_ring->qcp_fl = nn->rx_bar + NFP_QCP_QUEUE_OFF(rx_ring->fl_qcidx);
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH net 5/7] gtp: Initialize 64-bit per-cpu stats correctly
  2017-08-01 19:11 [PATCH net 0/7] drivers: net: Fix 64-bit statistics seqcount init Florian Fainelli
                   ` (3 preceding siblings ...)
  2017-08-01 19:11 ` [PATCH net 4/7] nfp: Initialize RX and TX ring " Florian Fainelli
@ 2017-08-01 19:11 ` Florian Fainelli
  2017-08-02 10:46     ` Pablo Neira Ayuso
  2017-08-01 19:11   ` Florian Fainelli
                   ` (3 subsequent siblings)
  8 siblings, 1 reply; 20+ messages in thread
From: Florian Fainelli @ 2017-08-01 19:11 UTC (permalink / raw)
  To: netdev
  Cc: davem, edumazet, Florian Fainelli, Pablo Neira Ayuso,
	Harald Welte, open list:GTP (GPRS Tunneling Protocol),
	open list

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

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH net 6/7] netvsc: Initialize 64-bit stats seqcount
  2017-08-01 19:11 [PATCH net 0/7] drivers: net: Fix 64-bit statistics seqcount init Florian Fainelli
@ 2017-08-01 19:11   ` Florian Fainelli
  2017-08-01 19:11   ` [Intel-wired-lan] " Florian Fainelli
                     ` (7 subsequent siblings)
  8 siblings, 0 replies; 20+ messages in thread
From: Florian Fainelli @ 2017-08-01 19:11 UTC (permalink / raw)
  To: netdev
  Cc: davem, edumazet, Florian Fainelli, K. Y. Srinivasan,
	Haiyang Zhang, Stephen Hemminger,
	open list:Hyper-V CORE AND DRIVERS, open list

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. In commit 6c80f3fc2398 ("netvsc: report per-channel stats in
ethtool statistics") netdev_alloc_pcpu_stats() was removed in favor of
open-coding the 64-bits statistics, except that u64_stats_init() was
missed.

Fixes: 6c80f3fc2398 ("netvsc: report per-channel stats in ethtool statistics")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/hyperv/netvsc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index 0a9167dd72fb..96f90c75d1b7 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -1302,6 +1302,8 @@ int netvsc_device_add(struct hv_device *device,
 		struct netvsc_channel *nvchan = &net_device->chan_table[i];
 
 		nvchan->channel = device->channel;
+		u64_stats_init(&nvchan->tx_stats.syncp);
+		u64_stats_init(&nvchan->rx_stats.syncp);
 	}
 
 	/* Enable NAPI handler before init callbacks */
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH net 6/7] netvsc: Initialize 64-bit stats seqcount
@ 2017-08-01 19:11   ` Florian Fainelli
  0 siblings, 0 replies; 20+ messages in thread
From: Florian Fainelli @ 2017-08-01 19:11 UTC (permalink / raw)
  To: netdev
  Cc: Florian Fainelli, Stephen Hemminger, Haiyang Zhang, open list,
	edumazet, open list:Hyper-V CORE AND DRIVERS, davem

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. In commit 6c80f3fc2398 ("netvsc: report per-channel stats in
ethtool statistics") netdev_alloc_pcpu_stats() was removed in favor of
open-coding the 64-bits statistics, except that u64_stats_init() was
missed.

Fixes: 6c80f3fc2398 ("netvsc: report per-channel stats in ethtool statistics")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/hyperv/netvsc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index 0a9167dd72fb..96f90c75d1b7 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -1302,6 +1302,8 @@ int netvsc_device_add(struct hv_device *device,
 		struct netvsc_channel *nvchan = &net_device->chan_table[i];
 
 		nvchan->channel = device->channel;
+		u64_stats_init(&nvchan->tx_stats.syncp);
+		u64_stats_init(&nvchan->rx_stats.syncp);
 	}
 
 	/* Enable NAPI handler before init callbacks */
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH net 6/7] netvsc: Initialize 64-bit stats seqcount
  2017-08-01 19:11 [PATCH net 0/7] drivers: net: Fix 64-bit statistics seqcount init Florian Fainelli
@ 2017-08-01 19:11   ` Florian Fainelli
  2017-08-01 19:11   ` [Intel-wired-lan] " Florian Fainelli
                     ` (7 subsequent siblings)
  8 siblings, 0 replies; 20+ messages in thread
From: Florian Fainelli @ 2017-08-01 19:11 UTC (permalink / raw)
  To: netdev
  Cc: davem, edumazet, Florian Fainelli, K. Y. Srinivasan,
	Haiyang Zhang, Stephen Hemminger,
	open list:Hyper-V CORE AND DRIVERS, open list

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. In commit 6c80f3fc2398 ("netvsc: report per-channel stats in
ethtool statistics") netdev_alloc_pcpu_stats() was removed in favor of
open-coding the 64-bits statistics, except that u64_stats_init() was
missed.

Fixes: 6c80f3fc2398 ("netvsc: report per-channel stats in ethtool statistics")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/hyperv/netvsc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index 0a9167dd72fb..96f90c75d1b7 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -1302,6 +1302,8 @@ int netvsc_device_add(struct hv_device *device,
 		struct netvsc_channel *nvchan = &net_device->chan_table[i];
 
 		nvchan->channel = device->channel;
+		u64_stats_init(&nvchan->tx_stats.syncp);
+		u64_stats_init(&nvchan->rx_stats.syncp);
 	}
 
 	/* Enable NAPI handler before init callbacks */
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH net 6/7] netvsc: Initialize 64-bit stats seqcount
@ 2017-08-01 19:11   ` Florian Fainelli
  0 siblings, 0 replies; 20+ messages in thread
From: Florian Fainelli @ 2017-08-01 19:11 UTC (permalink / raw)
  To: netdev
  Cc: Florian Fainelli, Stephen Hemminger, Haiyang Zhang, open list,
	edumazet, open list:Hyper-V CORE AND DRIVERS, davem

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. In commit 6c80f3fc2398 ("netvsc: report per-channel stats in
ethtool statistics") netdev_alloc_pcpu_stats() was removed in favor of
open-coding the 64-bits statistics, except that u64_stats_init() was
missed.

Fixes: 6c80f3fc2398 ("netvsc: report per-channel stats in ethtool statistics")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/hyperv/netvsc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index 0a9167dd72fb..96f90c75d1b7 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -1302,6 +1302,8 @@ int netvsc_device_add(struct hv_device *device,
 		struct netvsc_channel *nvchan = &net_device->chan_table[i];
 
 		nvchan->channel = device->channel;
+		u64_stats_init(&nvchan->tx_stats.syncp);
+		u64_stats_init(&nvchan->rx_stats.syncp);
 	}
 
 	/* Enable NAPI handler before init callbacks */
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH net 7/7] ipvlan: Fix 64-bit statistics seqcount initialization
  2017-08-01 19:11 [PATCH net 0/7] drivers: net: Fix 64-bit statistics seqcount init Florian Fainelli
@ 2017-08-01 19:11   ` Florian Fainelli
  2017-08-01 19:11   ` [Intel-wired-lan] " Florian Fainelli
                     ` (7 subsequent siblings)
  8 siblings, 0 replies; 20+ messages in thread
From: Florian Fainelli @ 2017-08-01 19:11 UTC (permalink / raw)
  To: netdev
  Cc: davem, edumazet, Florian Fainelli, Mahesh Bandewar, Gao Feng,
	David Ahern, Matthias Schiffer, Krister Johansen,
	Florian Westphal, Sainath Grandhi, open list

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 the proper helper function: netdev_alloc_pcpu_stats().

Fixes: 2ad7bf363841 ("ipvlan: Initial check-in of the IPVLAN driver.")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/ipvlan/ipvlan_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c
index f37e3c1fd4e7..8dab74a81303 100644
--- a/drivers/net/ipvlan/ipvlan_main.c
+++ b/drivers/net/ipvlan/ipvlan_main.c
@@ -192,7 +192,7 @@ static int ipvlan_init(struct net_device *dev)
 
 	netdev_lockdep_set_classes(dev);
 
-	ipvlan->pcpu_stats = alloc_percpu(struct ipvl_pcpu_stats);
+	ipvlan->pcpu_stats = netdev_alloc_pcpu_stats(struct ipvl_pcpu_stats);
 	if (!ipvlan->pcpu_stats)
 		return -ENOMEM;
 
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH net 7/7] ipvlan: Fix 64-bit statistics seqcount initialization
@ 2017-08-01 19:11   ` Florian Fainelli
  0 siblings, 0 replies; 20+ messages in thread
From: Florian Fainelli @ 2017-08-01 19:11 UTC (permalink / raw)
  To: netdev
  Cc: davem, edumazet, Florian Fainelli, Mahesh Bandewar, Gao Feng,
	David Ahern, Matthias Schiffer, Krister Johansen,
	Florian Westphal, Sainath Grandhi, open list

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 the proper helper function: netdev_alloc_pcpu_stats().

Fixes: 2ad7bf363841 ("ipvlan: Initial check-in of the IPVLAN driver.")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/ipvlan/ipvlan_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c
index f37e3c1fd4e7..8dab74a81303 100644
--- a/drivers/net/ipvlan/ipvlan_main.c
+++ b/drivers/net/ipvlan/ipvlan_main.c
@@ -192,7 +192,7 @@ static int ipvlan_init(struct net_device *dev)
 
 	netdev_lockdep_set_classes(dev);
 
-	ipvlan->pcpu_stats = alloc_percpu(struct ipvl_pcpu_stats);
+	ipvlan->pcpu_stats = netdev_alloc_pcpu_stats(struct ipvl_pcpu_stats);
 	if (!ipvlan->pcpu_stats)
 		return -ENOMEM;
 
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: [PATCH net 4/7] nfp: Initialize RX and TX ring 64-bit stats seqcounts
  2017-08-01 19:11 ` [PATCH net 4/7] nfp: Initialize RX and TX ring " Florian Fainelli
@ 2017-08-01 20:04   ` Simon Horman
  0 siblings, 0 replies; 20+ messages in thread
From: Simon Horman @ 2017-08-01 20:04 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: netdev, davem, edumazet, Jakub Kicinski, Daniel Borkmann,
	open list:NETRONOME ETHERNET DRIVERS, open list

On Tue, Aug 01, 2017 at 12:11:09PM -0700, Florian Fainelli wrote:
> 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.
> 
> Fixes: 4c3523623dc0 ("net: add driver for Netronome NFP4000/NFP6000 NIC VFs")
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Reviewed-by: Simon Horman <simon.horman@netronome.com>

FYI, Jakub is on leave this week.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH net 1/7] b44: Initialize 64-bit stats seqcount
  2017-08-01 19:11 ` [PATCH net 1/7] b44: Initialize 64-bit stats seqcount Florian Fainelli
@ 2017-08-01 20:41   ` Michael Chan
  0 siblings, 0 replies; 20+ messages in thread
From: Michael Chan @ 2017-08-01 20:41 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: Netdev, David Miller, edumazet, open list

On Tue, Aug 1, 2017 at 12:11 PM, Florian Fainelli <f.fainelli@gmail.com> wrote:
> 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.
>
> Fixes: eeda8585522b ("b44: add 64 bit stats")
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Acked-by: Michael Chan <michael.chan@broadcom.com>

Thanks.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH net 6/7] netvsc: Initialize 64-bit stats seqcount
  2017-08-01 19:11   ` Florian Fainelli
  (?)
@ 2017-08-02  2:42   ` Stephen Hemminger
  -1 siblings, 0 replies; 20+ messages in thread
From: Stephen Hemminger @ 2017-08-02  2:42 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: netdev, Stephen Hemminger, Haiyang Zhang, open list, edumazet,
	open list:Hyper-V CORE AND DRIVERS, davem

On Tue,  1 Aug 2017 12:11:12 -0700
Florian Fainelli <f.fainelli@gmail.com> wrote:

> 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. In commit 6c80f3fc2398 ("netvsc: report per-channel stats in
> ethtool statistics") netdev_alloc_pcpu_stats() was removed in favor of
> open-coding the 64-bits statistics, except that u64_stats_init() was
> missed.
> 
> Fixes: 6c80f3fc2398 ("netvsc: report per-channel stats in ethtool statistics")
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>  drivers/net/hyperv/netvsc.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
> index 0a9167dd72fb..96f90c75d1b7 100644
> --- a/drivers/net/hyperv/netvsc.c
> +++ b/drivers/net/hyperv/netvsc.c
> @@ -1302,6 +1302,8 @@ int netvsc_device_add(struct hv_device *device,
>  		struct netvsc_channel *nvchan = &net_device->chan_table[i];
>  
>  		nvchan->channel = device->channel;
> +		u64_stats_init(&nvchan->tx_stats.syncp);
> +		u64_stats_init(&nvchan->rx_stats.syncp);
>  	}
>  
>  	/* Enable NAPI handler before init callbacks */


Looks good, thanks. 32 bit guests are still supported but rarely tested.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH net 0/7] drivers: net: Fix 64-bit statistics seqcount init
  2017-08-01 19:11 [PATCH net 0/7] drivers: net: Fix 64-bit statistics seqcount init Florian Fainelli
                   ` (7 preceding siblings ...)
  2017-08-01 19:11   ` Florian Fainelli
@ 2017-08-02  3:06 ` David Miller
  8 siblings, 0 replies; 20+ messages in thread
From: David Miller @ 2017-08-02  3:06 UTC (permalink / raw)
  To: f.fainelli; +Cc: netdev, edumazet

From: Florian Fainelli <f.fainelli@gmail.com>
Date: Tue,  1 Aug 2017 12:11:05 -0700

> This patch series fixes a bunch of drivers to have their 64-bit statistics
> seqcount cookie be initialized correctly. Most of these drivers (except b44,
> gtp) are probably used on 64-bit only hosts and so the lockdep splat might have
> never been seen.

Series applied, thanks.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH net 5/7] gtp: Initialize 64-bit per-cpu stats correctly
  2017-08-01 19:11 ` [PATCH net 5/7] gtp: Initialize 64-bit per-cpu stats correctly Florian Fainelli
@ 2017-08-02 10:46     ` Pablo Neira Ayuso
  0 siblings, 0 replies; 20+ messages in thread
From: Pablo Neira Ayuso @ 2017-08-02 10:46 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: netdev, davem, edumazet, Harald Welte,
	open list:GTP (GPRS Tunneling Protocol),
	open list

On Tue, Aug 01, 2017 at 12:11:10PM -0700, Florian Fainelli wrote:
> 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>

Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>

Thanks!

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH net 5/7] gtp: Initialize 64-bit per-cpu stats correctly
@ 2017-08-02 10:46     ` Pablo Neira Ayuso
  0 siblings, 0 replies; 20+ messages in thread
From: Pablo Neira Ayuso @ 2017-08-02 10:46 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: netdev, davem, edumazet, Harald Welte,
	open list:GTP (GPRS Tunneling Protocol),
	open list

On Tue, Aug 01, 2017 at 12:11:10PM -0700, Florian Fainelli wrote:
> 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>

Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>

Thanks!

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2017-08-02 10:46 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-01 19:11 [PATCH net 0/7] drivers: net: Fix 64-bit statistics seqcount init Florian Fainelli
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   ` [Intel-wired-lan] " Florian Fainelli
2017-08-01 19:11 ` [PATCH net 3/7] ixgbe: Initialize 64-bit stats seqcounts Florian Fainelli
2017-08-01 19:11   ` [Intel-wired-lan] " 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 ` [PATCH net 5/7] gtp: Initialize 64-bit per-cpu stats correctly Florian Fainelli
2017-08-02 10:46   ` Pablo Neira Ayuso
2017-08-02 10:46     ` 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-01 19:11 ` 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
2017-08-01 19:11   ` Florian Fainelli
2017-08-02  3:06 ` [PATCH net 0/7] drivers: net: Fix 64-bit statistics seqcount init David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.