VFIO may be used by buses other than PCI. This patch enables
the VFIO on the basis of vfio root presence.
Since vfio_enable should be called only once, pci_vfio_enable
is also removed.
A debug print is added in case vfio_pci module is not present.
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
{
int vfio_enabled = 0;
+ if (vfio_enable("vfio"))
+ return -1;
+ vfio_enabled = vfio_is_enabled("vfio");
+
if (!internal_config.no_pci) {
- pci_vfio_enable();
- vfio_enabled |= pci_vfio_is_enabled();
+ if (!pci_vfio_is_enabled())
+ RTE_LOG(DEBUG, EAL, "VFIO PCI modules not loaded\n");
}
if (vfio_enabled) {
return -1;
}
-int
-pci_vfio_enable(void)
-{
- return vfio_enable("vfio_pci");
-}
-
int
pci_vfio_is_enabled(void)
{
/* inform the user that we are probing for VFIO */
RTE_LOG(INFO, EAL, "Probing VFIO support...\n");
- /* check if vfio-pci module is loaded */
+ /* check if vfio module is loaded */
vfio_available = rte_eal_check_module(modname);
/* return error directly */
int vfio_enable(const char *modname);
int vfio_is_enabled(const char *modname);
-int pci_vfio_enable(void);
int pci_vfio_is_enabled(void);
int vfio_mp_sync_setup(void);