From: Gaetan Rivet Date: Thu, 26 Oct 2017 10:05:54 +0000 (+0200) Subject: vfio: check PCI dependency in PCI scan X-Git-Tag: spdx-start~1069 X-Git-Url: http://git.droids-corp.org/?p=dpdk.git;a=commitdiff_plain;h=deff7fee9170efc03152e69ddec62142b47c6e4f vfio: check PCI dependency in PCI scan PCI sometimes requires vfio to be enabled. Move the check from EAL init to PCI bus scan. Signed-off-by: Gaetan Rivet --- diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c index bee3bbee6e..91c3712bfc 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 8682ee61ba..dc658527c9 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",