From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 45122A09D3; Thu, 12 Nov 2020 16:02:50 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 325135928; Thu, 12 Nov 2020 16:02:48 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 8B0FF56A3 for ; Thu, 12 Nov 2020 16:02:45 +0100 (CET) IronPort-SDR: BwKgaLlCZ29DRTyQ+rpY10uC4JYp4soyYL7PkUNfoZA9AlTJe9igqkecfYUZ2cY7bSB+OFQ1KL 19Jk/Tn3zjKg== X-IronPort-AV: E=McAfee;i="6000,8403,9802"; a="255027570" X-IronPort-AV: E=Sophos;i="5.77,472,1596524400"; d="scan'208";a="255027570" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Nov 2020 07:01:41 -0800 IronPort-SDR: UqztFOHAOoVv0O12FhoJP/yrxfDjQB4Zd63BnTcwngfJMAiglaSdLw/IXVf7vlRpgSF1h+oh6J pCAmN5qC3xBg== X-IronPort-AV: E=Sophos;i="5.77,472,1596524400"; d="scan'208";a="474298778" Received: from bricha3-mobl.ger.corp.intel.com ([10.213.208.146]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 12 Nov 2020 07:01:39 -0800 Date: Thu, 12 Nov 2020 15:01:35 +0000 From: Bruce Richardson To: Cheng Jiang Cc: maxime.coquelin@redhat.com, chenbo.xia@intel.com, dev@dpdk.org, patrick.fu@intel.com, YvonneX.Yang@intel.com, david.marchand@redhat.com, Jiayu.Hu@intel.com Message-ID: <20201112150135.GK1309@bricha3-MOBL.ger.corp.intel.com> References: <20201111111957.46090-1-Cheng1.jiang@intel.com> <20201112134754.96530-1-Cheng1.jiang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201112134754.96530-1-Cheng1.jiang@intel.com> Subject: Re: [dpdk-dev] [PATCH v4] examples/vhost: fix ioat dependency issue X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 > --- > 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 > #include > +#endif /* RTE_RAW_IOAT */ > #include > > #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