|WARNING| net/axgbe: retry transient SFP I2C read failures
dpdklab at iol.unh.edu
dpdklab at iol.unh.edu
Thu Nov 19 12:14:15 CET 2026
Test-Label: ai-code-review
Test-Status: WARNING
https://dpdk.org/patch/173047
_AI Code Review_
=== Patch Review: series.patch (via Claude) ===
Review date: 2026-11-19
**Warning: the in-code comment claims the extra retry cost is limited to the first access, but the code does not enforce that**
```c
+ if (axgbe_i2c_retryable(ret) && retry--) {
+ rte_delay_ms(AXGBE_I2C_RETRY_DELAY_MS);
```
The comment says the extra cost "is bounded to each port's first post-init access -- a one-time bring-up cost, not a recurring one paid on every subsequent link_update() poll".
Nothing in `axgbe_i2c_retryable()` or `axgbe_phy_i2c_read()` tracks whether this is the first transaction after `axgbe_phy_init()`. The retry on `-ENOTCONN` and `-ETIMEDOUT` applies to every call, including later polls.
- **Persistent stall:** a stalled bus or missing device returns `-ETIMEDOUT` every time. Each poll then pays the extra internal 1-second timeout(s) plus the 2 ms busy-wait, while holding the shared bus mutex.
- **Expected NACK:** reading an SFP device that legitimately NACKs (`-ENOTCONN`) is now delayed and retried on every poll.
Either restrict the extended retry set to the first access after phy init, for example with a per-port flag cleared after the first successful transfer. Or correct the comment and commit message to state that the cost applies to every failing read.
**Info: the comment block contains material that belongs in the commit message**
The new comment carries validation history ("Validated on two independent physical units (AMD CRB V3C48 and Advantech FWA-1081): 0 I2C errors across 30 iterations...") and a cost discussion. Both duplicate the commit log and will go stale. Keep only a short explanation of why these error codes are retried and why there is a settle delay.
**Info: `rte_delay_ms()` busy-waits while the bus mutex is held**
```c
+ rte_delay_ms(AXGBE_I2C_RETRY_DELAY_MS);
```
This spins the CPU while the shared I2C/MDIO bus mutex is held, blocking other ports for the duration. At 2 ms this is minor. If the path stays on the control thread, `rte_delay_us_sleep()` would avoid burning the CPU.
Review-Result: WARNING
More information about the test-report
mailing list