[10/12] eal/pci: Finding a device bound to UIO does not force PA

Message ID 20190530174819.1160221-11-benjamin.walker@intel.com (mailing list archive)
State Superseded, archived
Headers
Series [01/12] eal: Make rte_eal_using_phys_addrs work sooner |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Walker, Benjamin May 30, 2019, 5:48 p.m. UTC
  If a device is found that is bound to the UIO driver,
only force IOVA_PA if there is a driver registered to use it.

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: I8015f11a33ab1b7662bf374d6944eff8d7a74a07
---
 drivers/bus/pci/linux/pci.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
  

Patch

diff --git a/drivers/bus/pci/linux/pci.c b/drivers/bus/pci/linux/pci.c
index 41fd82988..09af66571 100644
--- a/drivers/bus/pci/linux/pci.c
+++ b/drivers/bus/pci/linux/pci.c
@@ -627,7 +627,13 @@  rte_pci_get_iommu_class(void)
 		case RTE_KDRV_UIO_GENERIC:
 		case RTE_KDRV_NIC_UIO:
 			is_bound = true;
-			is_bound_uio = true;
+			FOREACH_DRIVER_ON_PCIBUS(drv) {
+				if (!rte_pci_match(drv, dev))
+					continue;
+
+				is_bound_uio = true;
+				break;
+			}
 			break;
 
 		}