[PATCH v18 08/29] vfio: remove modname parameter from init
Anatoly Burakov
anatoly.burakov at intel.com
Thu Sep 24 18:13:15 CEST 2026
All VFIO initialization always happens with "vfio" module, and now that the
API is not public, having a way to override the module name seems redundant
as there is not going to be a use case that calls into `rte_vfio_enable`
that isn't coming from EAL init. So, remove the parameter, and hardcode
the modname to "vfio" instead.
Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>
---
drivers/bus/pci/linux/pci_vfio.c | 2 +-
lib/eal/freebsd/eal.c | 2 +-
lib/eal/include/rte_vfio.h | 7 ++-----
lib/eal/linux/eal.c | 2 +-
lib/eal/linux/eal_vfio.c | 4 ++--
5 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c
index bc5c5c24990..f3791cce982 100644
--- a/drivers/bus/pci/linux/pci_vfio.c
+++ b/drivers/bus/pci/linux/pci_vfio.c
@@ -1303,7 +1303,7 @@ pci_vfio_is_enabled(void)
int status = rte_vfio_is_enabled("vfio_pci");
if (!status) {
- rte_vfio_enable("vfio");
+ rte_vfio_enable();
status = rte_vfio_is_enabled("vfio_pci");
}
return status;
diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c
index 991ca450640..5628d60d589 100644
--- a/lib/eal/freebsd/eal.c
+++ b/lib/eal/freebsd/eal.c
@@ -839,7 +839,7 @@ int rte_vfio_release_device(__rte_unused const char *sysfs_base,
}
RTE_EXPORT_INTERNAL_SYMBOL(rte_vfio_enable)
-int rte_vfio_enable(__rte_unused const char *modname)
+int rte_vfio_enable(void)
{
rte_errno = ENOTSUP;
return -1;
diff --git a/lib/eal/include/rte_vfio.h b/lib/eal/include/rte_vfio.h
index e76181c83cc..b53ce56a8dc 100644
--- a/lib/eal/include/rte_vfio.h
+++ b/lib/eal/include/rte_vfio.h
@@ -94,20 +94,17 @@ int rte_vfio_release_device(const char *sysfs_base, const char *dev_addr, int fd
/**
* @internal
- * Enable a VFIO-related kmod.
+ * Initialize VFIO.
*
* This function is only relevant to linux and will return
* an error on BSD.
*
- * @param modname
- * kernel module name.
- *
* @return
* 0 on success.
* <0 on failure.
*/
__rte_internal
-int rte_vfio_enable(const char *modname);
+int rte_vfio_enable(void);
/**
* @internal
diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
index 1d0894e7eab..3f92cc32ebd 100644
--- a/lib/eal/linux/eal.c
+++ b/lib/eal/linux/eal.c
@@ -769,7 +769,7 @@ rte_eal_init(int argc, char **argv)
#endif
}
- if (rte_vfio_enable("vfio")) {
+ if (rte_vfio_enable()) {
rte_eal_init_alert("Cannot init VFIO");
rte_errno = EAGAIN;
goto err_out;
diff --git a/lib/eal/linux/eal_vfio.c b/lib/eal/linux/eal_vfio.c
index ce247362662..41bf401dec6 100644
--- a/lib/eal/linux/eal_vfio.c
+++ b/lib/eal/linux/eal_vfio.c
@@ -1159,7 +1159,7 @@ rte_vfio_release_device(const char *sysfs_base, const char *dev_addr,
RTE_EXPORT_INTERNAL_SYMBOL(rte_vfio_enable)
int
-rte_vfio_enable(const char *modname)
+rte_vfio_enable(void)
{
/* initialize group list */
unsigned int i, j;
@@ -1189,7 +1189,7 @@ rte_vfio_enable(const char *modname)
EAL_LOG(DEBUG, "Probing VFIO support...");
/* check if vfio module is loaded */
- vfio_available = vfio_check_module(modname);
+ vfio_available = vfio_check_module("vfio");
/* return error directly */
if (vfio_available == -1) {
--
2.52.0
More information about the dev
mailing list