i40e/i40evf updates
Subsystems (2)
v3 cover i40e/i40evf updates
Anjali Singhai Jain has enabled Geneve offload for FW API version 1.4 and
above for XL710/X710 devices
Avinash Dayanand has provided a fix for supported link modes in
10GBaseT PHY's.
Catherine Sullivan has provided a fix for get_rss_aq issue and added new
device ID for X722.
Mitch Williams has removed an unused variable, fixed VLAN features, made
VF resets more reliable, added longer wait after removing the module and lowered some message levels
Shannon Nelson has added code to disable link polling and added support
to request phy media event at reset time.
drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 16 +++++++++ drivers/net/ethernet/intel/i40e/i40e_main.c | 41 ++++++++++++++++++---- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 1 - drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 37 +++++++++---------- drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 1 - drivers/net/ethernet/intel/i40evf/i40evf_main.c | 37 ++++++++++++++++--- 6 files changed, 101 insertions(+), 32 deletions(-)
Signature · 1 line
2.4.3
PATCH v3 1/12 i40e: Enable Geneve offload for FW API ver > 1.4 for XL710/X710 devices
From: Anjali Singhai Jain <[email protected]>
This patch enables the Capability for XL710/X710 devices with FW API version higher than 1.4 to do geneve Rx offload.
Testing Hints: Test it on XL710 device with FW API version 1.5 and lower.
--- drivers/net/ethernet/intel/i40e/i40e_main.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_main.c +6 -0
@@ -9093,6 +9093,12 @@ static int i40e_config_netdev(struct i40e_vsi *vsi) I40E_VLAN_ANY, false, true);spin_unlock_bh (&vsi->mac_filter_list_lock); } + }else if ((pf->hw.aq.api_maj_ver >1 ) || + ((pf->hw.aq.api_maj_ver ==1 ) && + (pf->hw.aq.api_min_ver >4 ))) { +/* Supported in FW API version higher than 1.4 */ + pf->flags |=I40E_FLAG_GENEVE_OFFLOAD_CAPABLE ; + pf->auto_disable_flags =I40E_FLAG_HW_ATR_EVICT_CAPABLE ; }else {/* relate the VSI_VMDQ name to the VSI_MAIN name */ snprintf(netdev->name, IFNAMSIZ, "%sv%%d",
Signature · 1 line
2.4.3
PATCH v3 2/12 i40e: Remove unused variable
In reply to Avinash DayanandFrom: Mitch Williams <[email protected]>
This variable is vestigial, a remnant of the primordial code from which this driver spawned. We can safely remove it.
Testing Hints: VFs initialize and pass traffic.
--- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +6 -7
@@ -1182,8 +1182,8 @@ static int i40e_vc_get_vf_resources_msg(struct i40e_vf *vf, u8 *msg)struct i40e_pf *pf = vf->pf;i40e_status aq_ret =0 ;struct i40e_vsi *vsi; -int i =0 , len =0 ;int num_vsis =1 ; +int len =0 ;int ret;if (!test_bit (I40E_VF_STAT_INIT , &vf->vf_states)) {
@@ -1238,15 +1238,14 @@ static int i40e_vc_get_vf_resources_msg(struct i40e_vf *vf, u8 *msg) vfres->num_queue_pairs = vf->num_queue_pairs; vfres->max_vectors = pf->hw.func_caps.num_msix_vectors_vf;if (vf->lan_vsi_idx) { - vfres->vsi_res[i].vsi_id = vf->lan_vsi_id; - vfres->vsi_res[i].vsi_type =I40E_VSI_SRIOV ; - vfres->vsi_res[i].num_queue_pairs = vsi->alloc_queue_pairs; + vfres->vsi_res[0 ].vsi_id = vf->lan_vsi_id; + vfres->vsi_res[0 ].vsi_type =I40E_VSI_SRIOV ; + vfres->vsi_res[0 ].num_queue_pairs = vsi->alloc_queue_pairs;/* VFs only use TC 0 */ - vfres->vsi_res[i].qset_handle + vfres->vsi_res[0 ].qset_handle =le16_to_cpu (vsi->info.qs_handle[0 ]); -ether_addr_copy (vfres->vsi_res[i].default_mac_addr, +ether_addr_copy (vfres->vsi_res[0 ].default_mac_addr, vf->default_lan_addr.addr); - i++; }set_bit (I40E_VF_STAT_ACTIVE , &vf->vf_states);
Signature · 1 line
2.4.3
PATCH v3 3/12 i40evf: Fix VLAN features
In reply to Avinash DayanandFrom: Mitch Williams <[email protected]>
Users of ethtool were being given the mistaken impression that this driver was able to change its VLAN tagging features, and were disappointed that this was not actually the case. Implement ndo_fix_features method so that we can adjust these flags as needed to avoid false impressions.
Testing Hints: Use 'ethtool -K rxvlan off' to attempt to change the VLAN tagging.
--- drivers/net/ethernet/intel/i40evf/i40evf_main.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)
drivers/net/ethernet/intel/i40evf/i40evf_main.c +23 -0
@@ -2252,6 +2252,28 @@ static int i40evf_change_mtu(struct net_device *netdev, int new_mtu)return 0 ; } +#define I40EVF_VLAN_FEATURES (NETIF_F_HW_VLAN_CTAG_TX |\ + NETIF_F_HW_VLAN_CTAG_RX |\ + NETIF_F_HW_VLAN_CTAG_FILTER) + +/** +* i40evf_fix_features - fix up the netdev feature bits +* @netdev: our net device +* @features: desired feature bits +* +* Returns fixed-up features bits +**/ +static netdev_features_t i40evf_fix_features (struct net_device *netdev, +netdev_features_t features) +{ +struct i40evf_adapter *adapter =netdev_priv (netdev); + + features &= ~I40EVF_VLAN_FEATURES ; +if (adapter->vf_res->vf_offload_flags &I40E_VIRTCHNL_VF_OFFLOAD_VLAN ) + features |=I40EVF_VLAN_FEATURES ; +return features; +} +static const struct net_device_ops i40evf_netdev_ops = { .ndo_open = i40evf_open, .ndo_stop = i40evf_close,
@@ -2264,6 +2286,7 @@ static const struct net_device_ops i40evf_netdev_ops = { .ndo_tx_timeout = i40evf_tx_timeout, .ndo_vlan_rx_add_vid = i40evf_vlan_rx_add_vid, .ndo_vlan_rx_kill_vid = i40evf_vlan_rx_kill_vid, + .ndo_fix_features = i40evf_fix_features,#ifdef CONFIG_NET_POLL_CONTROLLER .ndo_poll_controller = i40evf_netpoll,#endif
Signature · 1 line
2.4.3
PATCH v3 4/12 i40e: Add new device ID for X722
In reply to Avinash DayanandFrom: Catherine Sullivan 1452637417 -0500 <[email protected]>
The new device ID is 0x37D3 and it should follow the same flows and branding string as for 0x37D0.
Testing Hints: Make sure the device loads.
--- drivers/net/ethernet/intel/i40e/i40e_common.c | 1 + drivers/net/ethernet/intel/i40e/i40e_devids.h | 1 + drivers/net/ethernet/intel/i40e/i40e_main.c | 1 + drivers/net/ethernet/intel/i40evf/i40e_common.c | 1 + drivers/net/ethernet/intel/i40evf/i40e_devids.h | 1 + 5 files changed, 5 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_common.c +1 -0
@@ -60,6 +60,7 @@ static i40e_status i40e_set_mac_type(struct i40e_hw *hw)case I40E_DEV_ID_SFP_X722 :case I40E_DEV_ID_1G_BASE_T_X722 :case I40E_DEV_ID_10G_BASE_T_X722 : +case I40E_DEV_ID_SFP_I_X722 : hw->mac.type =I40E_MAC_X722 ;break ;default :
drivers/net/ethernet/intel/i40e/i40e_devids.h +1 -0
@@ -44,6 +44,7 @@#define I40E_DEV_ID_SFP_X722 0x37D0#define I40E_DEV_ID_1G_BASE_T_X722 0x37D1#define I40E_DEV_ID_10G_BASE_T_X722 0x37D2 +#define I40E_DEV_ID_SFP_I_X722 0x37D3#define i40e_is_40G_device (d) ((d) == I40E_DEV_ID_QSFP_A || \ (d) == I40E_DEV_ID_QSFP_B || \
drivers/net/ethernet/intel/i40e/i40e_main.c +1 -0
@@ -90,6 +90,7 @@ static const struct pci_device_id i40e_pci_tbl[] = { {PCI_VDEVICE(INTEL, I40E_DEV_ID_SFP_X722), 0}, {PCI_VDEVICE(INTEL, I40E_DEV_ID_1G_BASE_T_X722), 0}, {PCI_VDEVICE(INTEL, I40E_DEV_ID_10G_BASE_T_X722), 0}, + {PCI_VDEVICE(INTEL, I40E_DEV_ID_SFP_I_X722), 0}, {PCI_VDEVICE(INTEL, I40E_DEV_ID_20G_KR2), 0}, {PCI_VDEVICE(INTEL, I40E_DEV_ID_20G_KR2_A), 0}, /* required last entry */
drivers/net/ethernet/intel/i40evf/i40e_common.c +1 -0
@@ -58,6 +58,7 @@ i40e_status i40e_set_mac_type(struct i40e_hw *hw)case I40E_DEV_ID_SFP_X722 :case I40E_DEV_ID_1G_BASE_T_X722 :case I40E_DEV_ID_10G_BASE_T_X722 : +case I40E_DEV_ID_SFP_I_X722 : hw->mac.type =I40E_MAC_X722 ;break ;case I40E_DEV_ID_X722_VF :
drivers/net/ethernet/intel/i40evf/i40e_devids.h +1 -0
@@ -44,6 +44,7 @@#define I40E_DEV_ID_SFP_X722 0x37D0#define I40E_DEV_ID_1G_BASE_T_X722 0x37D1#define I40E_DEV_ID_10G_BASE_T_X722 0x37D2 +#define I40E_DEV_ID_SFP_I_X722 0x37D3#define I40E_DEV_ID_X722_VF 0x37CD#define I40E_DEV_ID_X722_VF_HV 0x37D9
Signature · 1 line
2.4.3
PATCH v3 5/12 i40e: Make VF resets more reliable
In reply to Avinash DayanandFrom: Mitch Williams <[email protected]>
Clear the VFLR bit immediately after triggering a reset instead of waiting until after cleanup is complete. Make sure to trigger a reset every time, not just if the PF is up.
These changes fix a problem where VF resets would get lost by the PF, preventing the VF driver from initializing.
Testing Hints: Do VF driver load/unload test with
lots of VFs in the system.
--- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +6 -8
@@ -807,6 +807,10 @@ void i40e_reset_vf(struct i40e_vf *vf, bool flr)wr32 (hw,I40E_VPGEN_VFRTRIG (vf->vf_id), reg);i40e_flush (hw); } +/* clear the VFLR bit in GLGEN_VFLRSTAT */ + reg_idx = (hw->func_caps.vf_base_id + vf->vf_id) /32 ; + bit_idx = (hw->func_caps.vf_base_id + vf->vf_id) %32 ; +wr32 (hw,I40E_GLGEN_VFLRSTAT (reg_idx),BIT (bit_idx));if (i40e_quiesce_vf_pci (vf)) dev_err(&pf->pdev->dev, "VF %d PCI transactions stuck\n",
@@ -857,10 +861,6 @@ complete_reset:/* tell the VF the reset is done */ wr32 (hw,I40E_VFGEN_RSTAT1 (vf->vf_id),I40E_VFR_VFACTIVE ); -/* clear the VFLR bit in GLGEN_VFLRSTAT */ - reg_idx = (hw->func_caps.vf_base_id + vf->vf_id) /32 ; - bit_idx = (hw->func_caps.vf_base_id + vf->vf_id) %32 ; -wr32 (hw,I40E_GLGEN_VFLRSTAT (reg_idx),BIT (bit_idx));i40e_flush (hw);clear_bit (__I40E_VF_DISABLE, &pf->state); }
@@ -2059,11 +2059,9 @@ int i40e_vc_process_vflr_event(struct i40e_pf *pf)/* read GLGEN_VFLRSTAT register to find out the flr VFs */ vf = &pf->vf[vf_id]; reg =rd32 (hw,I40E_GLGEN_VFLRSTAT (reg_idx)); -if (reg &BIT (bit_idx)) { +if (reg &BIT (bit_idx))/* i40e_reset_vf will clear the bit in GLGEN_VFLRSTAT */ -if (!test_bit (__I40E_DOWN, &pf->state)) -i40e_reset_vf (vf, true); - } +i40e_reset_vf (vf, true); }return 0 ;
Signature · 1 line
2.4.3
PATCH v3 6/12 i40evf: Add longer wait after remove module
In reply to Avinash DayanandFrom: Mitch Williams <[email protected]>
Upon module remove, wait a little longer after requesting a reset before checking to see if the firmware responded. This change prevents double resets when the firmware is busy.
Testing Hints: Load and unload VF driver repeatedly
with a lot of VFs enabled and make sure it reinitializes properly each time.
--- drivers/net/ethernet/intel/i40evf/i40evf_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/i40evf/i40evf_main.c +2 -2
@@ -2854,11 +2854,11 @@ static void i40evf_remove(struct pci_dev *pdev) adapter->state = __I40EVF_REMOVE; adapter->aq_required =0 ;i40evf_request_reset (adapter); -msleep (20 ); +msleep (50 );/* If the FW isn't responding, kick it once, but only once. */ if (!i40evf_asq_done (hw)) {i40evf_request_reset (adapter); -msleep (20 ); +msleep (50 ); }if (adapter->msix_entries) {
Signature · 1 line
2.4.3
PATCH v3 7/12 i40e: Disable link polling
In reply to Avinash DayanandFrom: Shannon Nelson <[email protected]>
Periodic link polling was added when the link events were found not to be trustworthy. This was the case early on, but was likely because the link event mask was being used incorrectly. As this has been fixed in recent code, we can disable the link polling to lessen the AQ traffic.
Testing Hints:
Do some link tests, removing and reinserting the wire, etc.
--- drivers/net/ethernet/intel/i40e/i40e_main.c | 1 - 1 file changed, 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +0 -1
@@ -8389,7 +8389,6 @@ static int i40e_sw_init(struct i40e_pf *pf)/* Set default capability flags */ pf->flags =I40E_FLAG_RX_CSUM_ENABLED |I40E_FLAG_MSI_ENABLED | -I40E_FLAG_LINK_POLLING_ENABLED |I40E_FLAG_MSIX_ENABLED ;if (iommu_present (&pci_bus_type))
Signature · 1 line
2.4.3
PATCH v3 8/12 i40evf: Fix get_rss_aq
In reply to Avinash DayanandFrom: Catherine Sullivan <[email protected]>
We were passing in the seed where we should just be passing false because we want the vsi table not the pf table.
Testing Hints: Make sure that ethtool -x gives the proper table.
--- drivers/net/ethernet/intel/i40evf/i40evf_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/i40evf/i40evf_main.c +1 -1
@@ -1341,7 +1341,7 @@ static int i40evf_get_rss_aq(struct i40e_vsi *vsi, const u8 *seed, }if (lut) { - ret =i40evf_aq_get_rss_lut (hw, vsi->id, seed, lut, lut_size); + ret =i40evf_aq_get_rss_lut (hw, vsi->id, false, lut, lut_size);if (ret) { dev_err(&adapter->pdev->dev, "Cannot get RSS lut, err %s aq_err %s\n",
Signature · 1 line
2.4.3
PATCH v3 9/12 i40e: Fix for supported link modes in 10GBaseT PHY's
In reply to Avinash Dayanand100baseT/Full is now listed and supported link mode for 10GBaseT PHY's. This is fix for the defect i.e. PHY type changes when link mode is changed.
Testing Hints: Use 'ethtool -s ethx advertise 0x008' to change supported
link mode. Check if 100baseT is displayed.
--- drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +16 -0
@@ -313,6 +313,13 @@ static void i40e_get_settings_link_up(struct i40e_hw *hw, ecmd->advertising |= ADVERTISED_10000baseT_Full;if (hw_link_info->requested_speeds &I40E_LINK_SPEED_1GB ) ecmd->advertising |= ADVERTISED_1000baseT_Full; +/* adding 100baseT support for 10GBASET_PHY */ +if (pf->flags &I40E_FLAG_HAVE_10GBASET_PHY ) { + ecmd->supported |= SUPPORTED_100baseT_Full; + ecmd->advertising |= ADVERTISED_100baseT_Full | + ADVERTISED_1000baseT_Full | + ADVERTISED_10000baseT_Full; + }break ;case I40E_PHY_TYPE_1000BASE_T_OPTICAL : ecmd->supported = SUPPORTED_Autoneg |
@@ -325,6 +332,15 @@ static void i40e_get_settings_link_up(struct i40e_hw *hw, SUPPORTED_100baseT_Full;if (hw_link_info->requested_speeds &I40E_LINK_SPEED_100MB ) ecmd->advertising |= ADVERTISED_100baseT_Full; +/* firmware detects 10G phy as 100M phy at 100M speed */ +if (pf->flags &I40E_FLAG_HAVE_10GBASET_PHY ) { + ecmd->supported |= SUPPORTED_10000baseT_Full | + SUPPORTED_1000baseT_Full; + ecmd->advertising |= ADVERTISED_Autoneg | + ADVERTISED_100baseT_Full | + ADVERTISED_1000baseT_Full | + ADVERTISED_10000baseT_Full; + }break ;case I40E_PHY_TYPE_10GBASE_CR1_CU :case I40E_PHY_TYPE_10GBASE_CR1 :
Signature · 1 line
2.4.3
PATCH v3 10/12 i40e: Lower some message levels
In reply to Avinash DayanandFrom: Mitch Williams <[email protected]>
These conditions can happen any time VFs are enabled or disabled and are not really indicative of fatal problems unless they happen continuously.
Lower the log level so that people don't get scared.
Testing Hints: Enable and disable lots of VFs until you see the messages. Note the log level.
--- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +5 -5
@@ -1103,8 +1103,8 @@ static int i40e_vc_send_msg_to_vf(struct i40e_vf *vf, u32 v_opcode,/* single place to detect unsuccessful return values */ if (v_retval) { vf->num_invalid_msgs++; -dev_err (&pf->pdev->dev,"VF %d failed opcode %d, error: %d\n" , - vf->vf_id, v_opcode, v_retval); +dev_info (&pf->pdev->dev,"VF %d failed opcode %d, retval: %d\n" , + vf->vf_id, v_opcode, v_retval);if (vf->num_invalid_msgs >I40E_DEFAULT_NUM_INVALID_MSGS_ALLOWED ) { dev_err(&pf->pdev->dev,
@@ -1122,9 +1122,9 @@ static int i40e_vc_send_msg_to_vf(struct i40e_vf *vf, u32 v_opcode, aq_ret =i40e_aq_send_msg_to_vf (hw, abs_vf_id, v_opcode, v_retval, msg, msglen,NULL );if (aq_ret) { -dev_err (&pf->pdev->dev, -"Unable to send the message to VF %d aq_err %d\n" , - vf->vf_id, pf->hw.aq.asq_last_status); +dev_info (&pf->pdev->dev, +"Unable to send the message to VF %d aq_err %d\n" , + vf->vf_id, pf->hw.aq.asq_last_status);return -EIO ; }
Signature · 1 line
2.4.3
PATCH v3 11/12 i40e: Request phy media event at reset time
In reply to Avinash DayanandFrom: Shannon Nelson <[email protected]>
As we did at driver startup, be sure to ask for the Media Not Available flag in the link event mask.
Testing Hints:
Do some link tests, removing and reinserting the wire, etc. after a reset.
--- drivers/net/ethernet/intel/i40e/i40e_main.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_main.c +2 -0
@@ -6836,6 +6836,7 @@ static void i40e_reset_and_rebuild(struct i40e_pf *pf, bool reinit)*/ ret =i40e_aq_set_phy_int_mask (&pf->hw, ~(I40E_AQ_EVENT_LINK_UPDOWN | +I40E_AQ_EVENT_MEDIA_NA |I40E_AQ_EVENT_MODULE_QUAL_FAIL ),NULL );if (ret) dev_info(&pf->pdev->dev, "set phy mask fail, err %s aq_err %s\n",
@@ -10992,6 +10993,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)*/ err =i40e_aq_set_phy_int_mask (&pf->hw, ~(I40E_AQ_EVENT_LINK_UPDOWN | +I40E_AQ_EVENT_MEDIA_NA |I40E_AQ_EVENT_MODULE_QUAL_FAIL ),NULL );if (err) dev_info(&pf->pdev->dev, "set phy mask fail, err %s aq_err %s\n",
Signature · 1 line
2.4.3
PATCH v3 12/12 i40e/i40evf: Bump patch from 1.5.1 to 1.5.2
In reply to Avinash Dayanand--- drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +- drivers/net/ethernet/intel/i40evf/i40evf_main.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +1 -1
@@ -46,7 +46,7 @@ static const char i40e_driver_string[] =#define DRV_VERSION_MAJOR 1#define DRV_VERSION_MINOR 5 -#define DRV_VERSION_BUILD 1 +#define DRV_VERSION_BUILD 2#define DRV_VERSION __stringify(DRV_VERSION_MAJOR) "." \ __stringify(DRV_VERSION_MINOR) "." \ __stringify(DRV_VERSION_BUILD) DRV_KERN
drivers/net/ethernet/intel/i40evf/i40evf_main.c +1 -1
@@ -38,7 +38,7 @@ static const char i40evf_driver_string[] =#define DRV_VERSION_MAJOR 1#define DRV_VERSION_MINOR 5 -#define DRV_VERSION_BUILD 1 +#define DRV_VERSION_BUILD 2#define DRV_VERSION __stringify(DRV_VERSION_MAJOR) "." \ __stringify(DRV_VERSION_MINOR) "." \ __stringify(DRV_VERSION_BUILD) \
Signature · 1 line
2.4.3