From: Jeff Kirsher <hidden> Date: 2016-09-23 05:45:44
This series contains updates to i40e and i40evf only.
Sridhar fixes link state event handling by updating the carrier and
starts/stops the Tx queues based on the link state notification from PF.
Brady fixes an issue where a user defined RSS hash key was not being
set because a user defined indirection table is not supplied when changing
the hash key, so if an indirection table is not supplied now, then a
default one is created and the hash key is correctly set. Also fixed
an issue where when NPAR was enabled, we were still using pf->mac_seid
to perform the dump port query. Instead, go through the VSI to determine
the correct ID to use in either case.
Mitch provides one fix where a conditional return code was reversed, so
he does a "switheroo" to fix the issue.
Carolyn has two fixes, first fixes an issue in the virt channel code,
where a return code was not checked for NULL when applicable. Second,
fixes an issue where we were byte swapping the port parameter, then
byte swapping it again in function execution.
Colin Ian King fixes a potential NULL pointer dereference.
Bimmy changes up i40evf_up_complete() to be void since it always returns
success anyways, which allows cleaning up of code which checked the
return code from this function.
Alex fixed an issue where the driver was incorrectly assuming that we
would always be pulling no more than 1 descriptor from each fragment.
So to correct this, we just need to make certain to test all the way to
the end of the fragments as it is possible for us to span 2 descriptors
in the block before us so we need to guarantee that even the last 6
descriptors have enough data to fill a full frame.
v2: dropped patches 1-3, 10 and 12 from the original series since Or
Gerlitz pointed out several areas of improvement in the implementation
of the VF Port representor netdev. Sridhar is re-working the series
for later submission.
The following are changes since commit cdd0766d7da19085e88df86d1e5e21d9fe3d374f:
Merge branch 'ftgmac100-ast2500-support'
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue 40GbE
Alan Brady (2):
i40e: fix setting user defined RSS hash key
i40e: fix "dump port" command when NPAR enabled
Alexander Duyck (1):
i40e: Limit TX descriptor count in cases where frag size is greater
than 16K
Bimmy Pujari (1):
i40evf: remove unnecessary error checking against i40evf_up_complete
Carolyn Wyborny (2):
i40e: Fix to check for NULL
i40e: Fix for extra byte swap in tunnel setup
Colin Ian King (1):
i40e: avoid potential null pointer dereference when assigning len
Lihong Yang (1):
i40evf: remove unnecessary error checking against i40e_shutdown_adminq
Mitch Williams (1):
i40e: return correct opcode to VF
Sridhar Samudrala (1):
i40evf: Fix link state event handling
drivers/net/ethernet/intel/i40e/i40e.h | 2 ++
drivers/net/ethernet/intel/i40e/i40e_debugfs.c | 7 ++++++-
drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 12 +++++++-----
drivers/net/ethernet/intel/i40e/i40e_main.c | 12 +++++-------
drivers/net/ethernet/intel/i40e/i40e_txrx.c | 7 ++-----
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 15 ++++++++++++---
drivers/net/ethernet/intel/i40evf/i40e_common.c | 3 ++-
drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 7 ++-----
drivers/net/ethernet/intel/i40evf/i40evf_main.c | 18 ++++++++----------
drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c | 10 +++++++---
10 files changed, 53 insertions(+), 40 deletions(-)
--
2.7.4
From: Jeff Kirsher <hidden> Date: 2016-09-23 05:45:45
From: Alan Brady <redacted>
Previously, when using ethtool to change the RSS hash key, ethtool would
report back saying the old key was still being used and no error was
reported. It was unclear whether it was being reported incorrectly or
being set incorrectly. Debugging revealed 'i40e_set_rxfh()' returned
zero immediately instead of setting the key because a user defined
indirection table is not supplied when changing the hash key.
This fix instead changes it such that if an indirection table is not
supplied, then a default one is created and the hash key is now
correctly set.
Change-ID: Iddb621897ecf208650272b7ee46702cad7b69a71
Signed-off-by: Alan Brady <redacted>
Tested-by: Andrew Bowers <redacted>
Signed-off-by: Jeff Kirsher <redacted>
---
drivers/net/ethernet/intel/i40e/i40e.h | 2 ++
drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 12 +++++++-----
drivers/net/ethernet/intel/i40e/i40e_main.c | 6 ++----
3 files changed, 11 insertions(+), 9 deletions(-)
@@ -2948,8 +2946,12 @@ static int i40e_set_rxfh(struct net_device *netdev, const u32 *indir,}/* Each 32 bits pointed by 'indir' is stored with a lut entry */-for(i=0;i<I40E_HLUT_ARRAY_SIZE;i++)-vsi->rss_lut_user[i]=(u8)(indir[i]);+if(indir)+for(i=0;i<I40E_HLUT_ARRAY_SIZE;i++)+vsi->rss_lut_user[i]=(u8)(indir[i]);+else+i40e_fill_rss_lut(pf,vsi->rss_lut_user,I40E_HLUT_ARRAY_SIZE,+vsi->rss_size);returni40e_config_rss(vsi,seed,vsi->rss_lut_user,I40E_HLUT_ARRAY_SIZE);
From: Jeff Kirsher <hidden> Date: 2016-09-23 05:45:46
From: Alan Brady <redacted>
When using the debugfs to issue the "dump port" command
with NPAR enabled, the firmware reports back with invalid argument.
The issue occurs because the pf->mac_seid was used to perform the query.
This is fine when NPAR is disabled because the switch ID == pf->mac_seid,
however this is not the case when NPAR is enabled. This fix instead
goes through the VSI to determine the correct ID to use in either case.
Change-ID: I0cd67913a7f2c4a2962e06d39e32e7447cc55b6a
Signed-off-by: Alan Brady <redacted>
Tested-by: Andrew Bowers <redacted>
Signed-off-by: Jeff Kirsher <redacted>
---
drivers/net/ethernet/intel/i40e/i40e_debugfs.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
From: Jeff Kirsher <hidden> Date: 2016-09-23 05:45:47
From: Carolyn Wyborny <redacted>
This patch fixes an issue in the virt channel code, where a return
from i40e_find_vsi_from_id was not checked for NULL when applicable.
Without this patch, there is a risk for panic and static analysis
tools complain. This patch fixes the problem by adding the check
and adding an additional input check for similar reasons.
Change-ID: I7e9be88eb7a3addb50eadc451c8336d9e06f5394
Signed-off-by: Carolyn Wyborny <redacted>
Tested-by: Andrew Bowers <redacted>
Signed-off-by: Jeff Kirsher <redacted>
---
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
From: Jeff Kirsher <hidden> Date: 2016-09-23 05:45:47
From: Mitch Williams <redacted>
This conditional is backward, so the driver responds back to the VF with
the wrong opcode. Do the old switcheroo to fix this.
Change-ID: I384035b0fef8a3881c176de4b4672009b3400b25
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 | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
@@ -2217,8 +2217,8 @@ static int i40e_vc_iwarp_qvmap_msg(struct i40e_vf *vf, u8 *msg, u16 msglen,error_param:/* send the response to the VF */returni40e_vc_send_resp_to_vf(vf,-config?I40E_VIRTCHNL_OP_RELEASE_IWARP_IRQ_MAP:-I40E_VIRTCHNL_OP_CONFIG_IWARP_IRQ_MAP,+config?I40E_VIRTCHNL_OP_CONFIG_IWARP_IRQ_MAP:+I40E_VIRTCHNL_OP_RELEASE_IWARP_IRQ_MAP,aq_ret);}
From: Jeff Kirsher <hidden> Date: 2016-09-23 05:45:48
From: Colin Ian King <redacted>
There is a sanitcy check for desc being null in the first line of
function i40evf_debug_aq. However, before that, aq_desc is cast from
desc, and aq_desc is being dereferenced on the assignment of len, so
this could be a potential null pointer deference. Fix this by moving
the initialization of len to the code block where len is being used
and hence at this point we know it is OK to dereference aq_desc.
Signed-off-by: Colin Ian King <redacted>
Tested-by: Andrew Bowers <redacted>
Signed-off-by: Jeff Kirsher <redacted>
---
drivers/net/ethernet/intel/i40evf/i40e_common.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
From: Jeff Kirsher <hidden> Date: 2016-09-23 05:45:48
From: Bimmy Pujari <redacted>
Function i40evf_up_complete() always returns success. Changed this to a
void type and removed the code that checks the return status and prints
an error message.
Change-ID: I8c400f174786b9c855f679e470f35af292fb50ad
Signed-off-by: Bimmy Pujari <redacted>
Tested-by: Andrew Bowers <redacted>
Signed-off-by: Jeff Kirsher <redacted>
---
drivers/net/ethernet/intel/i40evf/i40evf_main.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
From: Jeff Kirsher <hidden> Date: 2016-09-23 05:45:48
From: Carolyn Wyborny <redacted>
This patch fixes an issue where we were byte swapping the port
parameter, then byte swapping it again in function execution.
Obviously, that's unnecessary, so take it out of the function calls.
Without this patch, the udp based tunnel configuration would
not be correct.
Change-ID: I788d83c5bd5732170f1a81dbfa0b1ac3ca8ea5b7
Signed-off-by: Carolyn Wyborny <redacted>
Tested-by: Andrew Bowers <redacted>
Signed-off-by: Jeff Kirsher <redacted>
---
drivers/net/ethernet/intel/i40e/i40e_main.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
From: Jeff Kirsher <hidden> Date: 2016-09-23 05:45:48
From: Alexander Duyck <redacted>
The i40e driver was incorrectly assuming that we would always be pulling
no more than 1 descriptor from each fragment. It is in fact possible for
us to end up with the case where 2 descriptors worth of data may be pulled
when a frame is larger than one of the pieces generated when aligning the
payload to either 4K or pieces smaller than 16K.
To adjust for this we just need to make certain to test all the way to the
end of the fragments as it is possible for us to span 2 descriptors in the
block before us so we need to guarantee that even the last 6 descriptors
have enough data to fill a full frame.
Change-ID: Ic2ecb4d6b745f447d334e66c14002152f50e2f99
Signed-off-by: Alexander Duyck <redacted>
Tested-by: Andrew Bowers <redacted>
Signed-off-by: Jeff Kirsher <redacted>
---
drivers/net/ethernet/intel/i40e/i40e_txrx.c | 7 ++-----
drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 7 ++-----
2 files changed, 4 insertions(+), 10 deletions(-)
@@ -2621,9 +2621,7 @@ bool __i40e_chk_linearize(struct sk_buff *skb)returnfalse;/* We need to walk through the list and validate that each group-*of6fragmentstotalsatleastgso_size.Howeverwedon'tneed-*toperformsuchvalidationonthelast6sincethelast6cannot-*inheritanydatafromadescriptorafterthem.+*of6fragmentstotalsatleastgso_size.*/nr_frags-=I40E_MAX_BUFFER_TXD-2;frag=&skb_shinfo(skb)->frags[0];
@@ -2654,8 +2652,7 @@ bool __i40e_chk_linearize(struct sk_buff *skb)if(sum<0)returntrue;-/* use pre-decrement to avoid processing last fragment */-if(!--nr_frags)+if(!nr_frags--)break;sum-=skb_frag_size(stale++);
@@ -1832,9 +1832,7 @@ bool __i40evf_chk_linearize(struct sk_buff *skb)returnfalse;/* We need to walk through the list and validate that each group-*of6fragmentstotalsatleastgso_size.Howeverwedon'tneed-*toperformsuchvalidationonthelast6sincethelast6cannot-*inheritanydatafromadescriptorafterthem.+*of6fragmentstotalsatleastgso_size.*/nr_frags-=I40E_MAX_BUFFER_TXD-2;frag=&skb_shinfo(skb)->frags[0];
@@ -1865,8 +1863,7 @@ bool __i40evf_chk_linearize(struct sk_buff *skb)if(sum<0)returntrue;-/* use pre-decrement to avoid processing last fragment */-if(!--nr_frags)+if(!nr_frags--)break;sum-=skb_frag_size(stale++);
From: Jeff Kirsher <hidden> Date: 2016-09-23 05:45:48
From: Sridhar Samudrala <sridhar.samudrala@intel.com>
Currently disabling the link state from PF via
ip link set enp5s0f0 vf 0 state disable
doesn't disable the CARRIER on the VF.
This patch updates the carrier and starts/stops the tx queues based on the
link state notification from PF.
PF: enp5s0f0, VF: enp5s2
#modprobe i40e
#echo 2 > /sys/class/net/enp5s0f0/device/sriov_numvfs
#ip link set enp5s2 up
#ip -d link show enp5s2
175: enp5s2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether ea:4d:60:bc:6f:85 brd ff:ff:ff:ff:ff:ff promiscuity 0 addrgenmode eui64
#ip link set enp5s0f0 vf 0 state disable
#ip -d link show enp5s0f0
171: enp5s0f0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ether 68:05:ca:2e:72:68 brd ff:ff:ff:ff:ff:ff promiscuity 0 addrgenmode eui64 numtxqueues 72 numrxqueues 72 portid 6805ca2e7268
vf 0 MAC 00:00:00:00:00:00, spoof checking on, link-state disable, trust off
vf 1 MAC 00:00:00:00:00:00, spoof checking on, link-state auto, trust off
#ip -d link show enp5s2
175: enp5s2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
link/ether ea:4d:60:bc:6f:85 brd ff:ff:ff:ff:ff:ff promiscuity 0 addrgenmode eui64 numtxqueues 16 numrxqueues 16
Signed-off-by: Sridhar Samudrala <sridhar.samudrala@intel.com>
Tested-by: Andrew Bowers <redacted>
Signed-off-by: Jeff Kirsher <redacted>
---
drivers/net/ethernet/intel/i40evf/i40evf_main.c | 4 ++++
drivers/net/ethernet/intel/i40evf/i40evf_virtchnl.c | 10 +++++++---
2 files changed, 11 insertions(+), 3 deletions(-)
From: Jeff Kirsher <hidden> Date: 2016-09-23 05:45:49
From: Lihong Yang <redacted>
The i40e_shutdown_adminq function never returns failure. There is no need to
check the non-0 return value. Clean up the unnecessary error checking and
warning against it.
Change-ID: Ibb616f09cfb93bd1a872ebf3241a15fb8354b31b
Signed-off-by: Lihong Yang <redacted>
Tested-by: Andrew Bowers <redacted>
Signed-off-by: Jeff Kirsher <redacted>
---
drivers/net/ethernet/intel/i40evf/i40evf_main.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
@@ -1785,8 +1785,7 @@ continue_reset:i40evf_free_all_tx_resources(adapter);/* kill and reinit the admin queue */-if(i40evf_shutdown_adminq(hw))-dev_warn(&adapter->pdev->dev,"Failed to shut down adminq\n");+i40evf_shutdown_adminq(hw);adapter->current_op=I40E_VIRTCHNL_OP_UNKNOWN;err=i40evf_init_adminq(hw);if(err)