[dpdk-dev] [PATCH v8 09/25] vfio: check PCI dependency from within PCI code

Gaetan Rivet gaetan.rivet at 6wind.com
Thu Oct 26 12:05:54 CEST 2017


PCI sometimes requires vfio to be enabled.
Move the check from EAL init to PCI bus scan.

Signed-off-by: Gaetan Rivet <gaetan.rivet at 6wind.com>
---
 lib/librte_eal/linuxapp/eal/eal.c     | 5 -----
 lib/librte_eal/linuxapp/eal/eal_pci.c | 5 +++++
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c
index bee3bbe..91c3712 100644
--- a/lib/librte_eal/linuxapp/eal/eal.c
+++ b/lib/librte_eal/linuxapp/eal/eal.c
@@ -715,11 +715,6 @@ static int rte_eal_vfio_setup(void)
 		return -1;
 	vfio_enabled = vfio_is_enabled("vfio");
 
-	if (!internal_config.no_pci) {
-		if (!pci_vfio_is_enabled())
-			RTE_LOG(DEBUG, EAL, "VFIO PCI modules not loaded\n");
-	}
-
 	if (vfio_enabled) {
 
 		/* if we are primary process, create a thread to communicate with
diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c
index 8682ee6..dc65852 100644
--- a/lib/librte_eal/linuxapp/eal/eal_pci.c
+++ b/lib/librte_eal/linuxapp/eal/eal_pci.c
@@ -460,6 +460,11 @@ rte_pci_scan(void)
 	if (internal_config.no_pci)
 		return 0;
 
+#ifdef VFIO_PRESENT
+	if (!pci_vfio_is_enabled())
+		RTE_LOG(DEBUG, EAL, "VFIO PCI modules not loaded\n");
+#endif
+
 	dir = opendir(pci_get_sysfs_path());
 	if (dir == NULL) {
 		RTE_LOG(ERR, EAL, "%s(): opendir failed: %s\n",
-- 
2.1.4



More information about the dev mailing list