DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: thomas@monjalon.net, maxime.coquelin@redhat.com,
	anatoly.burakov@intel.com,
	Bruce Richardson <bruce.richardson@intel.com>,
	Ajit Khaparde <ajit.khaparde@broadcom.com>,
	Vikas Gupta <vikas.gupta@broadcom.com>,
	Tyler Retzlaff <roretzla@linux.microsoft.com>
Subject: [RFC v2 3/9] vfio: assume VFIO is always and only present on Linux
Date: Wed,  3 Sep 2025 17:17:53 +0200	[thread overview]
Message-ID: <20250903151800.1965006-4-david.marchand@redhat.com> (raw)
In-Reply-To: <20250903151800.1965006-1-david.marchand@redhat.com>

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@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


  parent reply	other threads:[~2025-09-03 15:18 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-03  7:28 [RFC 0/8] Cleanup VFIO API and import Linux uAPI header David Marchand
2025-09-03  7:28 ` [RFC 1/8] vfio: remove confusing check on VFIO presence David Marchand
2025-09-03  9:38   ` Xu, Rosen
2025-09-03  7:28 ` [RFC 2/8] vfio: assume VFIO is always and only present on Linux David Marchand
2025-09-03  7:28 ` [RFC 3/8] vfio: remove public wrappers David Marchand
2025-09-03  7:28 ` [RFC 4/8] eal/linux: remove more internal VFIO macros David Marchand
2025-09-03  7:28 ` [RFC 5/8] eal/linux: remove internal VFIO wrappers for old Linux David Marchand
2025-09-03  7:28 ` [RFC 6/8] vfio: stop including Linux kernel header in public and driver API David Marchand
2025-09-03  9:38   ` Xu, Rosen
2025-09-03  7:28 ` [RFC 7/8] uapi: import VFIO header David Marchand
2025-09-03  7:28 ` [RFC 8/8] vfio: use imported uAPI header David Marchand
2025-09-03  9:38   ` Xu, Rosen
2025-09-03  7:50 ` [RFC 0/8] Cleanup VFIO API and import Linux " David Marchand
2025-09-03  9:29 ` Burakov, Anatoly
2025-09-03  9:52   ` David Marchand
2025-09-03 14:25     ` Burakov, Anatoly
2025-09-03 15:13 ` [RFC v2 0/9] " David Marchand
2025-09-03 15:13   ` [RFC v2 1/9] drivers: remove unneeded VFIO header inclusion David Marchand
2025-09-03 15:13   ` [RFC v2 2/9] vfio: remove confusing check on VFIO presence David Marchand
2025-09-03 15:13   ` [RFC v2 3/9] vfio: assume VFIO is always and only present on Linux David Marchand
2025-09-03 15:13   ` [RFC v2 4/9] vfio: remove public wrappers David Marchand
2025-09-03 15:13   ` [RFC v2 5/9] eal/linux: remove more internal VFIO macros David Marchand
2025-09-03 15:13   ` [RFC v2 6/9] eal/linux: remove internal VFIO wrappers for old Linux David Marchand
2025-09-03 15:22   ` [RFC v2 0/9] Cleanup VFIO API and import Linux uAPI header David Marchand
2025-09-03 15:17 ` David Marchand
2025-09-03 15:17   ` [RFC v2 1/9] drivers: remove unneeded VFIO header inclusion David Marchand
2025-09-03 15:17   ` [RFC v2 2/9] vfio: remove confusing check on VFIO presence David Marchand
2025-09-03 15:17   ` David Marchand [this message]
2025-09-03 15:17   ` [RFC v2 4/9] vfio: remove public wrappers David Marchand
2025-09-03 15:17   ` [RFC v2 5/9] eal/linux: remove more internal VFIO macros David Marchand
2025-09-03 15:17   ` [RFC v2 6/9] eal/linux: remove internal VFIO wrappers for old Linux David Marchand
2025-09-03 15:17   ` [RFC v2 7/9] vfio: stop including Linux kernel header in public and driver API David Marchand
2025-09-03 15:17   ` [RFC v2 8/9] uapi: import VFIO header David Marchand
2025-09-03 15:17   ` [RFC v2 9/9] vfio: use imported uAPI header David Marchand
2025-09-04  7:08   ` [RFC v2 0/9] Cleanup VFIO API and import Linux " David Marchand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250903151800.1965006-4-david.marchand@redhat.com \
    --to=david.marchand@redhat.com \
    --cc=ajit.khaparde@broadcom.com \
    --cc=anatoly.burakov@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=maxime.coquelin@redhat.com \
    --cc=roretzla@linux.microsoft.com \
    --cc=thomas@monjalon.net \
    --cc=vikas.gupta@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).