DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/3] e1000 base code updates
@ 2026-10-16 10:22 Anatoly Burakov
  2026-10-16 10:22 ` [PATCH v1 1/3] net/e1000/base: add new PCH MAC type Anatoly Burakov
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Anatoly Burakov @ 2026-10-16 10:22 UTC (permalink / raw)
  To: dev

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(-)

-- 
2.52.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v1 1/3] net/e1000/base: add new PCH MAC type
  2026-10-16 10:22 [PATCH v1 0/3] e1000 base code updates Anatoly Burakov
@ 2026-10-16 10:22 ` Anatoly Burakov
  2026-10-16 10:23 ` [PATCH v1 2/3] net/e1000/base: retry failed MTA writes on i210/i211 Anatoly Burakov
  2026-10-16 10:23 ` [PATCH v1 3/3] net/e1000/base: enable ULP on LANPHYPC Anatoly Burakov
  2 siblings, 0 replies; 4+ messages in thread
From: Anatoly Burakov @ 2026-10-16 10:22 UTC (permalink / raw)
  To: dev

From: Dima Ruinskiy <dima.ruinskiy@intel.com>

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.

Signed-off-by: Dima Ruinskiy <dima.ruinskiy@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 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(-)

diff --git a/drivers/net/intel/e1000/base/e1000_api.c b/drivers/net/intel/e1000/base/e1000_api.c
index 83b3d6c439..19ba8b575b 100644
--- a/drivers/net/intel/e1000/base/e1000_api.c
+++ b/drivers/net/intel/e1000/base/e1000_api.c
@@ -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:
diff --git a/drivers/net/intel/e1000/base/e1000_hw.h b/drivers/net/intel/e1000/base/e1000_hw.h
index 99c2195916..335a018776 100644
--- a/drivers/net/intel/e1000/base/e1000_hw.h
+++ b/drivers/net/intel/e1000/base/e1000_hw.h
@@ -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,
diff --git a/drivers/net/intel/e1000/base/e1000_ich8lan.c b/drivers/net/intel/e1000/base/e1000_ich8lan.c
index 0290a7dcb4..b020639563 100644
--- a/drivers/net/intel/e1000/base/e1000_ich8lan.c
+++ b/drivers/net/intel/e1000/base/e1000_ich8lan.c
@@ -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;
diff --git a/drivers/net/intel/e1000/em_ethdev.c b/drivers/net/intel/e1000/em_ethdev.c
index c02d09e500..be830881db 100644
--- a/drivers/net/intel/e1000/em_ethdev.c
+++ b/drivers/net/intel/e1000/em_ethdev.c
@@ -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:
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v1 2/3] net/e1000/base: retry failed MTA writes on i210/i211
  2026-10-16 10:22 [PATCH v1 0/3] e1000 base code updates Anatoly Burakov
  2026-10-16 10:22 ` [PATCH v1 1/3] net/e1000/base: add new PCH MAC type Anatoly Burakov
@ 2026-10-16 10:23 ` Anatoly Burakov
  2026-10-16 10:23 ` [PATCH v1 3/3] net/e1000/base: enable ULP on LANPHYPC Anatoly Burakov
  2 siblings, 0 replies; 4+ messages in thread
From: Anatoly Burakov @ 2026-10-16 10:23 UTC (permalink / raw)
  To: dev, Thomas Monjalon

From: Dima Ruinskiy <dima.ruinskiy@intel.com>

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.

Signed-off-by: Grzegorz Siwik <grzegorz.siwik@intel.com>
Signed-off-by: Dima Ruinskiy <dima.ruinskiy@intel.com>
Signed-off-by: Yashaswini Raghuram Prathivadi Bhayankaram <yashaswini.raghuram.prathivadi.bhayankaram@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 .mailmap                                 |  1 +
 drivers/net/intel/e1000/base/e1000_mac.c | 34 ++++++++++++++++++++++++
 2 files changed, 35 insertions(+)

diff --git a/.mailmap b/.mailmap
index 6d9e262cfb..f2e35dd968 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1927,6 +1927,7 @@ Yaron Illouz <yaroni@radcom.com>
 Yaroslav Brustinov <ybrustin@cisco.com>
 Yash Sharma <ysharma@marvell.com>
 Yashaswini Kanaujia <ykanaujia@marvell.com>
+Yashaswini Raghuram Prathivadi Bhayankaram <yashaswini.raghuram.prathivadi.bhayankaram@intel.com>
 Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp> <yasufum.o@gmail.com>
 Ye Chen <yex.chen@intel.com>
 Yehor Malikov <yehor.malikov@solidigm.com>
diff --git a/drivers/net/intel/e1000/base/e1000_mac.c b/drivers/net/intel/e1000/base/e1000_mac.c
index 408e8e46e8..f794e24b75 100644
--- a/drivers/net/intel/e1000/base/e1000_mac.c
+++ b/drivers/net/intel/e1000/base/e1000_mac.c
@@ -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);
 }
 
 /**
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v1 3/3] net/e1000/base: enable ULP on LANPHYPC
  2026-10-16 10:22 [PATCH v1 0/3] e1000 base code updates Anatoly Burakov
  2026-10-16 10:22 ` [PATCH v1 1/3] net/e1000/base: add new PCH MAC type Anatoly Burakov
  2026-10-16 10:23 ` [PATCH v1 2/3] net/e1000/base: retry failed MTA writes on i210/i211 Anatoly Burakov
@ 2026-10-16 10:23 ` Anatoly Burakov
  2 siblings, 0 replies; 4+ messages in thread
From: Anatoly Burakov @ 2026-10-16 10:23 UTC (permalink / raw)
  To: dev

From: Dima Ruinskiy <dima.ruinskiy@intel.com>

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.

Signed-off-by: Dima Ruinskiy <dima.ruinskiy@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/net/intel/e1000/base/e1000_ich8lan.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/intel/e1000/base/e1000_ich8lan.c b/drivers/net/intel/e1000/base/e1000_ich8lan.c
index b020639563..ed86c24af6 100644
--- a/drivers/net/intel/e1000/base/e1000_ich8lan.c
+++ b/drivers/net/intel/e1000/base/e1000_ich8lan.c
@@ -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)
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-10-16 10:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-16 10:22 [PATCH v1 0/3] e1000 base code updates Anatoly Burakov
2026-10-16 10:22 ` [PATCH v1 1/3] net/e1000/base: add new PCH MAC type Anatoly Burakov
2026-10-16 10:23 ` [PATCH v1 2/3] net/e1000/base: retry failed MTA writes on i210/i211 Anatoly Burakov
2026-10-16 10:23 ` [PATCH v1 3/3] net/e1000/base: enable ULP on LANPHYPC Anatoly Burakov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox