From: Jeff Kirsher <hidden> Date: 2015-09-30 12:52:43
This series contains updates to i40e and i40evf only.
Vasily Averin provides a couple of rtnl lock/unlock fixes for both i40e
and i40evf.
Shannon provides several updates and fixes, first fixes up a type clash
in i40e_aq_rc_to_posix(), where the error codes are signed values, so we
need to treat them as such. Then fixes up a padding issue where an
extra byte is added in i40e_aqc_get_cee_dcb_cfg_v1_resp to directly
acknowledge the padding. Updated i40e to keep debugfs register read
and writes from accessing outside of the io-remapped space. Added
support and device id for another 20 GbE device.
Jesse fixes the transmit hand workaround code for ARM that was causing
Tx hangs to still occur occasionally when there really was no hang. Then
fixed the receive dropped counter to show up in netstat interface.
Refactor the interrupt enable function since it was always making the
caller add the base_vector from the VSI struct which is already passed
to the function. Fix kbuild warnings found in 0day build infrastructure
by adding a harmless cast to a dev_info(), also fix 32 bit build
warnings found by sparse.
Greg fixed a configuration error that results if a port VLAN is set
for a VF before the VF driver is loaded, so that when the VF driver is
loaded the port VLAN is ignored.
Mitch fixes the use of QOS field consistently in
i40e_ndo_set_vf_port_vlan(). Modified the init timing of the driver
to increase stability on load/unload and SR-IOV enable/disable cycles.
Anjali updates i40e to not collect VEB stats if they are disabled in the
hardware for performance reasons.
The following are changes since commit 4bf1b54f9df7ced4869f7dfd0bdf5eb22aa98447:
Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue master
Anjali Singhai Jain (1):
i40e: Strip VEB stats if they are disabled in HW
Greg Rose (2):
i40e: Fix a port VLAN configuration bug
i40e: Remove useless message
Jesse Brandeburg (6):
i40e/i40evf: fix Tx hang workaround code
i40e: count drops in netstat interface
i40e: refactor interrupt enable
i40e: warn on double free
i40e: fix kbuild warnings
i40e: fix 32 bit build warnings
Mitch Williams (2):
i40e: use QOS field consistently
i40evf: tweak init timing
Shannon Nelson (4):
i40e/i40evf: fix up type clash in i40e_aq_rc_to_posix conversion
i40e: fixup padding issue in get_cee_dcb_cfg_v1_resp
i40e: limit debugfs io ops
i40e/i40evf: add new device id 1588
Vasily Averin (2):
i40evf: missing rtnl_unlock in i40evf_resume()
i40e: rtnl_lock called twice in i40e_pci_error_resume()
drivers/net/ethernet/intel/i40e/i40e.h | 4 ++-
drivers/net/ethernet/intel/i40e/i40e_adminq.h | 9 +++--
drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h | 13 +++++--
drivers/net/ethernet/intel/i40e/i40e_common.c | 6 +---
drivers/net/ethernet/intel/i40e/i40e_debugfs.c | 12 +++----
drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 10 ++++--
drivers/net/ethernet/intel/i40e/i40e_main.c | 42 +++++++++++-----------
drivers/net/ethernet/intel/i40e/i40e_txrx.c | 11 +++---
drivers/net/ethernet/intel/i40e/i40e_txrx.h | 12 +++----
drivers/net/ethernet/intel/i40e/i40e_type.h | 1 +
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 9 +++--
drivers/net/ethernet/intel/i40evf/i40e_adminq.h | 9 +++--
drivers/net/ethernet/intel/i40evf/i40e_common.c | 1 +
drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 3 +-
drivers/net/ethernet/intel/i40evf/i40e_type.h | 1 +
drivers/net/ethernet/intel/i40evf/i40evf_main.c | 7 ++--
16 files changed, 87 insertions(+), 63 deletions(-)
--
2.4.3
From: Jeff Kirsher <hidden> Date: 2015-09-30 12:52:44
From: Jesse Brandeburg <redacted>
The arm writeback (arm_wb) code is used for kicking the Tx ring to
make sure any pending work is completed even if interrupts are
disabled. It was running when it didn't need to, and not clearing
the ring->arm_wb state after it was set. This caused Tx hangs
to still occur occasionally when there really was no hang.
Fix this by resetting the variable right after it was used.
Change-ID: I7bf75d552ba9c4bd203d40615213861a24bb5594
Signed-off-by: Jesse Brandeburg <redacted>
Tested-by: Andrew Bowers <redacted>
Signed-off-by: Jeff Kirsher <redacted>
---
drivers/net/ethernet/intel/i40e/i40e_txrx.c | 1 +
drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 3 +--
2 files changed, 2 insertions(+), 2 deletions(-)
@@ -1842,6 +1842,7 @@ int i40e_napi_poll(struct napi_struct *napi, int budget)i40e_for_each_ring(ring,q_vector->tx){clean_complete&=i40e_clean_tx_irq(ring,vsi->work_limit);arm_wb|=ring->arm_wb;+ring->arm_wb=false;}/* We attempt to distribute budget to each Rx queue fairly, but don't
@@ -1288,6 +1286,7 @@ int i40evf_napi_poll(struct napi_struct *napi, int budget)i40e_for_each_ring(ring,q_vector->tx){clean_complete&=i40e_clean_tx_irq(ring,vsi->work_limit);arm_wb|=ring->arm_wb;+ring->arm_wb=false;}/* We attempt to distribute budget to each Rx queue fairly, but don't
From: Jeff Kirsher <hidden> Date: 2015-09-30 12:52:44
From: Shannon Nelson <redacted>
The struct i40e_aqc_get_cee_dcb_cfg_v1_resp was originally defined with
word boundary layout issues, which most compilers deal with by silently
adding padding, making the actual struct larger than designed.
This patch adds an extra byte in fields reserved3 and reserved4 to directly
acknowledge that padding.
Because the struct doesn't actually change in size or layout, this doesn't
constitute a change in the API.
Change-ID: I53fa4741b73fa255621232a85fba000b0e223015
Signed-off-by: Shannon Nelson <redacted>
Tested-by: Andrew Bowers <redacted>
Signed-off-by: Jeff Kirsher <redacted>
---
drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
From: Jeff Kirsher <hidden> Date: 2015-09-30 12:52:44
From: Shannon Nelson <redacted>
The error code sent into i40e_aq_rc_to_posix() are signed values, so we
really need to treat them as such.
Change-ID: I3d1ae0ee9ae0b1b6f5fc424f8b8cc58b0ea93203
Reported-by: Helin Zhang <redacted>
Signed-off-by: Shannon Nelson <redacted>
Tested-by: Andrew Bowers <redacted>
Signed-off-by: Jeff Kirsher <redacted>
---
drivers/net/ethernet/intel/i40e/i40e_adminq.h | 9 ++++++---
drivers/net/ethernet/intel/i40evf/i40e_adminq.h | 9 ++++++---
2 files changed, 12 insertions(+), 6 deletions(-)
From: Jeff Kirsher <hidden> Date: 2015-09-30 12:52:44
From: Greg Rose <redacted>
If a port VLAN is set for a given virtual function (VF) before the VF
driver is loaded then a configuration error results in which the port
VLAN is ignored when the VF driver is subsequently loaded. This causes
the VF's MAC/VLAN filters to not use the correct VLAN filter. This
patch ensures that the port VLAN filter is considered at the right time
during configuration of the VF's MAC/VLAN filters.
Change-ID: I28f404cbc21a4c6d70a7980b87c77f13f06685a4
Signed-off-by: Greg Rose <redacted>
Tested-by: Andrew Bowers <redacted>
Signed-off-by: Jeff Kirsher <redacted>
---
drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Jeff Kirsher <hidden> Date: 2015-09-30 12:52:45
From: Mitch Williams <redacted>
In i40e_ndo_set_vf_port_vlan, we were using the QOS value
inconsistently, sometimes shifting it, sometimes not. Do the shift-and-
or operation correctly, once, and use the result consistently everywhere
in the function.
Change-ID: I46f062f3edc90a8a017ecec9137f4d1ab0ab9e41
Signed-off-by: Mitch Williams <redacted>
Tested-by: Andrew Bowers <redacted>
Signed-off-by: Jeff Kirsher <redacted>
---
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
@@ -2116,8 +2117,7 @@ int i40e_ndo_set_vf_port_vlan(struct net_device *netdev,gotoerror_pvid;}-if(le16_to_cpu(vsi->info.pvid)==-(vlan_id|(qos<<I40E_VLAN_PRIORITY_SHIFT)))+if(le16_to_cpu(vsi->info.pvid)==vlanprio)/* duplicate request, so just return success */gotoerror_pvid;
@@ -2141,7 +2141,7 @@ int i40e_ndo_set_vf_port_vlan(struct net_device *netdev,*MACaddressesdeleted.*/if((!(vlan_id||qos)||-(vlan_id|qos)!=le16_to_cpu(vsi->info.pvid))&&+vlanprio!=le16_to_cpu(vsi->info.pvid))&&vsi->info.pvid)ret=i40e_vsi_add_vlan(vsi,I40E_VLAN_ANY);
@@ -2156,8 +2156,7 @@ int i40e_ndo_set_vf_port_vlan(struct net_device *netdev,}}if(vlan_id||qos)-ret=i40e_vsi_add_pvid(vsi,-vlan_id|(qos<<I40E_VLAN_PRIORITY_SHIFT));+ret=i40e_vsi_add_pvid(vsi,vlanprio);elsei40e_vsi_remove_pvid(vsi);
From: Jeff Kirsher <hidden> Date: 2015-09-30 12:52:45
From: Greg Rose <redacted>
Remove a useless message that blathers on whenever a vxlan port is deleted.
Change-ID: If63fb8cf38e56cf433b68e498f11389de51919ba
Signed-off-by: Greg Rose <redacted>
Tested-by: Andrew Bowers <redacted>
Signed-off-by: Jeff Kirsher <redacted>
---
drivers/net/ethernet/intel/i40e/i40e_main.c | 3 ---
1 file changed, 3 deletions(-)
@@ -8175,9 +8175,6 @@ static void i40e_del_vxlan_port(struct net_device *netdev,pf->vxlan_ports[idx]=0;pf->pending_vxlan_bitmap|=BIT_ULL(idx);pf->flags|=I40E_FLAG_VXLAN_FILTER_SYNC;--dev_info(&pf->pdev->dev,"deleting vxlan port %d\n",-ntohs(port));}else{netdev_warn(netdev,"vxlan port %d was not found, not deleting\n",ntohs(port));
From: Jeff Kirsher <hidden> Date: 2015-09-30 12:52:45
From: Shannon Nelson <redacted>
Don't let the debugfs register read and write commands try to access
outside of the ioremapped space. While we're at it, remove the use of
a misleading constant.
Change-ID: Ifce2893e232c65c7a76c23532c658f298218a81b
Signed-off-by: Shannon Nelson <redacted>
Tested-by: Andrew Bowers <redacted>
Signed-off-by: Jeff Kirsher <redacted>
---
drivers/net/ethernet/intel/i40e/i40e.h | 3 ++-
drivers/net/ethernet/intel/i40e/i40e_debugfs.c | 12 ++++++------
drivers/net/ethernet/intel/i40e/i40e_main.c | 9 ++++-----
3 files changed, 12 insertions(+), 12 deletions(-)
From: Jeff Kirsher <hidden> Date: 2015-09-30 12:52:45
From: Jesse Brandeburg <redacted>
The i40e rx_dropped counter was not showing up in netstat -i.
Add the right counter to be updated with the stats.
Change-ID: I4dd552e9995836099184f9d9a08e90edb591155f
Signed-off-by: Jesse Brandeburg <redacted>
Tested-by: Andrew Bowers <redacted>
Signed-off-by: Jeff Kirsher <redacted>
---
drivers/net/ethernet/intel/i40e/i40e_main.c | 1 +
1 file changed, 1 insertion(+)
From: Jeff Kirsher <hidden> Date: 2015-09-30 12:52:46
From: Anjali Singhai Jain <redacted>
Due to performance reasons, VEB stats have been disabled in the hw. This
patch adds code to check for that condition before accumulating these
stats.
Change-ID: I7d805669476fedabb073790403703798ae5d878e
Signed-off-by: Anjali Singhai Jain <redacted>
Tested-by: Andrew Bowers <redacted>
Signed-off-by: Jeff Kirsher <redacted>
---
drivers/net/ethernet/intel/i40e/i40e.h | 1 +
drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 9 ++++++---
drivers/net/ethernet/intel/i40e/i40e_main.c | 13 +++++++++----
3 files changed, 16 insertions(+), 7 deletions(-)
@@ -5907,10 +5907,12 @@ static void i40e_watchdog_subtask(struct i40e_pf *pf)if(pf->vsi[i]&&pf->vsi[i]->netdev)i40e_update_stats(pf->vsi[i]);-/* Update the stats for the active switching components */-for(i=0;i<I40E_MAX_VEB;i++)-if(pf->veb[i])-i40e_update_veb_stats(pf->veb[i]);+if(pf->flags&I40E_FLAG_VEB_STATS_ENABLED){+/* Update the stats for the active switching components */+for(i=0;i<I40E_MAX_VEB;i++)+if(pf->veb[i])+i40e_update_veb_stats(pf->veb[i]);+}i40e_ptp_rx_hang(pf->vsi[pf->lan_vsi]);}
@@ -7998,6 +8000,9 @@ static int i40e_sw_init(struct i40e_pf *pf)pf->lan_veb=I40E_NO_VEB;pf->lan_vsi=I40E_NO_VSI;+/* By default FW has this off for performance reasons */+pf->flags&=~I40E_FLAG_VEB_STATS_ENABLED;+/* set up queue assignment tracking */size=sizeof(structi40e_lump_tracking)+(sizeof(u16)*pf->hw.func_caps.num_tx_qp);
From: Jeff Kirsher <hidden> Date: 2015-09-30 12:52:46
From: Jesse Brandeburg <redacted>
The interrupt enable function was always making the caller add
the base_vector from the VSI struct which is already passed to
the function. Just collapse the math into the helper function.
Change-ID: I54ef33aa7ceebc3231c3cc48f7b39fd0c3ff5806
Signed-off-by: Jesse Brandeburg <redacted>
Tested-by: Andrew Bowers <redacted>
Signed-off-by: Jeff Kirsher <redacted>
---
drivers/net/ethernet/intel/i40e/i40e_main.c | 10 ++++------
drivers/net/ethernet/intel/i40e/i40e_txrx.c | 6 ++----
2 files changed, 6 insertions(+), 10 deletions(-)
From: Jeff Kirsher <hidden> Date: 2015-09-30 12:52:47
From: Jesse Brandeburg <redacted>
Down was requesting queue disables, but then exited immediately without
waiting for the queues to actually disable. This could allow any
function called after i40evf_down to run immediately, including
i40evf_up, and causes a memory leak.
This issue has been fixed in a recent refactor of the reset code, but
add a couple WARN_ONs in the slow path to help us recognize if we
reintroduce this issue or if we missed any cases.
Change-ID: I27b6b5c9a79c1892f0ba453129f116bc32647dd0
Signed-off-by: Jesse Brandeburg <redacted>
Signed-off-by: Mitch Williams <redacted>
Tested-by: Andrew Bowers <redacted>
Signed-off-by: Jeff Kirsher <redacted>
---
drivers/net/ethernet/intel/i40e/i40e_txrx.c | 4 ++++
1 file changed, 4 insertions(+)
@@ -923,6 +923,8 @@ int i40e_setup_tx_descriptors(struct i40e_ring *tx_ring)if(!dev)return-ENOMEM;+/* warn if we are about to overwrite the pointer */+WARN_ON(tx_ring->tx_bi);bi_size=sizeof(structi40e_tx_buffer)*tx_ring->count;tx_ring->tx_bi=kzalloc(bi_size,GFP_KERNEL);if(!tx_ring->tx_bi)
@@ -1083,6 +1085,8 @@ int i40e_setup_rx_descriptors(struct i40e_ring *rx_ring)structdevice*dev=rx_ring->dev;intbi_size;+/* warn if we are about to overwrite the pointer */+WARN_ON(rx_ring->rx_bi);bi_size=sizeof(structi40e_rx_buffer)*rx_ring->count;rx_ring->rx_bi=kzalloc(bi_size,GFP_KERNEL);if(!rx_ring->rx_bi)
From: Jeff Kirsher <hidden> Date: 2015-09-30 12:52:48
From: Jesse Brandeburg <redacted>
The 0day build infrastructure found some issues in i40e, this
removes the warnings by adding a harmless cast to a dev_info.
CC: kbuild-all@01.org
Signed-off-by: Jesse Brandeburg <redacted>
Reported-by: kbuild test robot <redacted>
Tested-by: Andrew Bowers <redacted>
Signed-off-by: Jeff Kirsher <redacted>
---
drivers/net/ethernet/intel/i40e/i40e_debugfs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
From: Jeff Kirsher <hidden> Date: 2015-09-30 12:52:48
From: Mitch Williams <redacted>
This patch tweaks the init timing of the driver just a little bit to
increase stability on load/unload and SR-IOV enable/disable cycles.
First, run the init_task loop a little quicker in order to reduce
overall init time.
Second, stagger the start of the init task based on the device's
PCIe function ID. This lessens the impact on the firmware when a
whole bunch of VFs are initialized simultaneously, e.g. enabling
SR-IOV without the VF driver blacklisted. For single VFs assigned
to VMs this will have no effect as the function ID will always be 0.
Signed-off-by: Mitch Williams <redacted>
Tested-by: Andrew Bowers <redacted>
Signed-off-by: Jeff Kirsher <redacted>
---
drivers/net/ethernet/intel/i40evf/i40evf_main.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
From: Jeff Kirsher <hidden> Date: 2015-09-30 12:52:51
From: Jesse Brandeburg <redacted>
Sparse found some issues with 32 bit compilation, which probably should
at least work without warning. Not only that, but the code was wrong.
Thanks sparse!!
And thanks to the kbuild robot zero day testing for finding this issue.
$ make ARCH=i386 M=drivers/net/ethernet/intel/i40e C=2 CF="-D__CHECK_ENDIAN__"
CHECK drivers/net/ethernet/intel/i40e/i40e_main.c
include/linux/etherdevice.h:79:32: warning: restricted __be16 degrades to integer
drivers/net/ethernet/intel/i40e/i40e_main.c:7565:17: warning: shift too big (32) for type unsigned long
drivers/net/ethernet/intel/i40e/i40e_main.c:7565:17: warning: shift too big (42) for type unsigned long
drivers/net/ethernet/intel/i40e/i40e_main.c:7565:17: warning: shift too big (39) for type unsigned long
drivers/net/ethernet/intel/i40e/i40e_main.c:7565:17: warning: shift too big (40) for type unsigned long
CC: kbuild-all@01.org
Signed-off-by: Jesse Brandeburg <redacted>
Reported-by: kbuild test robot <redacted>
Tested-by: Andrew Bowers <redacted>
Signed-off-by: Jeff Kirsher <redacted>
---
drivers/net/ethernet/intel/i40e/i40e_common.c | 5 -----
drivers/net/ethernet/intel/i40e/i40e_txrx.h | 12 ++++++------
2 files changed, 6 insertions(+), 11 deletions(-)