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 A00CAA0613 for ; Mon, 23 Sep 2019 07:24:28 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A39E94CE4; Mon, 23 Sep 2019 07:24:27 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 0A6424CA6 for ; Mon, 23 Sep 2019 07:24:25 +0200 (CEST) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Sep 2019 22:24:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,539,1559545200"; d="scan'208";a="388366808" Received: from dpdk-virtio-tbie-2.sh.intel.com (HELO ___) ([10.67.104.73]) by fmsmga005.fm.intel.com with ESMTP; 22 Sep 2019 22:24:23 -0700 Date: Mon, 23 Sep 2019 13:21:36 +0800 From: Tiwei Bie To: Marvin Liu Cc: maxime.coquelin@redhat.com, zhihong.wang@intel.com, dev@dpdk.org Message-ID: <20190923052136.GA32129@___> References: <20190905161421.55981-2-yong.liu@intel.com> <20190919163643.24130-1-yong.liu@intel.com> <20190919163643.24130-3-yong.liu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190919163643.24130-3-yong.liu@intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH v2 02/16] vhost: unify unroll pragma parameter 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 Fri, Sep 20, 2019 at 12:36:29AM +0800, Marvin Liu wrote: > Add macro for unifying Clang/ICC/GCC unroll pragma format. Burst > functions were contained of several small loops which optimized by > compiler’s loop unrolling pragma. > > Signed-off-by: Marvin Liu > > diff --git a/lib/librte_vhost/Makefile b/lib/librte_vhost/Makefile > index 8623e91c0..30839a001 100644 > --- a/lib/librte_vhost/Makefile > +++ b/lib/librte_vhost/Makefile > @@ -16,6 +16,24 @@ CFLAGS += -I vhost_user > CFLAGS += -fno-strict-aliasing > LDLIBS += -lpthread > > +ifeq ($(RTE_TOOLCHAIN), gcc) > +ifeq ($(shell test $(GCC_VERSION) -ge 83 && echo 1), 1) > +CFLAGS += -DSUPPORT_GCC_UNROLL_PRAGMA > +endif > +endif > + > +ifeq ($(RTE_TOOLCHAIN), clang) > +ifeq ($(shell test $(CLANG_MAJOR_VERSION)$(CLANG_MINOR_VERSION) -ge 37 && echo 1), 1) > +CFLAGS += -DSUPPORT_CLANG_UNROLL_PRAGMA > +endif > +endif > + > +ifeq ($(RTE_TOOLCHAIN), icc) > +ifeq ($(shell test $(ICC_MAJOR_VERSION) -ge 16 && echo 1), 1) > +CFLAGS += -DSUPPORT_ICC_UNROLL_PRAGMA > +endif > +endif > + > ifeq ($(CONFIG_RTE_LIBRTE_VHOST_NUMA),y) > LDLIBS += -lnuma > endif You need to add meson support as well. > diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h > index 884befa85..5074226f0 100644 > --- a/lib/librte_vhost/vhost.h > +++ b/lib/librte_vhost/vhost.h > @@ -39,6 +39,24 @@ > > #define VHOST_LOG_CACHE_NR 32 > > +#ifdef SUPPORT_GCC_UNROLL_PRAGMA > +#define PRAGMA_PARAM "GCC unroll 4" The name "PRAGMA_PARAM" is too generic. > +#endif > + > +#ifdef SUPPORT_CLANG_UNROLL_PRAGMA > +#define PRAGMA_PARAM "unroll 4" > +#endif > + > +#ifdef SUPPORT_ICC_UNROLL_PRAGMA > +#define PRAGMA_PARAM "unroll (4)" > +#endif > + > +#ifdef PRAGMA_PARAM > +#define UNROLL_PRAGMA(param) _Pragma(param) > +#else > +#define UNROLL_PRAGMA(param) do {} while(0); > +#endif > + > /** > * Structure contains buffer address, length and descriptor index > * from vring to do scatter RX. > -- > 2.17.1 >