From 92718178b194f257ac5aeec86684e42ae347413b Mon Sep 17 00:00:00 2001 From: johnjiang Date: Wed, 18 Mar 2026 20:56:34 +0800 Subject: [PATCH] dpdk/eal: fix secondary process calling eal_bus_cleanup() (#860) 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: https://github.com/F-Stack/f-stack/issues/860 --- dpdk/lib/eal/linux/eal.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/dpdk/lib/eal/linux/eal.c b/dpdk/lib/eal/linux/eal.c index b3b69a090..d92d11c4b 100644 --- a/dpdk/lib/eal/linux/eal.c +++ b/dpdk/lib/eal/linux/eal.c @@ -1370,7 +1370,18 @@ rte_eal_cleanup(void) vfio_mp_sync_cleanup(); #endif rte_mp_channel_cleanup(); - eal_bus_cleanup(); + /* Secondary processes should not call eal_bus_cleanup() because it + * invokes drv->remove() on all PCI devices, which for virtio PMD ends + * up calling virtio_reset() and writing VIRTIO_CONFIG_STATUS_RESET to + * the hardware. This resets the NIC owned by the primary process, + * causing it to stop accepting new connections. + * + * Upstream fix: commit 4bc53f8f0d64 ("eal: fix MP socket cleanup"), + * DPDK >= 25.07. Backport for F-Stack bundled DPDK 23.11.5. + * See also: https://github.com/F-Stack/f-stack/issues/860 + */ + if (rte_eal_process_type() == RTE_PROC_PRIMARY) + eal_bus_cleanup(); rte_eal_alarm_cleanup(); rte_trace_save(); eal_trace_fini();