[RFC v2 3/9] vfio: assume VFIO is always and only present on Linux

David Marchand david.marchand at redhat.com
Wed Sep 3 17:17:53 CEST 2025


RTE_EAL_VFIO is directly mapped to is_linux in meson.
Replace this intermediate build knob with RTE_EXEC_ENV_LINUX.
This is an intermediate state before importing the VFIO uapi header.

Note: crypto/bcmfs was functional only for OSes supporting VFIO iow
Linux. Stop compiling it on other OSes.

Signed-off-by: David Marchand <david.marchand at redhat.com>
---
 config/meson.build                |  3 ---
 drivers/crypto/bcmfs/bcmfs_vfio.c | 18 ++----------------
 drivers/crypto/bcmfs/meson.build  |  4 ++--
 lib/eal/include/rte_vfio.h        |  6 +++---
 4 files changed, 7 insertions(+), 24 deletions(-)

diff --git a/config/meson.build b/config/meson.build
index 55497f0bf5..b5e894de3c 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -459,9 +459,6 @@ dpdk_conf.set_quoted('RTE_EAL_PMD_PATH', eal_pmd_path)
 install_headers(['rte_config.h'],
         subdir: get_option('include_subdir_arch'))
 
-# enable VFIO only if it is linux OS
-dpdk_conf.set('RTE_EAL_VFIO', is_linux)
-
 # specify -D_GNU_SOURCE unconditionally
 add_project_arguments('-D_GNU_SOURCE', language: 'c')
 
diff --git a/drivers/crypto/bcmfs/bcmfs_vfio.c b/drivers/crypto/bcmfs/bcmfs_vfio.c
index 8d6ea16544..9138f96eb0 100644
--- a/drivers/crypto/bcmfs/bcmfs_vfio.c
+++ b/drivers/crypto/bcmfs/bcmfs_vfio.c
@@ -7,14 +7,12 @@
 #include <sys/mman.h>
 #include <sys/ioctl.h>
 
+#include <rte_vfio.h>
+
 #include "bcmfs_device.h"
 #include "bcmfs_logs.h"
 #include "bcmfs_vfio.h"
 
-#ifdef RTE_EAL_VFIO
-
-#include <rte_vfio.h>
-
 static int
 vfio_map_dev_obj(const char *path, const char *dev_obj,
 		 uint32_t *size, void **addr, int *dev_fd)
@@ -94,15 +92,3 @@ bcmfs_release_vfio(struct bcmfs_device *dev)
 		return;
 	}
 }
-#else /* ! RTE_EAL_VFIO */
-int
-bcmfs_attach_vfio(struct bcmfs_device *dev __rte_unused)
-{
-	return -1;
-}
-
-void
-bcmfs_release_vfio(struct bcmfs_device *dev __rte_unused)
-{
-}
-#endif /* RTE_EAL_VFIO */
diff --git a/drivers/crypto/bcmfs/meson.build b/drivers/crypto/bcmfs/meson.build
index 5842f83a3b..925dde2ee2 100644
--- a/drivers/crypto/bcmfs/meson.build
+++ b/drivers/crypto/bcmfs/meson.build
@@ -3,9 +3,9 @@
 # All rights reserved.
 #
 
-if is_windows
+if not is_linux
     build = false
-    reason = 'not supported on Windows'
+    reason = 'only supported on Linux'
     subdir_done()
 endif
 
diff --git a/lib/eal/include/rte_vfio.h b/lib/eal/include/rte_vfio.h
index 594d504c56..035b727dd0 100644
--- a/lib/eal/include/rte_vfio.h
+++ b/lib/eal/include/rte_vfio.h
@@ -19,7 +19,7 @@
 extern "C" {
 #endif
 
-#ifdef RTE_EAL_VFIO
+#ifdef RTE_EXEC_ENV_LINUX
 
 #include <linux/version.h>
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0)
@@ -94,12 +94,12 @@ struct vfio_device_feature_bus_master {
 };
 #endif
 
-#else /* ! RTE_EAL_VFIO */
+#else /* ! RTE_EXEC_ENV_LINUX */
 
 /* we don't need an actual definition, only pointer is used */
 struct vfio_device_info;
 
-#endif /* RTE_EAL_VFIO */
+#endif /* RTE_EXEC_ENV_LINUX */
 
 #define RTE_VFIO_DEFAULT_CONTAINER_FD (-1)
 
-- 
2.51.0



More information about the dev mailing list