|WARNING| [v2, 3/3] net/ice: fix adapter stopped on device start error
dpdklab at iol.unh.edu
dpdklab at iol.unh.edu
Thu Jul 9 14:34:47 CEST 2026
Test-Label: ai-code-review
Test-Status: WARNING
https://dpdk.org/patch/166650
_AI Code Review_
=== Patch Review: series.patch (via Claude) ===
Review date: 2026-07-09
# DPDK Patch Review
## Patch 1/3: net/ice: poll AdminQ if interrupt delivery unavailable
### Errors
None identified.
### Warnings
None identified.
### Info
**Code Quality:**
The patch introduces a workaround for missing interrupt delivery by using a periodic alarm to poll the AdminQ. The implementation is sound with proper lifecycle management.
**Error Path Verification:**
- `rte_eal_alarm_set()` failure is logged with a warning, and `use_aq_polling` is only set on success - correct.
- Alarm cancellation in `ice_dev_stop()` properly checks `use_aq_polling` before canceling.
- No resource leaks identified.
**Naming and Style:**
- `ice_aq_alarm_handler()` follows DPDK naming conventions.
- `use_aq_polling` is a clear descriptive name for the flag.
- Comment style and formatting comply with guidelines.
**Logic:**
- The `!pf->adapter_stopped` check in `ice_aq_alarm_handler()` prevents processing after stop, which is correct.
- Moving alarm cancel to the start of `ice_dev_stop()` (before setting `adapter_stopped`) prevents a race where the alarm could fire after stop begins - good defensive programming.
- The 50ms interval (`ICE_AQ_ALARM_INTERVAL`) is reasonable for link state notification latency.
---
## Patch 2/3: net/i40e: activate alarm if interrupt delivery unavailable
### Errors
None identified.
### Warnings
**Alarm Cancel Placement:**
In `i40e_dev_stop()`, the new alarm cancel for `use_aq_polling` mode is placed after the polling-mode cancel (`rxq == 0`) and after `rte_intr_enable()`. The i40e code disables interrupts earlier in the stop sequence (line 2612: `i40e_dev_interrupt_handler(...)` and `rte_intr_disable()`). Consider whether the alarm should be canceled earlier to avoid a potential race where the alarm fires after interrupts are disabled but before the cancel. While not a correctness bug (the alarm handler likely checks some state), it could process stale events. Review whether alarm cancel should be moved before `rte_intr_disable()` for consistency with the ice patch.
### Info
**Code Quality:**
The patch mirrors the ice fix, activating the existing i40e polling alarm when interrupt delivery fails. The logic is correct.
**Error Path:**
- `rte_eal_alarm_set()` failure is logged and `use_aq_polling` is only set on success - correct.
- Alarm is canceled in stop when `use_aq_polling` is true.
**Difference from ice:**
Unlike ice, i40e already had a polling alarm for `rxq == 0` mode. This patch reuses that mechanism for the interrupt-unavailable case, which is appropriate.
---
## Patch 3/3: net/ice: fix adapter stopped on device start error
### Errors
None identified.
### Warnings
**Incomplete Error Path Cleanup:**
The patch adds `pf->adapter_stopped = true;` to the `ice_dev_start()` error path, which is correct. However, the error path does not cancel the alarm if `use_aq_polling` was set earlier in the function. If `rte_eal_alarm_set()` succeeded but a later step in `ice_dev_start()` fails (e.g., `ice_tx_queue_start()` or `ice_nvm_init_log()` returns error), the alarm remains active and will continue firing even though the device is stopped. This is a resource leak.
**Suggested Fix:**
Add alarm cancellation to the error path:
```c
error_start_queues:
for (i = 0; i < nb_rxq; i++)
ice_rx_queue_stop(dev, i);
for (i = 0; i < nb_txq; i++)
ice_tx_queue_stop(dev, i);
if (pf->use_aq_polling) {
rte_eal_alarm_cancel(ice_aq_alarm_handler, dev);
pf->use_aq_polling = false;
}
pf->adapter_stopped = true;
return -EIO;
```
### Info
**Correctness of Added Line:**
Setting `adapter_stopped = true` on the error path is necessary. The flag was cleared at the start of `ice_dev_start()`, and if startup fails, the device is in a stopped state. This prevents the alarm handler from attempting to process messages on a partially-initialized device.
---
## General Comments
**Series Overview:**
The series addresses a real problem (missing link state updates when interrupts are unavailable) with a reasonable fallback mechanism. The implementations are mostly correct.
**Testing:**
These patches should be tested on:
- FreeBSD with nic_uio (the primary failure case mentioned)
- Linux with interrupts working (to ensure no regression)
- Linux with interrupt registration forced to fail (to verify the alarm path)
- Device start failures (to verify error path correctness after patch 3 is fixed)
**Release Notes:**
The patches fix actual bugs (wrong link status after dev_start in some environments) and should have release notes entries. However, since these are bug fixes, not new features, release notes are not strictly required per the guidelines. Consider adding a brief note about the improved robustness on platforms without interrupt support.
More information about the test-report
mailing list