Skip to content

dpdk/eal: fix secondary process resetting NIC via eal_bus_cleanup()#1050

Merged
jfb8856606 merged 1 commit intodevfrom
fix/dpdk-secondary-eal-bus-cleanup
Mar 18, 2026
Merged

dpdk/eal: fix secondary process resetting NIC via eal_bus_cleanup()#1050
jfb8856606 merged 1 commit intodevfrom
fix/dpdk-secondary-eal-bus-cleanup

Conversation

@jfb8856606
Copy link
Contributor

Problem

When a secondary DPDK process exits (e.g. ff_ifconfig, ff_sysctl), the primary process (F-Stack/nginx) stops accepting new connections. The NIC becomes non-functional until the primary process is restarted.

Reproduction:

# Start F-Stack primary process (nginx)
./nginx ...

# Run any f-stack tool (even just --help triggers the bug)
./ff_ifconfig --help   # primary stops receiving packets after this returns

Root Cause

DPDK commit 1cab1a40ea9b ("bus: cleanup devices on shutdown", introduced in DPDK 22.11) added eal_bus_cleanup() to rte_eal_cleanup() without distinguishing between primary and secondary processes.

When rte_eal_cleanup() is called in the secondary process, it executes:

rte_mp_channel_cleanup()    <- closes IPC socket
eal_bus_cleanup()           <- calls drv->remove() on ALL PCI devices
  -> pci_cleanup()
  -> drv->remove(dev)       <- eth_virtio_pci_remove()
  -> virtio_dev_close()
  -> virtio_reset(hw)       <- writes 0x00 to VIRTIO_CONFIG_STATUS_RESET !

virtio_reset() performs a full hardware reset of the NIC. The primary process still holds the device but its hardware state has been destroyed.

Fix

Guard eal_bus_cleanup() with a primary-process check so secondary processes skip the bus cleanup:

if (rte_eal_process_type() == RTE_PROC_PRIMARY)
    eal_bus_cleanup();

This is consistent with the fix in upstream DPDK commit 4bc53f8f0d64 ("eal: fix MP socket cleanup"), which was merged for DPDK 25.07. The upstream fix also reorders eal_bus_cleanup() before rte_mp_channel_cleanup() to handle IPC-dependent cleanup in drivers; this backport takes the simpler approach of skipping bus cleanup in secondary processes entirely.

Affected Versions

All DPDK LTS releases that include commit 1cab1a40ea9b are affected:

  • DPDK 22.11.x (all point releases)
  • DPDK 23.11.x (including F-Stack bundled 23.11.5)
  • DPDK 24.11.x (up to at least 24.11.4)

The fix is available in DPDK 25.07+ only.

References

Secondary processes (e.g. ff_ifconfig, ff_sysctl) should not invoke
eal_bus_cleanup() on exit, because it calls drv->remove() on every PCI
device.  For the virtio PMD this eventually reaches virtio_reset(), which
writes VIRTIO_CONFIG_STATUS_RESET (0x00) to the device status register
and resets the NIC hardware.  The primary process (F-Stack / nginx) loses
its NIC after that and stops accepting new connections.

Root cause: commit 1cab1a40ea9b ("bus: cleanup devices on shutdown",
DPDK 22.11) added eal_bus_cleanup() to rte_eal_cleanup() without
distinguishing primary from secondary processes.

Fix: guard eal_bus_cleanup() with a primary-process check, identical to
the approach in upstream DPDK commit 4bc53f8f0d64 ("eal: fix MP socket
cleanup", merged for DPDK 25.07).  Backported here for the bundled
DPDK 23.11.5.

Fixes: #860
@jfb8856606 jfb8856606 merged commit 528cb9f into dev Mar 18, 2026
7 checks passed
@jfb8856606 jfb8856606 deleted the fix/dpdk-secondary-eal-bus-cleanup branch March 18, 2026 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant