Now that the interrupt handle contains a -1 FD by default, the logic in
this code is wrong (yet, checking for a 0 FD was theoretically broken
even before).

The first invocation for a given PCI device will always have a FD < 0,
since no code allocated a interrupt handle in the life of this PCI
device.

Bugzilla ID: 2067
Fixes: 63a0dbf661e5 ("interrupts: mark FDs invalid on allocation")

Signed-off-by: David Marchand <[email protected]>
---
 drivers/bus/pci/linux/pci_vfio.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c
index fb35bc1d49..94ad31daed 100644
--- a/drivers/bus/pci/linux/pci_vfio.c
+++ b/drivers/bus/pci/linux/pci_vfio.c
@@ -1189,8 +1189,6 @@ pci_vfio_ioport_map(struct rte_pci_device *dev, int bar,
 
                vfio_dev_fd = rte_intr_dev_fd_get(dev->intr_handle);
                if (vfio_dev_fd < 0) {
-                       return -1;
-               } else if (vfio_dev_fd == 0) {
                        if (dev_vfio_setup_device(rte_pci_get_sysfs_path(), 
pci_addr,
                                        &vfio_dev_fd) != 0)
                                return -1;
-- 
2.54.0

Reply via email to