[PATCH 3/4] vhost: use imported VDUSE uAPI header
Maxime Coquelin
maxime.coquelin at redhat.com
Wed Apr 16 14:34:25 CEST 2025
This patch makes use of the imported VDUSE uAPI header, and
remove VDUSE build dependency on the presence of the VDUSE
header on the system.
Signed-off-by: Maxime Coquelin <maxime.coquelin at redhat.com>
---
lib/vhost/meson.build | 5 +----
lib/vhost/vduse.c | 2 +-
lib/vhost/vduse.h | 22 ----------------------
3 files changed, 2 insertions(+), 27 deletions(-)
diff --git a/lib/vhost/meson.build b/lib/vhost/meson.build
index 33773b6d21..9c6325aa0e 100644
--- a/lib/vhost/meson.build
+++ b/lib/vhost/meson.build
@@ -33,16 +33,13 @@ sources = files(
'iotlb.c',
'socket.c',
'vdpa.c',
+ 'vduse.c',
'vhost.c',
'vhost_crypto.c',
'vhost_user.c',
'virtio_net.c',
'virtio_net_ctrl.c',
)
-if cc.has_header('linux/vduse.h')
- sources += files('vduse.c')
- cflags += '-DVHOST_HAS_VDUSE'
-endif
headers = files(
'rte_vdpa.h',
'rte_vhost.h',
diff --git a/lib/vhost/vduse.c b/lib/vhost/vduse.c
index 801674be42..a2a7d73388 100644
--- a/lib/vhost/vduse.c
+++ b/lib/vhost/vduse.c
@@ -8,7 +8,7 @@
#include <fcntl.h>
-#include <linux/vduse.h>
+#include <uapi/linux/vduse.h>
#include <linux/virtio_net.h>
#include <sys/ioctl.h>
diff --git a/lib/vhost/vduse.h b/lib/vhost/vduse.h
index 0d8f3f1205..47ca97a064 100644
--- a/lib/vhost/vduse.h
+++ b/lib/vhost/vduse.h
@@ -9,29 +9,7 @@
#define VDUSE_NET_SUPPORTED_FEATURES VIRTIO_NET_SUPPORTED_FEATURES
-#ifdef VHOST_HAS_VDUSE
-
int vduse_device_create(const char *path, bool compliant_ol_flags);
int vduse_device_destroy(const char *path);
-#else
-
-static inline int
-vduse_device_create(const char *path, bool compliant_ol_flags)
-{
- RTE_SET_USED(compliant_ol_flags);
-
- VHOST_CONFIG_LOG(path, ERR, "VDUSE support disabled at build time");
- return -1;
-}
-
-static inline int
-vduse_device_destroy(const char *path)
-{
- VHOST_CONFIG_LOG(path, ERR, "VDUSE support disabled at build time");
- return -1;
-}
-
-#endif /* VHOST_HAS_VDUSE */
-
#endif /* _VDUSE_H */
--
2.49.0
More information about the dev
mailing list