|WARNING| [4/4] net/i40e: fix Rx desc write-back with interrupts disabled
dpdklab at iol.unh.edu
dpdklab at iol.unh.edu
Thu Nov 26 14:45:36 CET 2026
Test-Label: ai-code-review
Test-Status: WARNING
https://dpdk.org/patch/173206
_AI Code Review_
warning: review has no Review-Result line, severity inferred from prose (response may be truncated)
=== Patch Review: series.patch (via Claude) ===
Review date: 2026-11-26
**Patch 4/4: net/i40e: fix Rx desc write-back with interrupts disabled**
**Error: zero-initialised node for an unlisted queue corrupts the cause lists**
`i40e_rxq_intr_sink_setup()` deliberately skips queues that are not set up:
```c
if (rxq == NULL || !rxq->q_set)
continue;
i40e_rxq_intr_list_add(dev, q, sink);
```
Their nodes keep the `calloc()` defaults `{vec = 0, prev = 0, next = 0}`. If the application later calls `rte_eth_dev_rx_intr_enable()` on such a queue (for example, one set up at runtime after start), this path runs:
```c
if (pf->rxq_intr_nodes[qid].vec != vec) {
i40e_rxq_intr_list_del(dev, qid);
```
`i40e_rxq_intr_list_del()` then treats `prev = 0` as a real predecessor. It rewrites `QINT_RQCTL` of queue 0's hardware queue to point at vector 0. It also sets `nodes[0].next` and `nodes[0].prev` to 0, corrupting both the software and hardware lists.
In the same case, `i40e_dev_rx_queue_intr_enable()` dereferences `rxq` (`rxq->rx_nb_avail`) without a NULL check.
Suggested fix:
- Initialise every node to `vec = prev = next = I40E_RXQ_INTR_NONE` in setup.
- In `i40e_rxq_intr_move()`, skip `list_del` when `vec == I40E_RXQ_INTR_NONE`.
- Either reject or handle a NULL or unset `rxq` before using it in the enable path.
**Error: unchecked vector lookup in sink setup**
The return value of `rte_intr_vec_list_index_get()` is used without checking for failure:
```c
const uint16_t vec = rte_intr_vec_list_index_get(intr_handle, q);
I40E_WRITE_REG(hw, I40E_PFINT_LNKLSTN(vec - I40E_RX_VEC_START),
```
A negative return from the lookup is truncated to a large `uint16_t`. This produces a register write far outside the `PFINT_LNKLSTN` array. It is the same failure mode that patch 2/4 fixes in the enable and disable callbacks.
Suggested fix: store the result in an `int`, and abandon sink setup if it
More information about the test-report
mailing list