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

* Re: [PATCH] net/virtio: fix eventfd enable on device re-init
  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
  0 siblings, 1 reply; 4+ messages in thread
From: Maxime Coquelin @ 2026-11-23 12:51 UTC (permalink / raw)
  To: Ciara Loftus; +Cc: dev, stable

Hello Ciara,

On Mon, Nov 23, 2026 at 11:25 AM Ciara Loftus <ciara.loftus@intel.com> wrote:
>
> 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(+)
>

David posted a patch to revert 3ba6b689893f, so in theory your patch
should not be needed.

The revert is part of v26.11-rc4.
Can you confirm you do not reproduce this issue with -rc4?

Thanks,
Maxime


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

* RE: [PATCH] net/virtio: fix eventfd enable on device re-init
  2026-11-23 12:51 ` Maxime Coquelin
@ 2026-11-23 13:23   ` Loftus, Ciara
  2026-11-23 14:09     ` Maxime Coquelin
  0 siblings, 1 reply; 4+ messages in thread
From: Loftus, Ciara @ 2026-11-23 13:23 UTC (permalink / raw)
  To: Maxime Coquelin; +Cc: dev@dpdk.org, stable@dpdk.org

> Subject: Re: [PATCH] net/virtio: fix eventfd enable on device re-init
> 
> Hello Ciara,
> 
> On Mon, Nov 23, 2026 at 11:25 AM Ciara Loftus <ciara.loftus@intel.com>
> wrote:
> >
> > 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(+)
> >
> 
> David posted a patch to revert 3ba6b689893f, so in theory your patch
> should not be needed.

Apologies, I missed that.

> 
> The revert is part of v26.11-rc4.
> Can you confirm you do not reproduce this issue with -rc4?

Confirmed, I don't see the configure failure with rc4.

> 
> Thanks,
> Maxime


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

* Re: [PATCH] net/virtio: fix eventfd enable on device re-init
  2026-11-23 13:23   ` Loftus, Ciara
@ 2026-11-23 14:09     ` Maxime Coquelin
  0 siblings, 0 replies; 4+ messages in thread
From: Maxime Coquelin @ 2026-11-23 14:09 UTC (permalink / raw)
  To: Loftus, Ciara; +Cc: dev@dpdk.org, stable@dpdk.org

On Mon, Nov 23, 2026 at 2:24 PM Loftus, Ciara <ciara.loftus@intel.com> wrote:
>
> > Subject: Re: [PATCH] net/virtio: fix eventfd enable on device re-init
> >
> > Hello Ciara,
> >
> > On Mon, Nov 23, 2026 at 11:25 AM Ciara Loftus <ciara.loftus@intel.com>
> > wrote:
> > >
> > > 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(+)
> > >
> >
> > David posted a patch to revert 3ba6b689893f, so in theory your patch
> > should not be needed.
>
> Apologies, I missed that.

No apologies needed!

> >
> > The revert is part of v26.11-rc4.
> > Can you confirm you do not reproduce this issue with -rc4?
>
> Confirmed, I don't see the configure failure with rc4.

Thanks for confirming,
Maxime

> >
> > Thanks,
> > Maxime
>


^ permalink raw reply	[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