[v2] bus/pci: fix automatic interrupt type selection

Message ID d612fb276b9c8b173a5e476ca75b0460@iki.fi (mailing list archive)
State New
Delegated to: Thomas Monjalon
Headers
Series [v2] bus/pci: fix automatic interrupt type selection |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/loongarch-compilation warning apply patch failure
ci/Intel-compilation warning apply issues
ci/iol-testing warning apply patch failure
ci/aws-unit-testing fail Unit Testing FAILURE

Commit Message

Pekka Riikonen June 20, 2025, 12:50 p.m. UTC
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(+)

  		 */
  

Patch

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.