DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net/virtio: fix eventfd enable on device re-init
@ 2026-11-23 10:24 Ciara Loftus
  2026-11-23 12:51 ` Maxime Coquelin
  0 siblings, 1 reply; 4+ messages in thread
From: Ciara Loftus @ 2026-11-23 10:24 UTC (permalink / raw)
  To: dev; +Cc: Ciara Loftus, stable

virtio_dev_configure() can call virtio_init_device() more than once
with Rx interrupts enabled. Each call enables the eventfds again without
releasing the previous ones. This used to leak the old eventfds, but EAL
now rejects the repeated enable, causing dev_configure() to fail.

Fix this by disabling the eventfds before enabling them again, except
for virtio-user which does not recreate them.

Fixes: e7b9d1d2806c ("net/virtio: fix Rx interrupt setup")
Cc: stable@dpdk.org

Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
---
 drivers/net/virtio/virtio_ethdev.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index f2302089ee..18d258a519 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1455,6 +1455,10 @@ virtio_configure_intr(struct rte_eth_dev *dev)
 		return -ENOTSUP;
 	}
 
+	/* Release efds from a previous init. VDEV owns its own */
+	if (rte_intr_type_get(dev->intr_handle) != RTE_INTR_HANDLE_VDEV)
+		rte_intr_efd_disable(dev->intr_handle);
+
 	ret = rte_intr_efd_enable(dev->intr_handle, dev->data->nb_rx_queues);
 	if (ret < 0) {
 		PMD_INIT_LOG(ERR, "Fail to create eventfd");
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-23 14:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-23 10:24 [PATCH] net/virtio: fix eventfd enable on device re-init Ciara Loftus
2026-11-23 12:51 ` Maxime Coquelin
2026-11-23 13:23   ` Loftus, Ciara
2026-11-23 14:09     ` Maxime Coquelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox