|WARNING| eal/linux: revert eventfd leak fix for MSI-X

dpdklab at iol.unh.edu dpdklab at iol.unh.edu
Wed Nov 18 17:05:32 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.

   ```c
   			if (fd < 0) {
   				EAL_LOG(ERR,
   					"can't setup eventfd, error %i (%s)",
   					errno, strerror(errno));
   				return -errno;
   			}
   ```

   If `eventfd()` fails at iteration `i > 0`, the fds created in iterations `0..i-1` are already stored in the handle but never closed. `nb_efd` has not been set yet, so `rte_intr_efd_disable()` will not close them either. The descriptors are leaked.

   The revert is intentional, but it puts the error-path leak back. Suggested fix: keep a minimal local cleanup loop that closes `efds[0..i-1]` before returning, independent of whatever change broke net/virtio.

2. Eventfd leak when `rte_intr_efds_index_set()` fails.

   ```c
   			if (rte_intr_efds_index_set(intr_handle, i, fd))
   				return -rte_errno;
   ```

   The fd just created is not stored, so it is leaked. All fds from earlier iterations are also left open. Suggested fix: `close(fd)` and close the previously stored fds before returning.

3. Eventfd leak when the later setters fail.

   ```c
   		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;
   ```

   If either call fails, all `n` eventfds stay open. In the `rte_intr_nb_efd_set()` case, `nb_efd` was never recorded, so no later disable call can find and close them.

**Warnings**

1. `errno` is read after logging, so the returned error code can be wrong.

   ```c
   				return -errno;
   ```

   `EAL_LOG()` and `strerror()` run between the failing `eventfd()` and this read. Both can modify `errno`, so the value returned may not be the `eventfd()` error. The reverted code saved it first (`ret = -errno;`). Suggested fix: capture `errno` in a local variable immediately after `eventfd()` fails, then use that variable in both the log and the return.

Review-Result: ERROR


More information about the test-report mailing list