* [dpdk-dev] [PATCH] interrupts: do not resize event list for non MSIX
@ 2021-10-29 7:38 David Marchand
2021-10-29 9:38 ` [dpdk-dev] [EXT] " Harman Kalra
0 siblings, 1 reply; 3+ messages in thread
From: David Marchand @ 2021-10-29 7:38 UTC (permalink / raw)
To: dev; +Cc: Anatoly Burakov, Dmitry Kozlyuk, Harman Kalra
Resizing event list only makes sense in MSIX case.
Besides, event list has always been RTE_MAX_RXTX_INTR_VEC_ID large.
Let's restore this assumption for code that might rely on this property
and only enlarge the event list when necessary.
Bugzilla ID: 843, 865
Fixes: 8cb5d08db940 ("interrupts: extend event list")
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
drivers/bus/pci/linux/pci_vfio.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c
index f622e7f8e6..edcee92556 100644
--- a/drivers/bus/pci/linux/pci_vfio.c
+++ b/drivers/bus/pci/linux/pci_vfio.c
@@ -266,12 +266,6 @@ pci_vfio_setup_interrupts(struct rte_pci_device *dev, int vfio_dev_fd)
return -1;
}
- /* Reallocate the efds and elist fields of intr_handle based
- * on PCI device MSIX size.
- */
- if (rte_intr_event_list_update(dev->intr_handle, irq.count))
- return -1;
-
/* if this vector cannot be used with eventfd, fail if we explicitly
* specified interrupt type, otherwise continue */
if ((irq.flags & VFIO_IRQ_INFO_EVENTFD) == 0) {
@@ -283,6 +277,14 @@ pci_vfio_setup_interrupts(struct rte_pci_device *dev, int vfio_dev_fd)
continue;
}
+ /* Reallocate the efds and elist fields of intr_handle based
+ * on PCI device MSIX size.
+ */
+ if (i == VFIO_PCI_MSIX_IRQ_INDEX &&
+ (uint32_t)rte_intr_nb_intr_get(dev->intr_handle) < irq.count &&
+ rte_intr_event_list_update(dev->intr_handle, irq.count))
+ return -1;
+
/* set up an eventfd for interrupts */
fd = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC);
if (fd < 0) {
--
2.23.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [EXT] [PATCH] interrupts: do not resize event list for non MSIX
2021-10-29 7:38 [dpdk-dev] [PATCH] interrupts: do not resize event list for non MSIX David Marchand
@ 2021-10-29 9:38 ` Harman Kalra
2021-10-29 12:43 ` David Marchand
0 siblings, 1 reply; 3+ messages in thread
From: Harman Kalra @ 2021-10-29 9:38 UTC (permalink / raw)
To: David Marchand, dev; +Cc: Anatoly Burakov, Dmitry Kozlyuk
> -----Original Message-----
> From: David Marchand <david.marchand@redhat.com>
> Sent: Friday, October 29, 2021 1:08 PM
> To: dev@dpdk.org
> Cc: Anatoly Burakov <anatoly.burakov@intel.com>; Dmitry Kozlyuk
> <dmitry.kozliuk@gmail.com>; Harman Kalra <hkalra@marvell.com>
> Subject: [EXT] [PATCH] interrupts: do not resize event list for non MSIX
>
> External Email
>
> ----------------------------------------------------------------------
> Resizing event list only makes sense in MSIX case.
>
> Besides, event list has always been RTE_MAX_RXTX_INTR_VEC_ID large.
> Let's restore this assumption for code that might rely on this property and
> only enlarge the event list when necessary.
>
> Bugzilla ID: 843, 865
> Fixes: 8cb5d08db940 ("interrupts: extend event list")
>
Thanks David for fixing this.
Acked-by: Harman Kalra <hkalra@marvell.com>
Thanks
Harman
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
> drivers/bus/pci/linux/pci_vfio.c | 14 ++++++++------
> 1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c
> index f622e7f8e6..edcee92556 100644
> --- a/drivers/bus/pci/linux/pci_vfio.c
> +++ b/drivers/bus/pci/linux/pci_vfio.c
> @@ -266,12 +266,6 @@ pci_vfio_setup_interrupts(struct rte_pci_device
> *dev, int vfio_dev_fd)
> return -1;
> }
>
> - /* Reallocate the efds and elist fields of intr_handle based
> - * on PCI device MSIX size.
> - */
> - if (rte_intr_event_list_update(dev->intr_handle, irq.count))
> - return -1;
> -
> /* if this vector cannot be used with eventfd, fail if we
> explicitly
> * specified interrupt type, otherwise continue */
> if ((irq.flags & VFIO_IRQ_INFO_EVENTFD) == 0) { @@ -283,6
> +277,14 @@ pci_vfio_setup_interrupts(struct rte_pci_device *dev, int
> vfio_dev_fd)
> continue;
> }
>
> + /* Reallocate the efds and elist fields of intr_handle based
> + * on PCI device MSIX size.
> + */
> + if (i == VFIO_PCI_MSIX_IRQ_INDEX &&
> + (uint32_t)rte_intr_nb_intr_get(dev-
> >intr_handle) < irq.count &&
> + rte_intr_event_list_update(dev->intr_handle,
> irq.count))
> + return -1;
> +
> /* set up an eventfd for interrupts */
> fd = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC);
> if (fd < 0) {
> --
> 2.23.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [EXT] [PATCH] interrupts: do not resize event list for non MSIX
2021-10-29 9:38 ` [dpdk-dev] [EXT] " Harman Kalra
@ 2021-10-29 12:43 ` David Marchand
0 siblings, 0 replies; 3+ messages in thread
From: David Marchand @ 2021-10-29 12:43 UTC (permalink / raw)
To: Harman Kalra; +Cc: dev, Anatoly Burakov, Dmitry Kozlyuk
On Fri, Oct 29, 2021 at 11:38 AM Harman Kalra <hkalra@marvell.com> wrote:
> > Resizing event list only makes sense in MSIX case.
> >
> > Besides, event list has always been RTE_MAX_RXTX_INTR_VEC_ID large.
> > Let's restore this assumption for code that might rely on this property and
> > only enlarge the event list when necessary.
> >
> > Bugzilla ID: 843, 865
> > Fixes: 8cb5d08db940 ("interrupts: extend event list")
> >
> > Signed-off-by: David Marchand <david.marchand@redhat.com>
> Acked-by: Harman Kalra <hkalra@marvell.com>
Applied, thanks.
--
David Marchand
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-10-29 12:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-29 7:38 [dpdk-dev] [PATCH] interrupts: do not resize event list for non MSIX David Marchand
2021-10-29 9:38 ` [dpdk-dev] [EXT] " Harman Kalra
2021-10-29 12:43 ` David Marchand
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).