e1000 base code updates
cover e1000 base code updates
Small base code update for e1000 driver.
Dima Ruinskiy (3):
net/e1000/base: add new PCH MAC type net/e1000/base: retry failed MTA writes on i210/i211 net/e1000/base: enable ULP on LANPHYPC
.mailmap | 1 + drivers/net/intel/e1000/base/e1000_api.c | 5 ++- drivers/net/intel/e1000/base/e1000_hw.h | 1 + drivers/net/intel/e1000/base/e1000_ich8lan.c | 8 +++++ drivers/net/intel/e1000/base/e1000_mac.c | 34 ++++++++++++++++++++ drivers/net/intel/e1000/em_ethdev.c | 5 ++- 6 files changed, 52 insertions(+), 2 deletions(-)
Signature · 1 line
2.52.0
PATCH 1/3 net/e1000/base: add new PCH MAC type
From: Dima Ruinskiy <[email protected]>
Add a new e1000_pch_nvp MAC type and move the existing NVL device IDs from e1000_pch_ptp to it. The new MAC type takes the same code paths as e1000_pch_ptp in both the base code and the em PMD.
--- drivers/net/intel/e1000/base/e1000_api.c | 5 ++++- drivers/net/intel/e1000/base/e1000_hw.h | 1 + drivers/net/intel/e1000/base/e1000_ich8lan.c | 7 +++++++ drivers/net/intel/e1000/em_ethdev.c | 5 ++++- 4 files changed, 16 insertions(+), 2 deletions(-)
drivers/net/intel/e1000/base/e1000_api.c +4 -1
@@ -328,9 +328,11 @@ s32 e1000_set_mac_type(struct e1000_hw *hw)case E1000_DEV_ID_PCH_PTP_I219_V25 :case E1000_DEV_ID_PCH_WCL_I219_LM27 :case E1000_DEV_ID_PCH_WCL_I219_V27 : + mac->type = e1000_pch_ptp; +break ;case E1000_DEV_ID_PCH_NVL_I219_LM29 :case E1000_DEV_ID_PCH_NVL_I219_V29 : - mac->type = e1000_pch_ptp; + mac->type = e1000_pch_nvp;break ;case E1000_DEV_ID_82575EB_COPPER :case E1000_DEV_ID_82575EB_FIBER_SERDES :
@@ -505,6 +507,7 @@ s32 e1000_setup_init_funcs(struct e1000_hw *hw, bool init_device)case e1000_pch_tgp:case e1000_pch_mtp:case e1000_pch_ptp: +case e1000_pch_nvp:e1000_init_function_pointers_ich8lan (hw);break ;case e1000_82575:
drivers/net/intel/e1000/base/e1000_hw.h +1 -0
@@ -265,6 +265,7 @@ enum e1000_mac_type { e1000_pch_adp, e1000_pch_mtp, e1000_pch_ptp, + e1000_pch_nvp, e1000_pch_tgp, e1000_82575, e1000_82576,
drivers/net/intel/e1000/base/e1000_ich8lan.c +7 -0
@@ -372,6 +372,7 @@ STATIC s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw)case e1000_pch_adp:case e1000_pch_mtp:case e1000_pch_ptp: +case e1000_pch_nvp:/* Due to clock synchronization issue on MTL and above prior to * disabling k1 it is required to disable P0s state and * reconfigure PHY k1 exit timeout. At this point the PHY might
@@ -549,6 +550,7 @@ STATIC s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw)case e1000_pch_adp:case e1000_pch_mtp:case e1000_pch_ptp: +case e1000_pch_nvp:/* In case the PHY needs to be in mdio slow mode, * set slow mode and try to get the PHY id again. */
@@ -856,6 +858,7 @@ STATIC s32 e1000_init_mac_params_ich8lan(struct e1000_hw *hw)case e1000_pch_adp:case e1000_pch_mtp:case e1000_pch_ptp: +case e1000_pch_nvp:/* multicast address update for pch2 */ mac->ops.update_mc_addr_list = e1000_update_mc_addr_list_pch2lan;
@@ -1866,6 +1869,7 @@ void e1000_init_function_pointers_ich8lan(struct e1000_hw *hw)case e1000_pch_adp:case e1000_pch_mtp:case e1000_pch_ptp: +case e1000_pch_nvp: hw->phy.ops.init_params = e1000_init_phy_params_pchlan;break ;default :
@@ -2335,6 +2339,7 @@ STATIC s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw)case e1000_pch_adp:case e1000_pch_mtp:case e1000_pch_ptp: +case e1000_pch_nvp: sw_cfg_mask =E1000_FEXTNVM_SW_CONFIG_ICH8M ;break ;default :
@@ -3461,6 +3466,7 @@ STATIC s32 e1000_valid_nvm_bank_detect_ich8lan(struct e1000_hw *hw, u32 *bank)case e1000_pch_adp:case e1000_pch_mtp:case e1000_pch_ptp: +case e1000_pch_nvp: bank1_offset = nvm->flash_bank_size; act_offset =E1000_ICH_NVM_SIG_WORD ;
@@ -4436,6 +4442,7 @@ STATIC s32 e1000_validate_nvm_checksum_ich8lan(struct e1000_hw *hw)case e1000_pch_adp:case e1000_pch_mtp:case e1000_pch_ptp: +case e1000_pch_nvp: word =NVM_COMPAT ; valid_csum_mask =NVM_COMPAT_VALID_CSUM ;break ;
drivers/net/intel/e1000/em_ethdev.c +4 -1
@@ -593,6 +593,7 @@ em_set_pba(struct e1000_hw *hw)case e1000_pch_tgp:case e1000_pch_mtp:case e1000_pch_ptp: +case e1000_pch_nvp: pba =E1000_PBA_26K ;break ;default :
@@ -983,7 +984,8 @@ em_hardware_init(struct e1000_hw *hw) hw->mac.type == e1000_pch_adp || hw->mac.type == e1000_pch_tgp || hw->mac.type == e1000_pch_mtp || - hw->mac.type == e1000_pch_ptp) { + hw->mac.type == e1000_pch_ptp || + hw->mac.type == e1000_pch_nvp) { hw->fc.requested_mode = e1000_fc_full; }
@@ -1177,6 +1179,7 @@ em_get_max_pktlen(struct rte_eth_dev *dev)case e1000_pch_tgp:case e1000_pch_mtp:case e1000_pch_ptp: +case e1000_pch_nvp:case e1000_82574:case e1000_80003es2lan:/* 9K Jumbo Frame size */ case e1000_82583:
Signature · 1 line
2.52.0
PATCH 2/3 net/e1000/base: retry failed MTA writes on i210/i211
In reply to Anatoly BurakovFrom: Dima Ruinskiy <[email protected]>
On i210 and i211, writes to the multicast table array (MTA) sometimes fail silently, leaving the hardware MTA out of sync with the driver's mta_shadow copy.
After updating the MTA in e1000_update_mc_addr_list_generic(), read the registers back on these devices and compare them with mta_shadow. Rewrite any register that does not match, up to three attempts.
--- .mailmap | 1 + drivers/net/intel/e1000/base/e1000_mac.c | 34 ++++++++++++++++++++++++ 2 files changed, 35 insertions(+)
.mailmap +1 -0
@@ -1927,6 +1927,7 @@ Yaron Illouz <[email protected]> Yaroslav Brustinov <[email protected]> Yash Sharma <[email protected]> Yashaswini Kanaujia <[email protected]> +Yashaswini Raghuram Prathivadi Bhayankaram <[email protected]> Yasufumi Ogawa <[email protected]> <[email protected]> Ye Chen <[email protected]> Yehor Malikov <[email protected]>
drivers/net/intel/e1000/base/e1000_mac.c +34 -0
@@ -549,6 +549,38 @@ u32 e1000_hash_mc_addr_generic(struct e1000_hw *hw, u8 *mc_addr)return hash_value; } +/** +* e1000_i21x_mta_workaround - workaround for MTA write failures +* @hw: pointer to the HW structure +* +* On I210/I211 sometimes multicast table array writes silently fail. +* Compare to MTA shadow to see if any registers are incorrectly written. +* If a mismatch is found, try to write again up to three times. +**/ +static void e1000_i21x_mta_workaround (struct e1000_hw *hw) +{ +int failed_cnt =3 ; +bool is_failed; +int i; + +do { + is_failed = false; +for (i = hw->mac.mta_reg_count -1 ; i >=0 ; i--) { +if (E1000_READ_REG_ARRAY (hw,E1000_MTA , i) != + hw->mac.mta_shadow[i]) { + is_failed = true; +E1000_WRITE_REG_ARRAY (hw,E1000_MTA , i, + hw->mac.mta_shadow[i]); +E1000_WRITE_FLUSH (hw); + } + } +if (is_failed && --failed_cnt <=0 ) { +DEBUGOUT ("Failed to update MTA register, too many retries\n" ); +break ; + } + }while (is_failed); +} +/** * e1000_update_mc_addr_list_generic - Update Multicast addresses * @hw: pointer to the HW structure
@@ -584,6 +616,8 @@ void e1000_update_mc_addr_list_generic(struct e1000_hw *hw,for (i = hw->mac.mta_reg_count -1 ; i >=0 ; i--)E1000_WRITE_REG_ARRAY (hw,E1000_MTA , i, hw->mac.mta_shadow[i]);E1000_WRITE_FLUSH (hw); +if (hw->mac.type == e1000_i210 || hw->mac.type == e1000_i211) +e1000_i21x_mta_workaround (hw); }/**
Signature · 1 line
2.52.0
PATCH 3/3 net/e1000/base: enable ULP on LANPHYPC
In reply to Anatoly BurakovFrom: Dima Ruinskiy <[email protected]>
When the system enters Sx without wakeup configured, the PHY is powered down autonomously via LANPHYPC.
Set I218_ULP_CONFIG1_EN_ULP_LANPHYPC when configuring ULP in e1000_enable_ulp_lpt_lp() so that the PHY also enters ULP on LANPHYPC, for additional power savings.
--- drivers/net/intel/e1000/base/e1000_ich8lan.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/intel/e1000/base/e1000_ich8lan.c +1 -0
@@ -1283,6 +1283,7 @@ s32 e1000_enable_ulp_lpt_lp(struct e1000_hw *hw, bool to_sx)if (ret_val) goto release; phy_reg |= (I218_ULP_CONFIG1_RESET_TO_SMBUS | +I218_ULP_CONFIG1_EN_ULP_LANPHYPC |I218_ULP_CONFIG1_DISABLE_SMB_PERST );if (to_sx) {if (E1000_READ_REG (hw,E1000_WUFC ) &E1000_WUFC_LNKC )
Signature · 1 line
2.52.0
Quoted 7 lines · Anatoly Burakov
Small base code update for e1000 driver.
Dima Ruinskiy (3):
net/e1000/base: add new PCH MAC typenet/e1000/base: retry failed MTA writes on i210/i211net/e1000/base: enable ULP on LANPHYPC
Quoted 8 lines
.mailmap | 1 + drivers/net/intel/e1000/base/e1000_api.c | 5 ++- drivers/net/intel/e1000/base/e1000_hw.h | 1 + drivers/net/intel/e1000/base/e1000_ich8lan.c | 8 +++++ drivers/net/intel/e1000/base/e1000_mac.c | 34 ++++++++++++++++++++ drivers/net/intel/e1000/em_ethdev.c | 5 ++- 6 files changed, 52 insertions(+), 2 deletions(-)
Series applied to dpdk-next-net-intel.
Thanks,
/Bruce