aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Douthit <stephend@silicom-usa.com>2026-07-28 11:09:02 +0000
committerKevin Bowling <kbowling@FreeBSD.org>2026-08-08 00:41:44 +0000
commit70df28a9281a799d33f2391d4cf605341980e080 (patch)
treec62aa06041ae289e2658f694fb1e342ca4a7f176
parentfce4d00876e805ef7063141b22ce08b2e97bd42b (diff)
ixgbe: retry incoherent SFP identifier reads
FreeBSD's I2C helper already retries failed transactions. Limit this new outer loop to successful reads with an invalid identifier so that retry budget is not multiplied. DPDK commit message net/ixgbe: retry misbehaving SFP read Some XGS-PON SFPs ACK I2C reads and return uninitialized data while their microcontroller boots. A bogus identifier can cause an otherwise working module to be marked unsupported. Retry the identifier read several times, checking for both successful I2C completion and a valid SFP identifier. Signed-off-by: Stephen Douthit <stephend@silicom-usa.com> Signed-off-by: Jeff Daly <jeffd@silicom-usa.com> Reviewed-by: Haiyue Wang <haiyue.wang@intel.com> Obtained from: DPDK (774263bb4e) (cherry picked from commit 985bef0c4474abe8ebc3b0def601db8ceff2a690)
-rw-r--r--sys/dev/ixgbe/ixgbe_phy.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/sys/dev/ixgbe/ixgbe_phy.c b/sys/dev/ixgbe/ixgbe_phy.c
index 2a735ead9a12..a614ffe50c0d 100644
--- a/sys/dev/ixgbe/ixgbe_phy.c
+++ b/sys/dev/ixgbe/ixgbe_phy.c
@@ -1299,6 +1299,7 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
u8 oui_bytes[3] = {0, 0, 0};
u8 cable_tech = 0;
u8 cable_spec = 0;
+ u8 retries;
u16 enforce_sfp = 0;
static bool warned_once = false;
@@ -1313,9 +1314,22 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
/* LAN ID is needed for I2C access */
hw->mac.ops.set_lan_id(hw);
- status = hw->phy.ops.read_i2c_eeprom(hw,
- IXGBE_SFF_IDENTIFIER,
- &identifier);
+ /*
+ * Some SFPs with a microcontroller ACK I2C reads before the data
+ * backing them is initialized. Retry successfully completed reads
+ * with invalid identifier values before declaring the module
+ * unsupported. Failed transactions are retried by the I2C helper.
+ */
+ for (retries = 0; retries < 5; retries++) {
+ status = hw->phy.ops.read_i2c_eeprom(hw,
+ IXGBE_SFF_IDENTIFIER, &identifier);
+
+ DEBUGOUT2("status %d, SFF identifier 0x%x\n", status,
+ identifier);
+ if (status != IXGBE_SUCCESS ||
+ identifier == IXGBE_SFF_IDENTIFIER_SFP)
+ break;
+ }
if (status != IXGBE_SUCCESS)
goto err_read_i2c_eeprom;