[dpdk-dev] [PATCH v1] examples/vhost: fix ioat dependency issue
Cheng Jiang
Cheng1.jiang at intel.com
Wed Nov 11 12:19:57 CET 2020
Fix vhost-switch compiling issue when ioat dependency is missing.
Change 'RTE_x86' check into 'RTE_RAW_IOAT' check in meson build file
and update Makefile.
Signed-off-by: Cheng Jiang <Cheng1.jiang at intel.com>
---
examples/vhost/Makefile | 5 +++++
examples/vhost/ioat.h | 2 +-
examples/vhost/meson.build | 2 +-
3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/examples/vhost/Makefile b/examples/vhost/Makefile
index cec59d0e0f..505e443217 100644
--- a/examples/vhost/Makefile
+++ b/examples/vhost/Makefile
@@ -5,7 +5,12 @@
APP = vhost-switch
# all source are stored in SRCS-y
+IOAT_PATH = $(shell pkg-config --cflags-only-I libdpdk | sed -e "s/^..//")/rte_ioat_rawdev.h
+ifeq ($(IOAT_PATH), $(wildcard $(IOAT_PATH)))
+SRCS-y := main.c virtio_net.c ioat.c
+else
SRCS-y := main.c virtio_net.c
+endif
# Build using pkg-config variables if possible
ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
diff --git a/examples/vhost/ioat.h b/examples/vhost/ioat.h
index 9664fcc3ac..d6d0f7c18a 100644
--- a/examples/vhost/ioat.h
+++ b/examples/vhost/ioat.h
@@ -24,7 +24,7 @@ struct dma_for_vhost {
uint16_t nr;
};
-#ifdef RTE_ARCH_X86
+#ifdef RTE_RAW_IOAT
int open_ioat(const char *value);
#else
static int open_ioat(const char *value __rte_unused)
diff --git a/examples/vhost/meson.build b/examples/vhost/meson.build
index 24f1f71313..d5388a795a 100644
--- a/examples/vhost/meson.build
+++ b/examples/vhost/meson.build
@@ -15,7 +15,7 @@ sources = files(
'main.c', 'virtio_net.c'
)
-if dpdk_conf.has('RTE_ARCH_X86')
+if dpdk_conf.has('RTE_RAW_IOAT')
deps += 'raw_ioat'
sources += files('ioat.c')
endif
--
2.29.2
More information about the dev
mailing list