update i40e base code
cover update i40e base code
update i40e base code.
source code of i40e driver:
cid-i40e.2020.08.27.tar.gz dropped by the team which develop basic drivers for any i40e NIC.
changelog in ND share repo:
From c0bfc1c07bb3 ("i40e-shared: Add VLAN field for input set")
To 1a82d59f0797 ("i40e-shared: Fix PHY configuration parameters when enabling EEE")
The following commits are ignored.5b7d5a698092 ("i40e-shared: use linux packing style") f16fa495c503 ("i40e-shared: Fix compilation issue with __packed")
Guinan Sun (9):
net/i40e/base: add VLAN field for input set net/i40e/base: update FW API version net/i40e/base: enable pipe monitor thresholds net/i40e/base: fix missing function header arguments net/i40e/base: add support for minimum rollback revision net/i40e/base: fix Rx only for unicast promisc on VLAN net/i40e/base: add EEE LPI status check for X722 adapters net/i40e/base: fix PHY config param when enabling EEE net/i40e/base: update version
drivers/net/i40e/base/README | 2 +- drivers/net/i40e/base/i40e_adminq_cmd.h | 24 +++++++- drivers/net/i40e/base/i40e_common.c | 82 +++++++++++++++++++++---- drivers/net/i40e/base/i40e_dcb.c | 3 +- drivers/net/i40e/base/i40e_prototype.h | 4 ++ drivers/net/i40e/base/i40e_register.h | 3 + drivers/net/i40e/base/i40e_type.h | 2 + 7 files changed, 103 insertions(+), 17 deletions(-)
Signature · 1 line
2.17.1
PATCH 1/9 net/i40e/base: add VLAN field for input set
Add VLAN bit used during flow director programming, as a part of input set for HW.
--- drivers/net/i40e/base/i40e_type.h | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/i40e/base/i40e_type.h +2 -0
@@ -1926,6 +1926,8 @@ struct i40e_lldp_variables {#define I40E_L4_DST_MASK (0x1ULL << I40E_L4_DST_SHIFT)#define I40E_VERIFY_TAG_SHIFT 31#define I40E_VERIFY_TAG_MASK (0x3ULL << I40E_VERIFY_TAG_SHIFT) +#define I40E_VLAN_SRC_SHIFT 55 +#define I40E_VLAN_SRC_MASK (0x1ULL << I40E_VLAN_SRC_SHIFT)#define I40E_FLEX_50_SHIFT 13#define I40E_FLEX_50_MASK (0x1ULL << I40E_FLEX_50_SHIFT)
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH 1/9] net/i40e/base: add VLAN field for input set
Quoted 15 lines · Guinan Sun
Add VLAN bit used during flow director programming, as a part of input set for HW.
Signed-off-by Przemyslaw Patynowski <[email protected]>Signed-off-by Guinan Sun <[email protected]>--- drivers/net/i40e/base/i40e_type.h | 2 ++ 1 file changed, 2 insertions(+)drivers/net/i40e/base/i40e_type.h +0
-0
drivers/net/i40e/base/i40e_type.h struct i40e_lldp_variables { · line 1933
Quoted 8 lines
drivers/net/i40e/base/i40e_type.h +2
-0@@ -1926,6 +1926,8 @@ struct i40e_lldp_variables {#define I40E_L4_DST_MASK (0x1ULL << I40E_L4_DST_SHIFT)#define I40E_VERIFY_TAG_SHIFT 31#define I40E_VERIFY_TAG_MASK (0x3ULL << I40E_VERIFY_TAG_SHIFT) +#define I40E_VLAN_SRC_SHIFT 55 +#define I40E_VLAN_SRC_MASK (0x1ULL << I40E_VLAN_SRC_SHIFT)#define I40E_FLEX_50_SHIFT 13#define I40E_FLEX_50_MASK (0x1ULL << I40E_FLEX_50_SHIFT)
Hi Guinan, Qi,
These new defines in the base code seems not used by driver, is there a benefit to add them now?
What do you think to add them when they are used by the driver code?
PATCH 2/9 net/i40e/base: update FW API version
In reply to Guinan SunUpdate FW increment API version.
--- drivers/net/i40e/base/i40e_adminq_cmd.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/i40e/base/i40e_adminq_cmd.h +2 -2
@@ -12,8 +12,8 @@*/ #define I40E_FW_API_VERSION_MAJOR 0x0001 -#define I40E_FW_API_VERSION_MINOR_X722 0x000A -#define I40E_FW_API_VERSION_MINOR_X710 0x000B +#define I40E_FW_API_VERSION_MINOR_X722 0x000B +#define I40E_FW_API_VERSION_MINOR_X710 0x000C#define I40E_FW_MINOR_VERSION (_h) ((_h)->mac.type == I40E_MAC_XL710 ? \ I40E_FW_API_VERSION_MINOR_X710 : \
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH 2/9] net/i40e/base: update FW API version
Quoted 14 lines · Guinan Sun
Update FW increment API version.
Signed-off-by Jacek Naczyk <[email protected]>Signed-off-by Guinan Sun <[email protected]>--- drivers/net/i40e/base/i40e_adminq_cmd.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/net/i40e/base/i40e_adminq_cmd.h +0
-0
drivers/net/i40e/base/i40e_adminq_cmd.h line 19
Quoted 10 lines
drivers/net/i40e/base/i40e_adminq_cmd.h +2
-2@@ -12,8 +12,8 @@*/ #define I40E_FW_API_VERSION_MAJOR 0x0001 -#define I40E_FW_API_VERSION_MINOR_X722 0x000A -#define I40E_FW_API_VERSION_MINOR_X710 0x000B +#define I40E_FW_API_VERSION_MINOR_X722 0x000B +#define I40E_FW_API_VERSION_MINOR_X710 0x000C#define I40E_FW_MINOR_VERSION (_h) ((_h)->mac.type == I40E_MAC_XL710 ? \ I40E_FW_API_VERSION_MINOR_X710 : \
Hi Guinan,
Is it clear/know what changes causing API version increase, if so it would be good to document this in the commit log.
PATCH 3/9 net/i40e/base: enable pipe monitor thresholds
In reply to Guinan SunEnable several registers and defines for software controlled DCB, particularly around the receive pipe monitor configuration which is necessary to help ports achieve the right throughput under load in several different configurations.
--- drivers/net/i40e/base/i40e_register.h | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/i40e/base/i40e_register.h +3 -0
@@ -203,6 +203,9 @@#define I40E_VFCM_PE_ERRINFO1_RLU_ERROR_CNT_MASK I40E_MASK(0xFF, I40E_VFCM_PE_ERRINFO1_RLU_ERROR_CNT_SHIFT)#define I40E_VFCM_PE_ERRINFO1_RLS_ERROR_CNT_SHIFT 24#define I40E_VFCM_PE_ERRINFO1_RLS_ERROR_CNT_MASK I40E_MASK(0xFF, I40E_VFCM_PE_ERRINFO1_RLS_ERROR_CNT_SHIFT) +#define I40E_PRT_SWR_PM_THR 0x0026CD00/* Reset: CORER */ +#define I40E_PRT_SWR_PM_THR_THRESHOLD_SHIFT 0 +#define I40E_PRT_SWR_PM_THR_THRESHOLD_MASK I40E_MASK(0xFF, I40E_PRT_SWR_PM_THR_THRESHOLD_SHIFT)#define I40E_GLDCB_GENC 0x00083044/* Reset: CORER */ #define I40E_GLDCB_GENC_PCIRTT_SHIFT 0#define I40E_GLDCB_GENC_PCIRTT_MASK I40E_MASK(0xFFFF, I40E_GLDCB_GENC_PCIRTT_SHIFT)
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH 3/9] net/i40e/base: enable pipe monitor thresholds
Quoted 17 lines · Guinan Sun
Enable several registers and defines for software controlled DCB, particularly around the receive pipe monitor configuration which is necessary to help ports achieve the right throughput under load in several different configurations.
Signed-off-by Jesse Brandeburg <[email protected]>Signed-off-by Guinan Sun <[email protected]>--- drivers/net/i40e/base/i40e_register.h | 3 +++ 1 file changed, 3 insertions(+)drivers/net/i40e/base/i40e_register.h +0
-0
drivers/net/i40e/base/i40e_register.h line 211
Quoted 9 lines
drivers/net/i40e/base/i40e_register.h +3
-0@@ -203,6 +203,9 @@#define I40E_VFCM_PE_ERRINFO1_RLU_ERROR_CNT_MASK I40E_MASK(0xFF, I40E_VFCM_PE_ERRINFO1_RLU_ERROR_CNT_SHIFT)#define I40E_VFCM_PE_ERRINFO1_RLS_ERROR_CNT_SHIFT 24#define I40E_VFCM_PE_ERRINFO1_RLS_ERROR_CNT_MASK I40E_MASK(0xFF, I40E_VFCM_PE_ERRINFO1_RLS_ERROR_CNT_SHIFT) +#define I40E_PRT_SWR_PM_THR 0x0026CD00/* Reset: CORER */ +#define I40E_PRT_SWR_PM_THR_THRESHOLD_SHIFT 0 +#define I40E_PRT_SWR_PM_THR_THRESHOLD_MASK I40E_MASK(0xFF, I40E_PRT_SWR_PM_THR_THRESHOLD_SHIFT)#define I40E_GLDCB_GENC 0x00083044/* Reset: CORER */ #define I40E_GLDCB_GENC_PCIRTT_SHIFT 0#define I40E_GLDCB_GENC_PCIRTT_MASK I40E_MASK(0xFFFF, I40E_GLDCB_GENC_PCIRTT_SHIFT)
Same comment here, can this base code update be postponed to when these macros actually used?
PATCH 4/9 net/i40e/base: fix missing function header arguments
In reply to Guinan SunFix them by adding the argument descriptions.
--- drivers/net/i40e/base/i40e_dcb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/i40e/base/i40e_dcb.c +2 -1
@@ -1267,7 +1267,8 @@ enum i40e_status_code i40e_set_dcb_config(struct i40e_hw *hw)/** * i40e_dcb_config_to_lldp - Convert Dcbconfig to MIB format -* @hw: pointer to the hw struct +* @lldpmib: pointer to mib to be output +* @miblen: pointer to u16 for length of lldpmib * @dcbcfg: store for LLDPDU data * * send DCB configuration to FW
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH 4/9] net/i40e/base: fix missing function header arguments
Quoted 29 lines
-----Original Message-----
From: Sun, GuinanX <[email protected]>
Sent: Saturday, September 5, 2020 10:50
To: [email protected]
Cc: Xing, Beilei <[email protected]>; Zhang, Qi Z <[email protected]>; Yang, Qiming <[email protected]>; Sun, GuinanX <[email protected]>; [email protected]; Brandeburg, Jesse <[email protected]>
Subject: [PATCH 4/9]net/i40e/base: fix missing function header argumentsFix them by adding the argument descriptions.
Fixes 0d9d27bb8684 ("i40e/base: prepare local LLDP MIB in TLV")Signed-off-by Jesse Brandeburg <[email protected]>Signed-off-by Guinan Sun <[email protected]>--- drivers/net/i40e/base/i40e_dcb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/net/i40e/base/i40e_dcb.c +0
-0
drivers/net/i40e/base/i40e_dcb.c enum i40e_status_code · line 1272
Quoted 7 lines
drivers/net/i40e/base/i40e_dcb.c +2
-1@@ -1267,7 +1267,8 @@ enum i40e_status_code i40e_set_dcb_config(struct i40e_hw *hw)/** * i40e_dcb_config_to_lldp - Convert Dcbconfig to MIB format -* @hw: pointer to the hw struct +* @lldpmib: pointer to mib to be output +* @miblen: pointer to u16 for length of lldpmib
Only parameter description change? No function change?
Quoted 5 lines
drivers/net/i40e/base/i40e_dcb.c +0
-0* @dcbcfg: store for LLDPDU data * * send DCB configuration to FW
--
2.17.1
PATCH 5/9 net/i40e/base: add support for minimum rollback revision
In reply to Guinan SunAdd support for minimum rollback revision.
--- drivers/net/i40e/base/i40e_adminq_cmd.h | 18 +++++++++++++++ drivers/net/i40e/base/i40e_common.c | 29 +++++++++++++++++++++++++ drivers/net/i40e/base/i40e_prototype.h | 4 ++++ 3 files changed, 51 insertions(+)
drivers/net/i40e/base/i40e_adminq_cmd.h +18 -0
@@ -241,6 +241,7 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_nvm_config_read =0x0704 , i40e_aqc_opc_nvm_config_write =0x0705 , i40e_aqc_opc_nvm_update_in_process =0x0706 , + i40e_aqc_opc_rollback_revision_update =0x0707 , i40e_aqc_opc_oem_post_update =0x0720 , i40e_aqc_opc_thermal_sensor = 0x0721,
@@ -2419,6 +2420,23 @@ struct i40e_aqc_nvm_config_data_immediate_field {I40E_CHECK_STRUCT_LEN (0xc , i40e_aqc_nvm_config_data_immediate_field); +/* Minimal Rollback Revision Update (direct 0x0707) */ +struct i40e_aqc_rollback_revision_update { +u8 optin_mode;/* bool */ +#define I40E_AQ_RREV_OPTIN_MODE 0x01 +u8 module_selected; +#define I40E_AQ_RREV_MODULE_PCIE_ANALOG 0 +#define I40E_AQ_RREV_MODULE_PHY_ANALOG 1 +#define I40E_AQ_RREV_MODULE_OPTION_ROM 2 +#define I40E_AQ_RREV_MODULE_EMP_IMAGE 3 +#define I40E_AQ_RREV_MODULE_PE_IMAGE 4 +u8 reserved1[2 ]; +u32 min_rrev; +u8 reserved2[8 ]; +}; + +I40E_CHECK_CMD_LENGTH (i40e_aqc_rollback_revision_update); +/* OEM Post Update (indirect 0x0720) * no command data struct used */
drivers/net/i40e/base/i40e_common.c +29 -0
@@ -3717,6 +3717,35 @@ i40e_aq_nvm_update_in_process(struct i40e_hw *hw,return status; } +/** +* i40e_aq_min_rollback_rev_update - triggers an ow after update +* @hw: pointer to the hw struct +* @mode: opt-in mode, 1b for single module update, 0b for bulk update +* @module: module to be updated. Ignored if mode is 0b +* @min_rrev: value of the new minimal version. Ignored if mode is 0b +* @cmd_details: pointer to command details structure or NULL +**/ +enum i40e_status_code +i40e_aq_min_rollback_rev_update (struct i40e_hw *hw,u8 mode,u8 module, +u32 min_rrev, +struct i40e_asq_cmd_details *cmd_details) +{ +struct i40e_aq_desc desc; +struct i40e_aqc_rollback_revision_update *cmd = + (struct i40e_aqc_rollback_revision_update *)&desc.params.raw; +enum i40e_status_code status; + +i40e_fill_default_direct_cmd_desc (&desc, + i40e_aqc_opc_rollback_revision_update); + cmd->optin_mode = mode; + cmd->module_selected = module; + cmd->min_rrev = min_rrev; + + status =i40e_asq_send_command (hw, &desc,NULL ,0 , cmd_details); + +return status; +} +/** * i40e_aq_oem_post_update - triggers an OEM specific flow after update * @hw: pointer to the hw struct
drivers/net/i40e/base/i40e_prototype.h +4 -0
@@ -240,6 +240,10 @@ enum i40e_status_code i40e_aq_write_nvm_config(struct i40e_hw *hw, u8 cmd_flags, void *data, u16 buf_size, u16 element_count, struct i40e_asq_cmd_details *cmd_details); +enum i40e_status_code +i40e_aq_min_rollback_rev_update (struct i40e_hw *hw,u8 mode,u8 module, +u32 min_rrev, +struct i40e_asq_cmd_details *cmd_details);enum i40e_status_code i40e_aq_oem_post_update (struct i40e_hw *hw,void *buff,u16 buff_size,struct i40e_asq_cmd_details *cmd_details);
Signature · 1 line
2.17.1
PATCH 6/9 net/i40e/base: fix Rx only for unicast promisc on VLAN
In reply to Guinan SunSet promiscuous mode to rx traffic only if VSI has VLANs configured. Rename misleading PROMISC_TX bit to proper name.
Added I40E_AQC_SET_VSI_PROMISC_RX_ONLY during VSI unicast promiscuous mode configuration with port VLAN.
Aligned unicast promiscuous with VLAN to the one without VLAN. Previously other VFs could listen to unicast tx traffic of other VFs.
--- drivers/net/i40e/base/i40e_adminq_cmd.h | 2 +- drivers/net/i40e/base/i40e_common.c | 36 +++++++++++++++++++------ 2 files changed, 29 insertions(+), 9 deletions(-)
drivers/net/i40e/base/i40e_adminq_cmd.h +1 -1
@@ -1222,7 +1222,7 @@ struct i40e_aqc_set_vsi_promiscuous_modes {#define I40E_AQC_SET_VSI_PROMISC_BROADCAST 0x04#define I40E_AQC_SET_VSI_DEFAULT 0x08#define I40E_AQC_SET_VSI_PROMISC_VLAN 0x10 -#define I40E_AQC_SET_VSI_PROMISC_TX 0x8000 +#define I40E_AQC_SET_VSI_PROMISC_RX_ONLY 0x8000__le16 seid;#define I40E_AQC_VSI_PROM_CMD_SEID_MASK 0x3FF__le16 vlan_tag;
drivers/net/i40e/base/i40e_common.c +28 -8
@@ -2270,6 +2270,22 @@ enum i40e_status_code i40e_aq_set_phy_debug(struct i40e_hw *hw, u8 cmd_flags,return status; } +/** +* i40e_hw_ver_ge +* @hw: pointer to the hw struct +* @maj: api major value +* @min: api minor value +* +* Assert whether current HW api version is greater/equal than provided. +**/ +static bool i40e_hw_ver_ge (struct i40e_hw *hw,u16 maj,u16 min) +{ +if (hw->aq.api_maj_ver > maj || + (hw->aq.api_maj_ver == maj && hw->aq.api_min_ver >= min)) +return true; +return false; +} +/** * i40e_aq_add_vsi * @hw: pointer to the hw struct
@@ -2395,18 +2411,16 @@ enum i40e_status_code i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw,if (set) { flags |=I40E_AQC_SET_VSI_PROMISC_UNICAST ; -if (rx_only_promisc && - (((hw->aq.api_maj_ver ==1 ) && (hw->aq.api_min_ver >=5 )) || - (hw->aq.api_maj_ver >1 ))) - flags |=I40E_AQC_SET_VSI_PROMISC_TX ; +if (rx_only_promisc &&i40e_hw_ver_ge (hw,1 ,5 )) + flags |=I40E_AQC_SET_VSI_PROMISC_RX_ONLY ; } cmd->promiscuous_flags =CPU_TO_LE16 (flags); cmd->valid_flags =CPU_TO_LE16 (I40E_AQC_SET_VSI_PROMISC_UNICAST ); -if (((hw->aq.api_maj_ver >=1 ) && (hw->aq.api_min_ver >=5 )) || - (hw->aq.api_maj_ver >1 )) - cmd->valid_flags |=CPU_TO_LE16 (I40E_AQC_SET_VSI_PROMISC_TX ); +if (i40e_hw_ver_ge (hw,1 ,5 )) + cmd->valid_flags |= +CPU_TO_LE16 (I40E_AQC_SET_VSI_PROMISC_RX_ONLY ); cmd->seid =CPU_TO_LE16 (seid); status =i40e_asq_send_command (hw, &desc,NULL ,0 , cmd_details);
@@ -2538,11 +2552,17 @@ enum i40e_status_code i40e_aq_set_vsi_uc_promisc_on_vlan(struct i40e_hw *hw,i40e_fill_default_direct_cmd_desc (&desc, i40e_aqc_opc_set_vsi_promiscuous_modes); -if (enable) +if (enable) { flags |=I40E_AQC_SET_VSI_PROMISC_UNICAST ; +if (i40e_hw_ver_ge (hw,1 ,5 )) + flags |=I40E_AQC_SET_VSI_PROMISC_RX_ONLY ; + } cmd->promiscuous_flags =CPU_TO_LE16 (flags); cmd->valid_flags =CPU_TO_LE16 (I40E_AQC_SET_VSI_PROMISC_UNICAST ); +if (i40e_hw_ver_ge (hw,1 ,5 )) + cmd->valid_flags |= +CPU_TO_LE16 (I40E_AQC_SET_VSI_PROMISC_RX_ONLY ); cmd->seid =CPU_TO_LE16 (seid); cmd->vlan_tag =CPU_TO_LE16 (vid |I40E_AQC_SET_VSI_VLAN_VALID );
Signature · 1 line
2.17.1
PATCH 7/9 net/i40e/base: add EEE LPI status check for X722 adapters
In reply to Guinan SunAdd reading LPI (low power idle) status for supported X722 devices. If adapter's PHY supports EEE in current mode (device ID + link speed), LPI status is read from PHY Clause 45 PCS status register.
--- drivers/net/i40e/base/i40e_common.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
drivers/net/i40e/base/i40e_common.c +12 -4
@@ -7098,15 +7098,23 @@ enum i40e_status_code i40e_get_phy_lpi_status(struct i40e_hw *hw, struct i40e_hw_port_stats *stat) {enum i40e_status_code ret =I40E_SUCCESS ; +bool eee_mrvl_phy; +bool eee_bcm_phy;u32 val; stat->rx_lpi_status =0 ; stat->tx_lpi_status =0 ; -if ((hw->device_id ==I40E_DEV_ID_10G_BASE_T_BC || - hw->device_id ==I40E_DEV_ID_5G_BASE_T_BC ) && - (hw->phy.link_info.link_speed ==I40E_LINK_SPEED_2_5GB || - hw->phy.link_info.link_speed ==I40E_LINK_SPEED_5GB )) { + eee_bcm_phy = + (hw->device_id ==I40E_DEV_ID_10G_BASE_T_BC || + hw->device_id ==I40E_DEV_ID_5G_BASE_T_BC ) && + (hw->phy.link_info.link_speed ==I40E_LINK_SPEED_2_5GB || + hw->phy.link_info.link_speed ==I40E_LINK_SPEED_5GB ); + eee_mrvl_phy = + hw->device_id ==I40E_DEV_ID_1G_BASE_T_X722 ; + +if (eee_bcm_phy || eee_mrvl_phy) { +// read Clause 45 PCS Status 1 register ret = i40e_aq_get_phy_register(hw, I40E_AQ_PHY_REG_ACCESS_EXTERNAL, I40E_BCM_PHY_PCS_STATUS1_PAGE,
Signature · 1 line
2.17.1
PATCH 8/9 net/i40e/base: fix PHY config param when enabling EEE
In reply to Guinan SunThe i40e_enable_eee function did not copy phy_type_ext field from current PHY configuration retrieved with Get PHY Abilities AQ. It caused a misconfiguration of the PHY on devices supporting 2.5 and 5G speeds and prevented establishing link when only those speeds were selected for advertisement.
--- drivers/net/i40e/base/i40e_common.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/i40e/base/i40e_common.c +1 -0
@@ -6449,6 +6449,7 @@ enum i40e_status_code i40e_enable_eee(struct i40e_hw *hw, bool enable)/* Cache current configuration */ config.phy_type = abilities.phy_type; + config.phy_type_ext = abilities.phy_type_ext; config.link_speed = abilities.link_speed; config.abilities = abilities.abilities |I40E_AQ_PHY_ENABLE_ATOMIC_LINK ;
Signature · 1 line
2.17.1
PATCH 9/9 net/i40e/base: update version
In reply to Guinan SunUpdate base code version in readme.
--- drivers/net/i40e/base/README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/i40e/base/README +1 -1
@@ -6,7 +6,7 @@ Intel® I40E driver ================== This directory contains source code of FreeBSD i40e driver of version -cid-i40e.2020.07.16.tar.gz released by the team which develops +cid-i40e.2020.08.27.tar.gz released by the team which develops basic drivers for any i40e NIC. The directory of base/ contains the original source package. This driver is valid for the product(s) listed below
Signature · 1 line
2.17.1
Quoted 46 lines
-----Original Message-----
From: Sun, GuinanX <[email protected]>
Sent: Saturday, September 5, 2020 10:49 AM
To: [email protected]
Cc: Xing, Beilei <[email protected]>; Zhang, Qi Z <[email protected]>; Yang, Qiming <[email protected]>; Sun, GuinanX <[email protected]>
Subject: [PATCH 0/9] update i40e base codeupdate i40e base code.
source code of i40e driver:
cid-i40e.2020.08.27.tar.gz dropped by the team which develop basic drivers for any i40e NIC.changelog in ND share repo:
Fromc0bfc1c07bb3("i40e-shared: Add VLAN field for input set") To1a82d59f0797("i40e-shared: Fix PHY configuration parameters when enabling EEE")The following commits are ignored.
5b7d5a698092("i40e-shared: use linux packing style")f16fa495c503("i40e-shared: Fix compilation issue with__packed")Guinan Sun (9):
net/i40e/base: add VLAN field for input setnet/i40e/base: update FW API versionnet/i40e/base: enable pipe monitor thresholdsnet/i40e/base: fix missing function header argumentsnet/i40e/base: add support for minimum rollback revisionnet/i40e/base: fix Rx only for unicast promisc on VLANnet/i40e/base: add EEE LPI status check for X722 adaptersnet/i40e/base: fix PHY config param when enabling EEEnet/i40e/base: update versiondrivers/net/i40e/base/README | 2 +- drivers/net/i40e/base/i40e_adminq_cmd.h | 24 +++++++- drivers/net/i40e/base/i40e_common.c | 82 +++++++++++++++++++++---- drivers/net/i40e/base/i40e_dcb.c | 3 +- drivers/net/i40e/base/i40e_prototype.h | 4 ++ drivers/net/i40e/base/i40e_register.h | 3 + drivers/net/i40e/base/i40e_type.h | 2 + 7 files changed, 103 insertions(+), 17 deletions(-)
Quoted 2 lines
--
2.17.1
Applied to dpdk-next-net-intel.
Thanks
Qi
v2 cover update i40e base code
In reply to Guinan Sunupdate i40e base code.
source code of i40e driver:
cid-i40e.2020.08.27.tar.gz dropped by the team which develop basic drivers for any i40e NIC.
changelog in ND share repo:
From c0bfc1c07bb3 ("i40e-shared: Add VLAN field for input set")
To 1a82d59f0797 ("i40e-shared: Fix PHY configuration parameters when enabling EEE")
The following commits are ignored.5b7d5a698092 ("i40e-shared: use linux packing style") f16fa495c503 ("i40e-shared: Fix compilation issue with __packed") c0bfc1c07bb3 ("i40e-shared: Add VLAN field for input set") dcc3e90e9acd ("i40e-shared: enable pipe monitor thresholds")
---
v2:
* Remove two useless patches for dpdk.
* Modify commit message.
Guinan Sun (7):
net/i40e/base: update FW API version net/i40e/base: fix missing function header arguments net/i40e/base: add support for minimum rollback revision net/i40e/base: fix Rx only for unicast promisc on VLAN net/i40e/base: add EEE LPI status check for X722 adapters net/i40e/base: fix PHY config param when enabling EEE net/i40e/base: update version
drivers/net/i40e/base/README | 2 +- drivers/net/i40e/base/i40e_adminq_cmd.h | 24 +++++++- drivers/net/i40e/base/i40e_common.c | 82 +++++++++++++++++++++---- drivers/net/i40e/base/i40e_dcb.c | 3 +- drivers/net/i40e/base/i40e_prototype.h | 4 ++ 5 files changed, 98 insertions(+), 17 deletions(-)
Signature · 1 line
2.17.1
PATCH v2 1/7 net/i40e/base: update FW API version
Update FW increment API version for:
-NVM FW Lockdown Feature for legacy devices
-Security Version Opt-In
--- drivers/net/i40e/base/i40e_adminq_cmd.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/i40e/base/i40e_adminq_cmd.h +2 -2
@@ -12,8 +12,8 @@*/ #define I40E_FW_API_VERSION_MAJOR 0x0001 -#define I40E_FW_API_VERSION_MINOR_X722 0x000A -#define I40E_FW_API_VERSION_MINOR_X710 0x000B +#define I40E_FW_API_VERSION_MINOR_X722 0x000B +#define I40E_FW_API_VERSION_MINOR_X710 0x000C#define I40E_FW_MINOR_VERSION (_h) ((_h)->mac.type == I40E_MAC_XL710 ? \ I40E_FW_API_VERSION_MINOR_X710 : \
Signature · 1 line
2.17.1
PATCH v2 2/7 net/i40e/base: fix missing function header arguments
In reply to Guinan SunFix them by adding the argument descriptions.
--- drivers/net/i40e/base/i40e_dcb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/i40e/base/i40e_dcb.c +2 -1
@@ -1267,7 +1267,8 @@ enum i40e_status_code i40e_set_dcb_config(struct i40e_hw *hw)/** * i40e_dcb_config_to_lldp - Convert Dcbconfig to MIB format -* @hw: pointer to the hw struct +* @lldpmib: pointer to mib to be output +* @miblen: pointer to u16 for length of lldpmib * @dcbcfg: store for LLDPDU data * * send DCB configuration to FW
Signature · 1 line
2.17.1
PATCH v2 3/7 net/i40e/base: add support for minimum rollback revision
In reply to Guinan SunAdd support for minimum rollback revision.
--- drivers/net/i40e/base/i40e_adminq_cmd.h | 18 +++++++++++++++ drivers/net/i40e/base/i40e_common.c | 29 +++++++++++++++++++++++++ drivers/net/i40e/base/i40e_prototype.h | 4 ++++ 3 files changed, 51 insertions(+)
drivers/net/i40e/base/i40e_adminq_cmd.h +18 -0
@@ -241,6 +241,7 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_nvm_config_read =0x0704 , i40e_aqc_opc_nvm_config_write =0x0705 , i40e_aqc_opc_nvm_update_in_process =0x0706 , + i40e_aqc_opc_rollback_revision_update =0x0707 , i40e_aqc_opc_oem_post_update =0x0720 , i40e_aqc_opc_thermal_sensor = 0x0721,
@@ -2419,6 +2420,23 @@ struct i40e_aqc_nvm_config_data_immediate_field {I40E_CHECK_STRUCT_LEN (0xc , i40e_aqc_nvm_config_data_immediate_field); +/* Minimal Rollback Revision Update (direct 0x0707) */ +struct i40e_aqc_rollback_revision_update { +u8 optin_mode;/* bool */ +#define I40E_AQ_RREV_OPTION_MODE 0x01 +u8 module_selected; +#define I40E_AQ_RREV_MODULE_PCIE_ANALOG 0 +#define I40E_AQ_RREV_MODULE_PHY_ANALOG 1 +#define I40E_AQ_RREV_MODULE_OPTION_ROM 2 +#define I40E_AQ_RREV_MODULE_EMP_IMAGE 3 +#define I40E_AQ_RREV_MODULE_PE_IMAGE 4 +u8 reserved1[2 ]; +u32 min_rrev; +u8 reserved2[8 ]; +}; + +I40E_CHECK_CMD_LENGTH (i40e_aqc_rollback_revision_update); +/* OEM Post Update (indirect 0x0720) * no command data struct used */
drivers/net/i40e/base/i40e_common.c +29 -0
@@ -3717,6 +3717,35 @@ i40e_aq_nvm_update_in_process(struct i40e_hw *hw,return status; } +/** +* i40e_aq_min_rollback_rev_update - triggers an ow after update +* @hw: pointer to the hw struct +* @mode: opt-in mode, 1b for single module update, 0b for bulk update +* @module: module to be updated. Ignored if mode is 0b +* @min_rrev: value of the new minimal version. Ignored if mode is 0b +* @cmd_details: pointer to command details structure or NULL +**/ +enum i40e_status_code +i40e_aq_min_rollback_rev_update (struct i40e_hw *hw,u8 mode,u8 module, +u32 min_rrev, +struct i40e_asq_cmd_details *cmd_details) +{ +struct i40e_aq_desc desc; +struct i40e_aqc_rollback_revision_update *cmd = + (struct i40e_aqc_rollback_revision_update *)&desc.params.raw; +enum i40e_status_code status; + +i40e_fill_default_direct_cmd_desc (&desc, + i40e_aqc_opc_rollback_revision_update); + cmd->optin_mode = mode; + cmd->module_selected = module; + cmd->min_rrev = min_rrev; + + status =i40e_asq_send_command (hw, &desc,NULL ,0 , cmd_details); + +return status; +} +/** * i40e_aq_oem_post_update - triggers an OEM specific flow after update * @hw: pointer to the hw struct
drivers/net/i40e/base/i40e_prototype.h +4 -0
@@ -240,6 +240,10 @@ enum i40e_status_code i40e_aq_write_nvm_config(struct i40e_hw *hw, u8 cmd_flags, void *data, u16 buf_size, u16 element_count, struct i40e_asq_cmd_details *cmd_details); +enum i40e_status_code +i40e_aq_min_rollback_rev_update (struct i40e_hw *hw,u8 mode,u8 module, +u32 min_rrev, +struct i40e_asq_cmd_details *cmd_details);enum i40e_status_code i40e_aq_oem_post_update (struct i40e_hw *hw,void *buff,u16 buff_size,struct i40e_asq_cmd_details *cmd_details);
Signature · 1 line
2.17.1
PATCH v2 4/7 net/i40e/base: fix Rx only for unicast promisc on VLAN
In reply to Guinan SunSet promiscuous mode to rx traffic only if VSI has VLANs configured. Rename misleading PROMISC_TX bit to proper name.
Added I40E_AQC_SET_VSI_PROMISC_RX_ONLY during VSI unicast promiscuous mode configuration with port VLAN.
Aligned unicast promiscuous with VLAN to the one without VLAN. Previously other VFs could listen to unicast tx traffic of other VFs.
--- drivers/net/i40e/base/i40e_adminq_cmd.h | 2 +- drivers/net/i40e/base/i40e_common.c | 36 +++++++++++++++++++------ 2 files changed, 29 insertions(+), 9 deletions(-)
drivers/net/i40e/base/i40e_adminq_cmd.h +1 -1
@@ -1222,7 +1222,7 @@ struct i40e_aqc_set_vsi_promiscuous_modes {#define I40E_AQC_SET_VSI_PROMISC_BROADCAST 0x04#define I40E_AQC_SET_VSI_DEFAULT 0x08#define I40E_AQC_SET_VSI_PROMISC_VLAN 0x10 -#define I40E_AQC_SET_VSI_PROMISC_TX 0x8000 +#define I40E_AQC_SET_VSI_PROMISC_RX_ONLY 0x8000__le16 seid;#define I40E_AQC_VSI_PROM_CMD_SEID_MASK 0x3FF__le16 vlan_tag;
drivers/net/i40e/base/i40e_common.c +28 -8
@@ -2270,6 +2270,22 @@ enum i40e_status_code i40e_aq_set_phy_debug(struct i40e_hw *hw, u8 cmd_flags,return status; } +/** +* i40e_hw_ver_ge +* @hw: pointer to the hw struct +* @maj: api major value +* @min: api minor value +* +* Assert whether current HW api version is greater/equal than provided. +**/ +static bool i40e_hw_ver_ge (struct i40e_hw *hw,u16 maj,u16 min) +{ +if (hw->aq.api_maj_ver > maj || + (hw->aq.api_maj_ver == maj && hw->aq.api_min_ver >= min)) +return true; +return false; +} +/** * i40e_aq_add_vsi * @hw: pointer to the hw struct
@@ -2395,18 +2411,16 @@ enum i40e_status_code i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw,if (set) { flags |=I40E_AQC_SET_VSI_PROMISC_UNICAST ; -if (rx_only_promisc && - (((hw->aq.api_maj_ver ==1 ) && (hw->aq.api_min_ver >=5 )) || - (hw->aq.api_maj_ver >1 ))) - flags |=I40E_AQC_SET_VSI_PROMISC_TX ; +if (rx_only_promisc &&i40e_hw_ver_ge (hw,1 ,5 )) + flags |=I40E_AQC_SET_VSI_PROMISC_RX_ONLY ; } cmd->promiscuous_flags =CPU_TO_LE16 (flags); cmd->valid_flags =CPU_TO_LE16 (I40E_AQC_SET_VSI_PROMISC_UNICAST ); -if (((hw->aq.api_maj_ver >=1 ) && (hw->aq.api_min_ver >=5 )) || - (hw->aq.api_maj_ver >1 )) - cmd->valid_flags |=CPU_TO_LE16 (I40E_AQC_SET_VSI_PROMISC_TX ); +if (i40e_hw_ver_ge (hw,1 ,5 )) + cmd->valid_flags |= +CPU_TO_LE16 (I40E_AQC_SET_VSI_PROMISC_RX_ONLY ); cmd->seid =CPU_TO_LE16 (seid); status =i40e_asq_send_command (hw, &desc,NULL ,0 , cmd_details);
@@ -2538,11 +2552,17 @@ enum i40e_status_code i40e_aq_set_vsi_uc_promisc_on_vlan(struct i40e_hw *hw,i40e_fill_default_direct_cmd_desc (&desc, i40e_aqc_opc_set_vsi_promiscuous_modes); -if (enable) +if (enable) { flags |=I40E_AQC_SET_VSI_PROMISC_UNICAST ; +if (i40e_hw_ver_ge (hw,1 ,5 )) + flags |=I40E_AQC_SET_VSI_PROMISC_RX_ONLY ; + } cmd->promiscuous_flags =CPU_TO_LE16 (flags); cmd->valid_flags =CPU_TO_LE16 (I40E_AQC_SET_VSI_PROMISC_UNICAST ); +if (i40e_hw_ver_ge (hw,1 ,5 )) + cmd->valid_flags |= +CPU_TO_LE16 (I40E_AQC_SET_VSI_PROMISC_RX_ONLY ); cmd->seid =CPU_TO_LE16 (seid); cmd->vlan_tag =CPU_TO_LE16 (vid |I40E_AQC_SET_VSI_VLAN_VALID );
Signature · 1 line
2.17.1
PATCH v2 5/7 net/i40e/base: add EEE LPI status check for X722 adapters
In reply to Guinan SunAdd reading LPI (low power idle) status for supported X722 devices. If adapter's PHY supports EEE in current mode (device ID + link speed), LPI status is read from PHY Clause 45 PCS status register.
--- drivers/net/i40e/base/i40e_common.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
drivers/net/i40e/base/i40e_common.c +12 -4
@@ -7098,15 +7098,23 @@ enum i40e_status_code i40e_get_phy_lpi_status(struct i40e_hw *hw, struct i40e_hw_port_stats *stat) {enum i40e_status_code ret =I40E_SUCCESS ; +bool eee_mrvl_phy; +bool eee_bcm_phy;u32 val; stat->rx_lpi_status =0 ; stat->tx_lpi_status =0 ; -if ((hw->device_id ==I40E_DEV_ID_10G_BASE_T_BC || - hw->device_id ==I40E_DEV_ID_5G_BASE_T_BC ) && - (hw->phy.link_info.link_speed ==I40E_LINK_SPEED_2_5GB || - hw->phy.link_info.link_speed ==I40E_LINK_SPEED_5GB )) { + eee_bcm_phy = + (hw->device_id ==I40E_DEV_ID_10G_BASE_T_BC || + hw->device_id ==I40E_DEV_ID_5G_BASE_T_BC ) && + (hw->phy.link_info.link_speed ==I40E_LINK_SPEED_2_5GB || + hw->phy.link_info.link_speed ==I40E_LINK_SPEED_5GB ); + eee_mrvl_phy = + hw->device_id ==I40E_DEV_ID_1G_BASE_T_X722 ; + +if (eee_bcm_phy || eee_mrvl_phy) { +/* read Clause 45 PCS Status 1 register */ ret = i40e_aq_get_phy_register(hw, I40E_AQ_PHY_REG_ACCESS_EXTERNAL, I40E_BCM_PHY_PCS_STATUS1_PAGE,
Signature · 1 line
2.17.1
PATCH v2 6/7 net/i40e/base: fix PHY config param when enabling EEE
In reply to Guinan SunThe i40e_enable_eee function did not copy phy_type_ext field from current PHY configuration retrieved with Get PHY Abilities AQ. It caused a misconfiguration of the PHY on devices supporting 2.5 and 5G speeds and prevented establishing link when only those speeds were selected for advertisement.
--- drivers/net/i40e/base/i40e_common.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/i40e/base/i40e_common.c +1 -0
@@ -6449,6 +6449,7 @@ enum i40e_status_code i40e_enable_eee(struct i40e_hw *hw, bool enable)/* Cache current configuration */ config.phy_type = abilities.phy_type; + config.phy_type_ext = abilities.phy_type_ext; config.link_speed = abilities.link_speed; config.abilities = abilities.abilities |I40E_AQ_PHY_ENABLE_ATOMIC_LINK ;
Signature · 1 line
2.17.1
PATCH v2 7/7 net/i40e/base: update version
In reply to Guinan SunUpdate base code version in readme.
--- drivers/net/i40e/base/README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/i40e/base/README +1 -1
@@ -6,7 +6,7 @@ Intel® I40E driver ================== This directory contains source code of FreeBSD i40e driver of version -cid-i40e.2020.07.16.tar.gz released by the team which develops +cid-i40e.2020.08.27.tar.gz released by the team which develops basic drivers for any i40e NIC. The directory of base/ contains the original source package. This driver is valid for the product(s) listed below
Signature · 1 line
2.17.1
Quoted 48 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Guinan Sun
Sent: Saturday, September 12, 2020 11:01 AM
To: [email protected]
Cc: Guo, Jia <[email protected]>; Xing, Beilei <[email protected]>; Sun, GuinanX <[email protected]>
Subject: [dpdk-dev] [PATCH v2 0/7] update i40e base codeupdate i40e base code.
source code of i40e driver:
cid-i40e.2020.08.27.tar.gz dropped by the team which develop basic drivers for any i40e NIC.changelog in ND share repo:
Fromc0bfc1c07bb3("i40e-shared: Add VLAN field for input set") To1a82d59f0797("i40e-shared: Fix PHY configuration parameters when enabling EEE")The following commits are ignored.
5b7d5a698092("i40e-shared: use linux packing style")f16fa495c503("i40e-shared: Fix compilation issue with__packed")c0bfc1c07bb3("i40e-shared: Add VLAN field for input set")dcc3e90e9acd("i40e-shared: enable pipe monitor thresholds")Acked-by Qi Zhang <[email protected]>---
v2:
* Remove two useless patches for dpdk.
* Modify commit message.Guinan Sun (7):
net/i40e/base: update FW API versionnet/i40e/base: fix missing function header argumentsnet/i40e/base: add support for minimum rollback revisionnet/i40e/base: fix Rx only for unicast promisc on VLANnet/i40e/base: add EEE LPI status check for X722 adaptersnet/i40e/base: fix PHY config param when enabling EEEnet/i40e/base: update versiondrivers/net/i40e/base/README | 2 +- drivers/net/i40e/base/i40e_adminq_cmd.h | 24 +++++++- drivers/net/i40e/base/i40e_common.c | 82 +++++++++++++++++++++---- drivers/net/i40e/base/i40e_dcb.c | 3 +- drivers/net/i40e/base/i40e_prototype.h | 4 ++ 5 files changed, 98 insertions(+), 17 deletions(-)
Quoted 2 lines
--
2.17.1
V1 has been reverted from dpdk-next-net-intel.
V2 has been applied to dpdk-next-intel-intel.
Thanks
Qi