[RFC 0/3] fix bogus interrupt FD leak warnings

Stephen Hemminger stephen at networkplumber.org
Sat Oct 17 22:35:02 CEST 2026


Running testpmd with an i40e device on 26.11-rc1 prints a set of FD
leak warnings on port close and on exit:

  Closing ports...
  EAL: Some interrupt handle is leaking a FD: 19
  EAL: Some interrupt handle is leaking a device FD: 18
  Port 0 is closed
  ...
  Bye...
  EAL: Some interrupt handle is leaking a FD: 20
  EAL: Some interrupt handle is leaking a device FD: 18
  EAL: Some interrupt handle is leaking a device FD: 18
  EAL: Some interrupt handle is leaking a FD: 7
  EAL: Some interrupt handle is leaking a FD: 7

The warning is new in 26.11 (commit d770ee9caed0, "interrupts: warn on
leaked FDs"). It is doing its job - one of these is a real leak - but
most of what it reports here is not, and the noise will get reported as
a regression.

There are three distinct causes.

The interrupt source created by rte_intr_callback_register() keeps a
copy of the caller's handle. The copy carries the caller's fd and
dev_fd, but does not own them, so freeing the source complains about
fds that the caller still holds and will close itself.

The VFIO device fd is closed by dev_vfio_release_device() on unmap,
but is left behind in the interrupt handle, so freeing the handle later
reports an fd that is already closed. The VFIO request handle holds the
same fd and has the same problem.

The alarm timerfd is a real leak: it is never closed on EAL cleanup.
FreeBSD was already fixed for this; Linux was not.

Patches 1 and 2 address the bogus warnings, patch 3 the actual leak.
With all three applied the same testpmd run shuts down cleanly with no
warnings.

Open questions:

- Patch 1 clears the fds in the source's copy of the handle. Clearing
  them at dup time, or not duplicating the fds into the source at all,
  may be the better fix.
- Patch 2 resets dev_fd at the two unmap sites. Doing it inside
  dev_vfio_release_device(), next to the close, would cover any other
  caller.

Stephen Hemminger (3):
  eal/linux: do not warn when freeing interrupt source copy
  bus/pci: reset VFIO device FD after release
  eal/linux: close alarm timerfd on cleanup

 drivers/bus/pci/linux/pci_vfio.c |  3 +++
 lib/eal/linux/eal_alarm.c        |  1 +
 lib/eal/linux/eal_interrupts.c   | 18 +++++++++++++++---
 3 files changed, 19 insertions(+), 3 deletions(-)

--
2.51.0

Stephen Hemminger (3):
  eal/linux: do not warn when freeing interrupt source copy
  bus/pci: reset VFIO device FD after release
  eal/linux: close alarm timerfd on cleanup

 drivers/bus/pci/linux/pci_vfio.c |  3 +++
 lib/eal/linux/eal_alarm.c        |  1 +
 lib/eal/linux/eal_interrupts.c   | 18 +++++++++++++++---
 3 files changed, 19 insertions(+), 3 deletions(-)

-- 
2.53.0



More information about the dev mailing list