From: Tony Nguyen <anthony.l.nguyen@intel.com> Date: 2021-02-19 21:36:04
This series contains updates to i40e driver only.
Slawomir resolves an issue with the IPv6 extension headers being
processed incorrectly.
Keita Suzuki fixes a memory leak on probe failure.
Mateusz initializes AQ command structures to zero to comply with
spec, fixes FW flow control settings being overwritten and resolves an
issue with adding VLAN filters after enabling FW LLDP. He also adds
an additional check when adding TC filter as the current check doesn't
properly distinguish between IPv4 and IPv6.
Sylwester removes setting disabled bit when syncing filters as this
prevents VFs from completing setup.
Norbert cleans up sparse warnings.
v2:
- Fix fixes tag on patch 7
The following are changes since commit 3af409ca278d4a8d50e91f9f7c4c33b175645cf3:
net: enetc: fix destroyed phylink dereference during unbind
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue 40GbE
Keita Suzuki (1):
i40e: Fix memory leak in i40e_probe
Mateusz Palczewski (4):
i40e: Add zero-initialization of AQ command structures
i40e: Fix overwriting flow control settings during driver loading
i40e: Fix addition of RX filters after enabling FW LLDP agent
i40e: Fix add TC filter for IPv6
Norbert Ciosek (1):
i40e: Fix endianness conversions
Slawomir Laba (1):
i40e: Fix flow for IPv6 next header (extension header)
Sylwester Dziedziuch (1):
i40e: Fix VFs not created
.../net/ethernet/intel/i40e/i40e_ethtool.c | 16 +++--
drivers/net/ethernet/intel/i40e/i40e_main.c | 64 +++++++------------
drivers/net/ethernet/intel/i40e/i40e_txrx.c | 11 ++--
drivers/net/ethernet/intel/i40e/i40e_xsk.c | 2 +-
4 files changed, 39 insertions(+), 54 deletions(-)
--
2.26.2
From: Tony Nguyen <anthony.l.nguyen@intel.com> Date: 2021-02-19 21:36:04
From: Slawomir Laba <redacted>
When a packet contains an IPv6 header with next header which is
an extension header and not a protocol one, the kernel function
skb_transport_header called with such sk_buff will return a
pointer to the extension header and not to the TCP one.
The above explained call caused a problem with packet processing
for skb with encapsulation for tunnel with I40E_TX_CTX_EXT_IP_IPV6.
The extension header was not skipped at all.
The ipv6_skip_exthdr function does check if next header of the IPV6
header is an extension header and doesn't modify the l4_proto pointer
if it points to a protocol header value so its safe to omit the
comparison of exthdr and l4.hdr pointers. The ipv6_skip_exthdr can
return value -1. This means that the skipping process failed
and there is something wrong with the packet so it will be dropped.
Fixes: a3fd9d8876a5 ("i40e/i40evf: Handle IPv6 extension headers in checksum offload")
Signed-off-by: Slawomir Laba <redacted>
Signed-off-by: Przemyslaw Patynowski <redacted>
Reviewed-by: Aleksandr Loktionov <redacted>
Tested-by: Tony Brelinski <redacted>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_txrx.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
From: Tony Nguyen <anthony.l.nguyen@intel.com> Date: 2021-02-19 21:36:04
From: Keita Suzuki <redacted>
Struct i40e_veb is allocated in function i40e_setup_pf_switch, and
stored to an array field veb inside struct i40e_pf. However when
i40e_setup_misc_vector fails, this memory leaks.
Fix this by calling exit and teardown functions.
Signed-off-by: Keita Suzuki <redacted>
Tested-by: Tony Brelinski <redacted>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_main.c | 2 ++
1 file changed, 2 insertions(+)
From: Tony Nguyen <anthony.l.nguyen@intel.com> Date: 2021-02-19 21:36:04
From: Mateusz Palczewski <redacted>
Fix insufficient distinction between IPv4 and IPv6 addresses
when creating a filter.
IPv4 and IPv6 are kept in the same memory area. If IPv6 is added,
then it's caught by IPv4 check, which leads to err -95.
Fixes: 2f4b411a3d67 ("i40e: Enable cloud filters via tc-flower")
Signed-off-by: Grzegorz Szczurek <redacted>
Signed-off-by: Mateusz Palczewski <redacted>
Reviewed-by: Jaroslaw Gawin <redacted>
Tested-by: Tony Brelinski <redacted>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_main.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
@@ -7731,7 +7731,8 @@ int i40e_add_del_cloud_filter_big_buf(struct i40e_vsi *vsi,return-EOPNOTSUPP;/* adding filter using src_port/src_ip is not supported at this stage */-if(filter->src_port||filter->src_ipv4||+if(filter->src_port||+(filter->src_ipv4&&filter->n_proto!=ETH_P_IPV6)||!ipv6_addr_any(&filter->ip.v6.src_ip6))return-EOPNOTSUPP;
@@ -7760,7 +7761,7 @@ int i40e_add_del_cloud_filter_big_buf(struct i40e_vsi *vsi,cpu_to_le16(I40E_AQC_ADD_CLOUD_FILTER_MAC_VLAN_PORT);}-}elseif(filter->dst_ipv4||+}elseif((filter->dst_ipv4&&filter->n_proto!=ETH_P_IPV6)||!ipv6_addr_any(&filter->ip.v6.dst_ip6)){cld_filter.element.flags=cpu_to_le16(I40E_AQC_ADD_CLOUD_FILTER_IP_PORT);
@@ -7667,6 +7667,8 @@ int i40e_add_del_cloud_filter(struct i40e_vsi *vsi,if(filter->flags>=ARRAY_SIZE(flag_table))returnI40E_ERR_CONFIG;+memset(&cld_filter,0,sizeof(cld_filter));+/* copy element needed to add cloud filter from filter */i40e_set_cld_element(filter,&cld_filter);
@@ -7734,6 +7736,8 @@ int i40e_add_del_cloud_filter_big_buf(struct i40e_vsi *vsi,!ipv6_addr_any(&filter->ip.v6.src_ip6))return-EOPNOTSUPP;+memset(&cld_filter,0,sizeof(cld_filter));+/* copy element needed to add cloud filter from filter */i40e_set_cld_element(filter,&cld_filter.element);
@@ -11709,6 +11713,8 @@ i40e_status i40e_set_partition_bw_setting(struct i40e_pf *pf)structi40e_aqc_configure_partition_bw_databw_data;i40e_statusstatus;+memset(&bw_data,0,sizeof(bw_data));+/* Set the valid bit for this PF */bw_data.pf_valid_bits=cpu_to_le16(BIT(pf->hw.pf_id));bw_data.max_bw[pf->hw.pf_id]=pf->max_bw&I40E_ALT_BW_VALUE_MASK;
@@ -5920,7 +5920,7 @@ static int i40e_add_channel(struct i40e_pf *pf, u16 uplink_seid,ch->enabled_tc=!i40e_is_channel_macvlan(ch)&&enabled_tc;ch->seid=ctxt.seid;ch->vsi_number=ctxt.vsi_number;-ch->stat_counter_idx=cpu_to_le16(ctxt.info.stat_counter_idx);+ch->stat_counter_idx=le16_to_cpu(ctxt.info.stat_counter_idx);/* copy just the sections touched not the entire info*sincenotallsectionsarevalidasreturnedby
From: Tony Nguyen <anthony.l.nguyen@intel.com> Date: 2021-02-19 21:36:46
From: Mateusz Palczewski <redacted>
During driver loading flow control settings were written to FW
using a variable which was always zero, since it was being set
only by ethtool. This behavior has been corrected and driver
no longer overwrites the default FW/NVM settings.
Fixes: 373149fc99a0 ("i40e: Decrease the scope of rtnl lock")
Signed-off-by: Dawid Lukwinski <redacted>
Signed-off-by: Mateusz Palczewski <redacted>
Reviewed-by: Aleksandr Loktionov <redacted>
Tested-by: Tony Brelinski <redacted>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_main.c | 27 ---------------------
1 file changed, 27 deletions(-)
@@ -10131,13 +10130,6 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired)i40e_stat_str(&pf->hw,ret),i40e_aq_str(&pf->hw,pf->hw.aq.asq_last_status));-/* make sure our flow control settings are restored */-ret=i40e_set_fc(&pf->hw,&set_fc_aq_fail,true);-if(ret)-dev_dbg(&pf->pdev->dev,"setting flow control: ret = %s last_status = %s\n",-i40e_stat_str(&pf->hw,ret),-i40e_aq_str(&pf->hw,pf->hw.aq.asq_last_status));-/* Rebuild the VSIs and VEBs that existed before reset.*Theyarestillinourlocalswitchelementarrays,soonly*needtorebuildtheswitchmodelintheHW.
@@ -15054,24 +15045,6 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)}INIT_LIST_HEAD(&pf->vsi[pf->lan_vsi]->ch_list);-/* Make sure flow control is set according to current settings */-err=i40e_set_fc(hw,&set_fc_aq_fail,true);-if(set_fc_aq_fail&I40E_SET_FC_AQ_FAIL_GET)-dev_dbg(&pf->pdev->dev,-"Set fc with err %s aq_err %s on get_phy_cap\n",-i40e_stat_str(hw,err),-i40e_aq_str(hw,hw->aq.asq_last_status));-if(set_fc_aq_fail&I40E_SET_FC_AQ_FAIL_SET)-dev_dbg(&pf->pdev->dev,-"Set fc with err %s aq_err %s on set_phy_config\n",-i40e_stat_str(hw,err),-i40e_aq_str(hw,hw->aq.asq_last_status));-if(set_fc_aq_fail&I40E_SET_FC_AQ_FAIL_UPDATE)-dev_dbg(&pf->pdev->dev,-"Set fc with err %s aq_err %s on get_link_info\n",-i40e_stat_str(hw,err),-i40e_aq_str(hw,hw->aq.asq_last_status));-/* if FDIR VSI was set up, start it now */for(i=0;i<pf->num_alloc_vsi;i++){if(pf->vsi[i]&&pf->vsi[i]->type==I40E_VSI_FDIR){
From: Tony Nguyen <anthony.l.nguyen@intel.com> Date: 2021-02-19 21:36:46
From: Mateusz Palczewski <redacted>
Fix addition of VLAN filter for PF after enabling FW LLDP agent.
Changing LLDP Agent causes FW to re-initialize per NVM settings.
Remove default PF filter and move "Enable/Disable" to currently used
reset flag.
Without this patch PF would try to add MAC VLAN filter with default
switch filter present. This causes AQ error and sets promiscuous mode
on.
Fixes: c65e78f87f81 ("i40e: Further implementation of LLDP")
Signed-off-by: Przemyslaw Patynowski <redacted>
Signed-off-by: Mateusz Palczewski <redacted>
Reviewed-by: Sylwester Dziedziuch <redacted>
Reviewed-by: Aleksandr Loktionov <redacted>
Tested-by: Tony Brelinski <redacted>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 16 +++++++++-------
drivers/net/ethernet/intel/i40e/i40e_main.c | 9 ++++-----
2 files changed, 13 insertions(+), 12 deletions(-)
@@ -4923,9 +4923,11 @@ static int i40e_set_priv_flags(struct net_device *dev, u32 flags)flags_complete:changed_flags=orig_flags^new_flags;-is_reset_needed=!!(changed_flags&(I40E_FLAG_VEB_STATS_ENABLED|-I40E_FLAG_LEGACY_RX|I40E_FLAG_SOURCE_PRUNING_DISABLED|-I40E_FLAG_DISABLE_FW_LLDP));+if(changed_flags&I40E_FLAG_DISABLE_FW_LLDP)+reset_needed=I40E_PF_RESET_AND_REBUILD_FLAG;+if(changed_flags&(I40E_FLAG_VEB_STATS_ENABLED|+I40E_FLAG_LEGACY_RX|I40E_FLAG_SOURCE_PRUNING_DISABLED))+reset_needed=BIT(__I40E_PF_RESET_REQUESTED);/* Before we finalize any flag changes, we need to perform some*checkstoensurethatthechangesaresupportedandsafe.
@@ -5057,7 +5059,7 @@ static int i40e_set_priv_flags(struct net_device *dev, u32 flags)caseI40E_AQ_RC_EEXIST:dev_warn(&pf->pdev->dev,"FW LLDP agent is already running\n");-is_reset_needed=false;+reset_needed=0;break;caseI40E_AQ_RC_EPERM:dev_warn(&pf->pdev->dev,
@@ -5086,8 +5088,8 @@ static int i40e_set_priv_flags(struct net_device *dev, u32 flags)/* Issue reset to cause things to take effect, as additional bits*areaddedwewillneedtocreateamaskofbitsrequiringreset*/-if(is_reset_needed)-i40e_do_reset(pf,BIT(__I40E_PF_RESET_REQUESTED),true);+if(reset_needed)+i40e_do_reset(pf,reset_needed,true);return0;}
From: Tony Nguyen <anthony.l.nguyen@intel.com> Date: 2021-02-19 21:36:46
From: Sylwester Dziedziuch <redacted>
When creating VFs they were sometimes not getting resources.
It was caused by not executing i40e_reset_all_vfs due to
flag __I40E_VF_DISABLE being set on PF. Because of this
IAVF was never able to finish setup sequence never
getting reset indication from PF.
Changed test_and_set_bit __I40E_VF_DISABLE in
i40e_sync_filters_subtask to test_bit and removed clear_bit.
This function should not set this bit it should only check
if it hasn't been already set.
Fixes: a7542b876075 ("i40e: check __I40E_VF_DISABLE bit in i40e_sync_filters_subtask")
Signed-off-by: Sylwester Dziedziuch <redacted>
Tested-by: Konrad Jankowski <redacted>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_main.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
Hello:
This series was applied to netdev/net.git (refs/heads/master):
On Fri, 19 Feb 2021 13:35:58 -0800 you wrote:
This series contains updates to i40e driver only.
Slawomir resolves an issue with the IPv6 extension headers being
processed incorrectly.
Keita Suzuki fixes a memory leak on probe failure.
[...]