|WARNING| [v2] common/cnxk: use one interrupt handle per vector
dpdklab at iol.unh.edu
dpdklab at iol.unh.edu
Tue Nov 10 18:26:08 CET 2026
Test-Label: ai-code-review
Test-Status: WARNING
https://dpdk.org/patch/172807
_AI Code Review_
=== Patch Review: series.patch (via Claude) ===
Review date: 2026-11-10
**drivers/common/cnxk/roc_platform.c**
**Warning: `irq_config()` failure is not unwound in `plt_irq_register()`**
```c
/* Enable MSIX vectors to VFIO */
return irq_config(intr_handle, vec);
```
Every earlier failure now jumps to `remove_vec`/`free_vec`, but a failure here returns with the vector still fully registered:
- the EAL callback stays registered on `irq_vec->handle`;
- the efd stays installed via `plt_intr_efds_index_set(intr_handle, vec, fd)`;
- `irq_vec` stays on `plt_irq_vec_list`.
As a result, a retry of `plt_irq_register()` for the same vector gets `-EEXIST`. Unless every caller calls `plt_irq_unregister()` after a failed register, the handle, eventfd and `irq_vec` leak. This contradicts the commit message's claim to "unwind all error paths of plt_irq_register()".
Suggested fix: capture the return value and unwind on failure, for example:
```c
rc = irq_config(intr_handle, vec);
if (rc) {
plt_intr_efds_index_set(intr_handle, vec, -1);
plt_intr_callback_unregister(irq_vec->handle, cb, data);
goto remove_vec;
}
return 0;
```
**Info: unchecked callback unregister before freeing the handle**
```c
plt_intr_callback_unregister(irq_vec->handle, cb, data);
goto remove_vec;
```
If `plt_intr_callback_unregister()` fails (e.g. `-EAGAIN`), `irq_vec_free()` still frees `irq_vec->handle`, which EAL may still reference. This is unlikely at this point because the vector is not yet enabled in VFIO. Checking the return value, or reusing the retry loop from `plt_irq_unregister()`, would make the path robust.
Review-Result: WARNING
More information about the test-report
mailing list