vfio: check PCI dependency in PCI scan
authorGaetan Rivet <gaetan.rivet@6wind.com>
Thu, 26 Oct 2017 10:05:54 +0000 (12:05 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 26 Oct 2017 21:17:31 +0000 (23:17 +0200)
PCI sometimes requires vfio to be enabled.
Move the check from EAL init to PCI bus scan.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
lib/librte_eal/linuxapp/eal/eal.c
lib/librte_eal/linuxapp/eal/eal_pci.c

index bee3bbe..91c3712 100644 (file)
@@ -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
index 8682ee6..dc65852 100644 (file)
@@ -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",