From: Ciara Loftus <ciara.loftus@intel.com>
To: dev@dpdk.org
Cc: Ciara Loftus <ciara.loftus@intel.com>, stable@dpdk.org
Subject: [PATCH] net/virtio: fix eventfd enable on device re-init
Date: Mon, 23 Nov 2026 10:24:33 +0000 [thread overview]
Message-ID: <20261123102434.215799-1-ciara.loftus@intel.com> (raw)
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
next reply other threads:[~2026-11-23 10:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 10:24 Ciara Loftus [this message]
2026-11-23 12:51 ` [PATCH] net/virtio: fix eventfd enable on device re-init Maxime Coquelin
2026-11-23 13:23 ` Loftus, Ciara
2026-11-23 14:09 ` Maxime Coquelin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261123102434.215799-1-ciara.loftus@intel.com \
--to=ciara.loftus@intel.com \
--cc=dev@dpdk.org \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox