[dpdk-dev] [PATCH v4] examples/vhost: fix ioat dependency issue
Bruce Richardson
bruce.richardson at intel.com
Thu Nov 12 16:01:35 CET 2020
On Thu, Nov 12, 2020 at 01:47:54PM +0000, Cheng Jiang wrote:
> Fix vhost-switch compiling issue when ioat dependency is missing.
> Change 'RTE_x86' check into 'RTE_RAW_IOAT' check in meson build file.
> Use 'RTE_RAW_IOAT' to control conditional compiling in source file.
> Clean some codes.
>
> Fixes: abec60e7115d ("examples/vhost: support vhost async data path")
> Fixes: 3a04ecb21420 ("examples/vhost: add async vhost args parsing")
>
> Signed-off-by: Cheng Jiang <Cheng1.jiang at intel.com>
> ---
> v4:
> * Use macros in ioat.c for conditional compilation instead of changing Makefile.
>
> v3:
> * Added fixes lines in commit log.
>
> v2:
> * Cleaned some codes
> * Changed RTE_RAW_IOAT check method in Makefile
> * Added ioat function definition when RTE_RAW_IOAT is missing
>
> examples/vhost/Makefile | 2 +-
> examples/vhost/ioat.c | 6 ++++++
> examples/vhost/ioat.h | 32 +++++++++++++++++++++++++-------
> examples/vhost/main.c | 22 +++++++++++-----------
> examples/vhost/meson.build | 2 +-
> 5 files changed, 44 insertions(+), 20 deletions(-)
>
> diff --git a/examples/vhost/Makefile b/examples/vhost/Makefile
> index cec59d0e0..8c969caaa 100644
> --- a/examples/vhost/Makefile
> +++ b/examples/vhost/Makefile
> @@ -5,7 +5,7 @@
> APP = vhost-switch
>
> # all source are stored in SRCS-y
> -SRCS-y := main.c virtio_net.c
> +SRCS-y := main.c virtio_net.c ioat.c
>
> # Build using pkg-config variables if possible
> ifneq ($(shell pkg-config --exists libdpdk && echo 0),0)
> diff --git a/examples/vhost/ioat.c b/examples/vhost/ioat.c
> index b2c74f653..6f87d7bba 100644
> --- a/examples/vhost/ioat.c
> +++ b/examples/vhost/ioat.c
> @@ -1,13 +1,17 @@
> /* SPDX-License-Identifier: BSD-3-Clause
> * Copyright(c) 2010-2020 Intel Corporation
> */
> +#ifdef RTE_RAW_IOAT
> #include <rte_rawdev.h>
> #include <rte_ioat_rawdev.h>
> +#endif /* RTE_RAW_IOAT */
> #include <sys/uio.h>
>
> #include "ioat.h"
> #include "main.h"
>
> +#ifdef RTE_RAW_IOAT
> +
Minor nit is that we generally include system header files before DPDK
headers. Following that policy, we can move sys/uio.h up to be before the
first #ifdef, and then we can just merge the two #ifdefs together to just
have one at the start and one at the end.
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
More information about the dev
mailing list