drivers: net: Fix 64-bit statistics seqcount init
Subsystems (7)
PATCH 2/7 i40e: Initialize 64-bit statistics TX ring seqcount
In reply to Florian FainelliOn 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.
--- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_txrx.c +2 -0
@@ -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
Signature · 1 line
2.9.3
PATCH 3/7 ixgbe: Initialize 64-bit stats seqcounts
In reply to Florian FainelliOn 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.
--- drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +4 -0
@@ -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 );
Signature · 1 line
2.9.3
PATCH 4/7 nfp: Initialize RX and TX ring 64-bit stats seqcounts
In reply to Florian FainelliOn 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.
--- drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/netronome/nfp/nfp_net_common.c +2 -0
@@ -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);
Signature · 1 line
2.9.3
PATCH 6/7 netvsc: Initialize 64-bit stats seqcount
In reply to Florian FainelliOn 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.
--- drivers/net/hyperv/netvsc.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/hyperv/netvsc.c +2 -0
@@ -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 */
Signature · 1 line
2.9.3
PATCH 6/7 netvsc: Initialize 64-bit stats seqcount
In reply to Florian FainelliOn 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.
--- drivers/net/hyperv/netvsc.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/hyperv/netvsc.c +2 -0
@@ -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 */
Signature · 1 line
2.9.3
PATCH 7/7 ipvlan: Fix 64-bit statistics seqcount initialization
In reply to Florian FainelliOn 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().
--- drivers/net/ipvlan/ipvlan_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ipvlan/ipvlan_main.c +1 -1
@@ -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 ;
Signature · 1 line
2.9.3
cover drivers: net: Fix 64-bit statistics seqcount init
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(-)
Signature · 1 line
2.9.3
PATCH 1/7 b44: Initialize 64-bit stats seqcount
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.
--- drivers/net/ethernet/broadcom/b44.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/broadcom/b44.c +1 -0
@@ -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 ;
Signature · 1 line
2.9.3
PATCH 5/7 gtp: Initialize 64-bit per-cpu stats correctly
In reply to Florian FainelliOn 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.
--- drivers/net/gtp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/gtp.c +1 -1
@@ -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 ;
Signature · 1 line
2.9.3
Re: [PATCH net 4/7] nfp: Initialize RX and TX ring 64-bit stats seqcounts
In reply to Florian FainelliQuoted 6 lines · Florian Fainelli
On 32-bit hosts and with
CONFIG_DEBUG_LOCK_ALLOCwe 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 <[email protected]>
FYI, Jakub is on leave this week.
Re: [PATCH net 1/7] b44: Initialize 64-bit stats seqcount
In reply to Florian FainelliQuoted 6 lines · Florian Fainelli
On 32-bit hosts and with
CONFIG_DEBUG_LOCK_ALLOCwe 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 <[email protected]>
Thanks.
Re: [PATCH net 6/7] netvsc: Initialize 64-bit stats seqcount
In reply to Florian FainelliQuoted 18 lines · On Tue, 1 Aug 2017 12:11:12 -0700 Florian Fainelli <[email protected]>…
On 32-bit hosts and with
CONFIG_DEBUG_LOCK_ALLOCwe should be seeing a lockdep splat indicating this seqcount is not correctly initialized, fix that. In commit6c80f3fc2398("netvsc: report per-channel stats in ethtool statistics")netdev_alloc_pcpu_stats()was removed in favor of open-coding the 64-bits statistics, except thatu64_stats_init()was missed.Fixes 6c80f3fc2398 ("netvsc: report per-channel stats in ethtool statistics")Signed-off-by Florian Fainelli <[email protected]>--- drivers/net/hyperv/netvsc.c | 2 ++ 1 file changed, 2 insertions(+)drivers/net/hyperv/netvsc.c +0
-0
drivers/net/hyperv/netvsc.c int netvsc_device_add(struct hv_device *device, · line 1309
Quoted 8 lines
drivers/net/hyperv/netvsc.c +2
-0@@ -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.
David Miller
maintainerFrom: Florian Fainelli <[email protected]>
Date: Tue, 1 Aug 2017 12:11:05 -0700
Quoted 4 lines
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.
Re: [PATCH net 5/7] gtp: Initialize 64-bit per-cpu stats correctly
In reply to Florian FainelliQuoted 7 lines · Florian Fainelli
On 32-bit hosts and with
CONFIG_DEBUG_LOCK_ALLOCwe should be seeing a lockdep splat indicating this seqcount is not correctly initialized, fix that by usingnetdev_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 <[email protected]>
Thanks!