DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Rajesh Kumar <rajesh3.kumar@intel.com>
To: dev@dpdk.org
Cc: bruce.richardson@intel.com, aman.deep.singh@intel.com, stable@dpdk.org
Subject: [PATCH v1 1/1] net/e1000: limit 2.5G inter-packet gap workaround to I225
Date: Fri, 13 Nov 2026 14:17:26 +0530	[thread overview]
Message-ID: <20261113084726.4059806-2-rajesh3.kumar@intel.com> (raw)
In-Reply-To: <20261113084726.4059806-1-rajesh3.kumar@intel.com>

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


      reply	other threads:[~2026-11-13  8:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261113084726.4059806-2-rajesh3.kumar@intel.com \
    --to=rajesh3.kumar@intel.com \
    --cc=aman.deep.singh@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox