DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/1] net/e1000: limit 2.5G inter-packet gap workaround to I225
@ 2026-11-13  8:47 Rajesh Kumar
  2026-11-13  8:47 ` [PATCH v1 1/1] " Rajesh Kumar
  0 siblings, 1 reply; 2+ messages in thread
From: Rajesh Kumar @ 2026-11-13  8:47 UTC (permalink / raw)
  To: dev; +Cc: bruce.richardson, aman.deep.singh

The igc link update path unconditionally widens the transmit
inter-packet gap (TIPG.IPGT 0x08 -> 0x0b, 12 -> 15 byte times)
whenever the link comes up at 2.5 Gb/s.

This is a workaround for an erratum in early I225 steppings, where
a back-to-back I225 receiver can drop packets arriving with an IPG
below 8 bytes. Applying it to every 2.5G-capable device costs about
0.2% of small-frame transmit rate on I226 and fixed I225 steppings,
which do not need it.

This patch gates the workaround on I225 device IDs with revision_id
below E1000_REVISION_2, and restores the default gap at other speeds
so a renegotiated link does not keep the widened value.

The igc driver has since been merged into net/e1000; this series is
based on that layout and uses the shared e1000 base definitions.

Rajesh Kumar (1):
  net/e1000: limit 2.5G inter-packet gap workaround to I225

 drivers/net/intel/e1000/igc_ethdev.c | 39 +++++++++++++++++++++++++---
 1 file changed, 36 insertions(+), 3 deletions(-)

-- 
2.43.0


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

* [PATCH v1 1/1] net/e1000: limit 2.5G inter-packet gap workaround to I225
  2026-11-13  8:47 [PATCH v1 0/1] net/e1000: limit 2.5G inter-packet gap workaround to I225 Rajesh Kumar
@ 2026-11-13  8:47 ` Rajesh Kumar
  0 siblings, 0 replies; 2+ messages in thread
From: Rajesh Kumar @ 2026-11-13  8:47 UTC (permalink / raw)
  To: dev; +Cc: bruce.richardson, aman.deep.singh, stable

eth_igc_link_update() unconditionally programs TIPG.IPGT to 0x0b
(15-byte inter-packet gap) whenever the link comes up at 2.5 Gb/s.

This is a workaround for an I225 erratum: when two I225 controllers are
connected back-to-back at 2.5 Gb/s, the receiving MAC can drop packets
that arrive with an inter-packet gap smaller than 8 bytes. Widening the
transmit IPG from the 12-byte default to 15 bytes keeps the link partner
above that threshold. The wider gap costs roughly 0.2% of transmit rate
with small frames.

The erratum is specific to early I225 steppings. Applying the workaround
to every 2.5G-capable device also penalises I226 and later I225
steppings, which do not need it, for no benefit.

Gate the workaround on the I225 device IDs and on revision_id below the
first fixed stepping, and restore the default gap at other speeds.

Fixes: 4f09bc55ac3d ("net/igc: implement device base operations")
Cc: stable@dpdk.org

Signed-off-by: Rajesh Kumar <rajesh3.kumar@intel.com>
---
 drivers/net/intel/e1000/igc_ethdev.c | 39 +++++++++++++++++++++++++---
 1 file changed, 36 insertions(+), 3 deletions(-)

diff --git a/drivers/net/intel/e1000/igc_ethdev.c b/drivers/net/intel/e1000/igc_ethdev.c
index 2c8ff57e6b..5fb245f46b 100644
--- a/drivers/net/intel/e1000/igc_ethdev.c
+++ b/drivers/net/intel/e1000/igc_ethdev.c
@@ -50,6 +50,10 @@
 #define IGC_CTRL_SPEED_MASK		(7u << 8)
 #define IGC_CTRL_SPEED_2500		(6u << 8)
 
+/* TIPG.IPGT values for the I225 2.5G inter-packet-gap erratum workaround */
+#define IGC_TIPG_IPGT_DEFAULT		0x08	/* 12-byte IPG (hardware default) */
+#define IGC_TIPG_IPGT_2500_WA		0x0b	/* 15-byte IPG */
+
 /* External VLAN Ether Type bit mask and shift */
 #define IGC_VET_EXT			0xFFFF0000
 #define IGC_VET_EXT_SHIFT		16
@@ -469,6 +473,24 @@ eth_igc_interrupt_get_status(struct rte_eth_dev *dev)
 		intr->flags |= IGC_FLAG_NEED_LINK_UPDATE;
 }
 
+/* I226 is a later stepping that does not carry the I225 IPG erratum. */
+static bool
+igc_is_i225(const struct e1000_hw *hw)
+{
+	switch (hw->device_id) {
+	case E1000_DEV_ID_I225_LM:
+	case E1000_DEV_ID_I225_V:
+	case E1000_DEV_ID_I225_I:
+	case E1000_DEV_ID_I225_K:
+	case E1000_DEV_ID_I225_K2:
+	case E1000_DEV_ID_I225_IT:
+	case E1000_DEV_ID_I225_LMVP:
+		return true;
+	default:
+		return false;
+	}
+}
+
 /* return 0 means link status changed, -1 means not changed */
 static int
 eth_igc_link_update(struct rte_eth_dev *dev, int wait_to_complete)
@@ -528,11 +550,22 @@ eth_igc_link_update(struct rte_eth_dev *dev, int wait_to_complete)
 		link.link_speed = speed;
 		link.link_status = RTE_ETH_LINK_UP;
 
-		if (speed == SPEED_2500) {
+		/*
+		 * I225 back-to-back 2.5G receive-IPG erratum: widen the TX
+		 * inter-packet gap (TIPG.IPGT) from the 0x08 default (12 byte
+		 * times) to 0x0b (15 byte times) so a link-partner I225 does
+		 * not drop packets; restore the default at other speeds. Only
+		 * affected I225 steppings (revision_id < E1000_REVISION_2) need
+		 * this; later I225 steppings and I226 are excluded.
+		 */
+		if (igc_is_i225(hw) && hw->revision_id < E1000_REVISION_2) {
 			uint32_t tipg = E1000_READ_REG(hw, E1000_TIPG);
-			if ((tipg & E1000_TIPG_IPGT_MASK) != 0x0b) {
+			uint32_t ipgt = (speed == SPEED_2500) ?
+				IGC_TIPG_IPGT_2500_WA : IGC_TIPG_IPGT_DEFAULT;
+
+			if ((tipg & E1000_TIPG_IPGT_MASK) != ipgt) {
 				tipg &= ~E1000_TIPG_IPGT_MASK;
-				tipg |= 0x0b;
+				tipg |= ipgt;
 				E1000_WRITE_REG(hw, E1000_TIPG, tipg);
 			}
 		}
-- 
2.43.0


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

end of thread, other threads:[~2026-11-13  8:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-13  8:47 [PATCH v1 0/1] net/e1000: limit 2.5G inter-packet gap workaround to I225 Rajesh Kumar
2026-11-13  8:47 ` [PATCH v1 1/1] " Rajesh Kumar

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