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-07-31 11:20:02 +0000
commit985bef0c4474abe8ebc3b0def601db8ceff2a690 (patch)
tree996f85a27e2124cfd3b5aff08ede13069be558a0
parenta8598143803d8db60568844cae86b0f330e49a1e (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) MFC after: 1 week
-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;