DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] bus/pci: fix automatic interrupt type selection
@ 2025-06-20 11:47 priikone
  2025-06-27 16:00 ` Thomas Monjalon
  0 siblings, 1 reply; 4+ messages in thread
From: priikone @ 2025-06-20 11:47 UTC (permalink / raw)
  To: dev

Check if kernel returns 0 interrupt vectors and try another interrupt
type in that case.  Failing to check the vector count can select an
interrupt type that's unusable.

Signed-off-by: Pekka Riikonen <priikone@iki.fi>
---
  drivers/bus/pci/linux/pci_vfio.c | 4 ++++
  1 file changed, 4 insertions(+)

diff --git a/drivers/bus/pci/linux/pci_vfio.c 
b/drivers/bus/pci/linux/pci_vfio.c
index 5317170231..02e7d7e40b 100644
--- a/drivers/bus/pci/linux/pci_vfio.c
+++ b/drivers/bus/pci/linux/pci_vfio.c
@@ -237,6 +237,10 @@ pci_vfio_setup_interrupts(struct rte_pci_device 
*dev, int vfio_dev_fd)
                                 continue;
                 }

+               /* If no vectors, try another one */
+               if (irq.count == 0)
+                       continue;
+
                 /* Reallocate the efds and elist fields of intr_handle 
based
                  * on PCI device MSIX size.
                  */
--
2.34.1

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

* Re: [PATCH] bus/pci: fix automatic interrupt type selection
  2025-06-20 11:47 [PATCH] bus/pci: fix automatic interrupt type selection priikone
@ 2025-06-27 16:00 ` Thomas Monjalon
  2025-06-27 19:33   ` Pekka Riikonen
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Monjalon @ 2025-06-27 16:00 UTC (permalink / raw)
  To: priikone; +Cc: dev

20/06/2025 13:47, priikone@iki.fi:
> Check if kernel returns 0 interrupt vectors and try another interrupt
> type in that case.  Failing to check the vector count can select an
> interrupt type that's unusable.
> 
> Signed-off-by: Pekka Riikonen <priikone@iki.fi>

Please could you be explicit about the use case you are trying to fix?



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

* Re: [PATCH] bus/pci: fix automatic interrupt type selection
  2025-06-27 16:00 ` Thomas Monjalon
@ 2025-06-27 19:33   ` Pekka Riikonen
  2025-06-27 20:08     ` Thomas Monjalon
  0 siblings, 1 reply; 4+ messages in thread
From: Pekka Riikonen @ 2025-06-27 19:33 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev

On 2025-06-27 19:00, Thomas Monjalon wrote:
> 20/06/2025 13:47, priikone@iki.fi:
>> Check if kernel returns 0 interrupt vectors and try another interrupt
>> type in that case.  Failing to check the vector count can select an
>> interrupt type that's unusable.
>> 
>> Signed-off-by: Pekka Riikonen <priikone@iki.fi>
> 
> Please could you be explicit about the use case you are trying to fix?

This particular case was with e1000em that only supported INTx, but the 
function selected MSI-X simply because it's the first one attempted, 
even though it got 0 vectors.  Enabling interrupts then failed.  If the 
function had checked the vector count it would have correctly selected 
INTx.  Now, my setup might have been quite old but it doesn't change 
that it selected wrong interrupt type.

Pekka

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

* Re: [PATCH] bus/pci: fix automatic interrupt type selection
  2025-06-27 19:33   ` Pekka Riikonen
@ 2025-06-27 20:08     ` Thomas Monjalon
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2025-06-27 20:08 UTC (permalink / raw)
  To: Pekka Riikonen; +Cc: dev, Chenbo Xia, Nipun Gupta

27/06/2025 21:33, Pekka Riikonen:
> On 2025-06-27 19:00, Thomas Monjalon wrote:
> > 20/06/2025 13:47, priikone@iki.fi:
> >> Check if kernel returns 0 interrupt vectors and try another interrupt
> >> type in that case.  Failing to check the vector count can select an
> >> interrupt type that's unusable.
> >> 
> >> Signed-off-by: Pekka Riikonen <priikone@iki.fi>
> > 
> > Please could you be explicit about the use case you are trying to fix?
> 
> This particular case was with e1000em that only supported INTx, but the 
> function selected MSI-X simply because it's the first one attempted, 
> even though it got 0 vectors.  Enabling interrupts then failed.  If the 
> function had checked the vector count it would have correctly selected 
> INTx.  Now, my setup might have been quite old but it doesn't change 
> that it selected wrong interrupt type.

OK thank you, it helps for the review, and could be added to the commit log.

Adding PCI bus maintainers for review.



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

end of thread, other threads:[~2025-06-27 20:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-20 11:47 [PATCH] bus/pci: fix automatic interrupt type selection priikone
2025-06-27 16:00 ` Thomas Monjalon
2025-06-27 19:33   ` Pekka Riikonen
2025-06-27 20:08     ` Thomas Monjalon

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).