|WARNING| eal/linux: revert eventfd leak fix for MSI-X
dpdklab at iol.unh.edu
dpdklab at iol.unh.edu
Wed Nov 18 17:09:55 CET 2026
Test-Label: ai-code-review
Test-Status: WARNING
https://dpdk.org/patch/173036
_AI Code Review_
=== Patch Review: series.patch (via Claude) ===
Review date: 2026-11-18
**Errors**
1. **Eventfd leak when `eventfd()` fails partway through the loop.**
```
+ return -errno;
```
If `eventfd()` fails at iteration `i > 0`, the descriptors created in iterations `0..i-1` are never closed. They are stored with `rte_intr_efds_index_set()`, but `rte_intr_nb_efd_set()` is now only called after the loop. As a result, `nb_efd` does not cover them and a later `rte_intr_efd_disable()` cannot release them.
2. **Eventfd leak when `rte_intr_efds_index_set()` fails.**
```
+ if (rte_intr_efds_index_set(intr_handle, i, fd))
+ return -rte_errno;
```
The `fd` just returned by `eventfd()` is not closed. Neither are the earlier descriptors in the array.
3. **Eventfd leak when the post-loop setters fail.**
```
+ if (rte_intr_nb_efd_set(intr_handle, n))
+ return -rte_errno;
+
+ if (rte_intr_max_intr_set(intr_handle, NB_OTHER_INTR + n))
+ return -rte_errno;
```
Either failure returns with all `n` eventfds open. In the `nb_efd_set` failure case, `nb_efd` is also not recorded.
I understand the revert is intentional. However, the leaks are reintroduced by the added lines.
**Suggested fix:** retain the error-path cleanup from 3ba6b689893f, i.e. record `nb_efd` incrementally and close created fds on failure. Revert only the part that changed behaviour for callers, such as the new `-EBUSY` rejection when eventfds are already enabled. If that is not feasible for this release, please state in the commit log that the leak is knowingly reintroduced.
**Warnings**
4. **`errno` read after a logging call that may modify it.**
```
+ EAL_LOG(ERR,
+ "can't setup eventfd, error %i (%s)",
+ errno, strerror(errno));
+ return -errno;
```
`EAL_LOG()` and `strerror()` may change `errno`, so the returned value may not be the `eventfd()` failure code. The reverted code saved it first (`ret = -errno;`).
**Suggested fix:** save `errno` into a local variable before logging, and return that saved value.
Review-Result: ERROR
More information about the test-report
mailing list