[dpdk-dev,v3] eal: enable vfio independent of PCI bus
Checks
Commit Message
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>
---
v3: changed the vfio enable for vfio root instead of pci
v2: enabled VFIO, independent of no-pci flag as suggested by Thomas
removed fslmc specific vfio enable
lib/librte_eal/linuxapp/eal/eal.c | 8 ++++++--
lib/librte_eal/linuxapp/eal/eal_pci_vfio.c | 6 ------
lib/librte_eal/linuxapp/eal/eal_vfio.c | 2 +-
lib/librte_eal/linuxapp/eal/eal_vfio.h | 1 -
4 files changed, 7 insertions(+), 10 deletions(-)
Comments
On 11-Oct-17 7:42 AM, Hemant Agrawal wrote:
> 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>
23/10/2017 13:47, Burakov, Anatoly:
> On 11-Oct-17 7:42 AM, Hemant Agrawal wrote:
> > 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>
Applied, thanks
@@ -710,9 +710,13 @@ static int rte_eal_vfio_setup(void)
{
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) {
@@ -661,12 +661,6 @@ pci_vfio_ioport_unmap(struct rte_pci_ioport *p)
}
int
-pci_vfio_enable(void)
-{
- return vfio_enable("vfio_pci");
-}
-
-int
pci_vfio_is_enabled(void)
{
return vfio_is_enabled("vfio_pci");
@@ -489,7 +489,7 @@ vfio_enable(const char *modname)
/* 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 */
@@ -207,7 +207,6 @@ int vfio_release_device(const char *sysfs_base, const char *dev_addr, int fd);
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);