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 D2C08A00BE; Tue, 7 Jul 2020 11:44:10 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6B76A1DD2A; Tue, 7 Jul 2020 11:44:10 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 2758D1DCE2 for ; Tue, 7 Jul 2020 11:44:09 +0200 (CEST) IronPort-SDR: vqYlFhY2lnrHdUcYsNYs32h3pXv7CSwssi2rp6WL4axvySe0lUqEctgqj6LQBMLdXMOHAd7Guv 8FIwEX81544Q== X-IronPort-AV: E=McAfee;i="6000,8403,9674"; a="145663919" X-IronPort-AV: E=Sophos;i="5.75,323,1589266800"; d="scan'208";a="145663919" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2020 02:44:08 -0700 IronPort-SDR: U9FaOXpBdiUYzmu/mcXwpqeXVLsDLAV7GqVyrYmUPuTz+CnMvzFe6xHloRqKHZft7BdhvWKQKq VoDEhLAlGpvw== X-IronPort-AV: E=Sophos;i="5.75,323,1589266800"; d="scan'208";a="457042460" Received: from anazaral-mobl.ger.corp.intel.com (HELO bricha3-MOBL.ger.corp.intel.com) ([10.251.82.195]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 07 Jul 2020 02:44:06 -0700 Date: Tue, 7 Jul 2020 10:44:03 +0100 From: Bruce Richardson To: Vladimir Medvedkin Cc: dev@dpdk.org, konstantin.ananyev@intel.com Message-ID: <20200707094403.GA645@bricha3-MOBL.ger.corp.intel.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [dpdk-dev] [PATCH v3 4/8] fib: introduce AVX512 lookup 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 Tue, May 19, 2020 at 01:12:59PM +0100, Vladimir Medvedkin wrote: > Add new lookup implementation for DIR24_8 algorithm using > AVX512 instruction set > > Signed-off-by: Vladimir Medvedkin > --- > lib/librte_fib/Makefile | 14 ++++ > lib/librte_fib/dir24_8.c | 24 ++++++ > lib/librte_fib/dir24_8_avx512.c | 165 ++++++++++++++++++++++++++++++++++++++++ > lib/librte_fib/dir24_8_avx512.h | 24 ++++++ > lib/librte_fib/meson.build | 11 +++ > lib/librte_fib/rte_fib.h | 3 +- > 6 files changed, 240 insertions(+), 1 deletion(-) > create mode 100644 lib/librte_fib/dir24_8_avx512.c > create mode 100644 lib/librte_fib/dir24_8_avx512.h > > diff --git a/lib/librte_fib/meson.build b/lib/librte_fib/meson.build > index 771828f..0963f3c 100644 > --- a/lib/librte_fib/meson.build > +++ b/lib/librte_fib/meson.build > @@ -5,3 +5,14 @@ > sources = files('rte_fib.c', 'rte_fib6.c', 'dir24_8.c', 'trie.c') > headers = files('rte_fib.h', 'rte_fib6.h') > deps += ['rib'] > + > +if dpdk_conf.has('RTE_ARCH_X86') and cc.has_argument('-mavx512f') > + if cc.has_argument('-mavx512dq') > + dir24_8_avx512_tmp = static_library('dir24_8_avx512_tmp', > + 'dir24_8_avx512.c', > + dependencies: static_rte_eal, > + c_args: cflags + ['-mavx512f'] + ['-mavx512dq']) > + objs += dir24_8_avx512_tmp.extract_objects('dir24_8_avx512.c') > + cflags += '-DCC_DIR24_8_AVX512_SUPPORT' > + endif > +endif This block looks wrong to me, especially comparing it with the equivalent block in drivers/net/i40e. Firstly, the two if conditions are unnecessary and can be merged. However, secondly, I think you should restructure it so that you first check for AVX-512 already being enabled in the build, and only if it is not do you need to see about checking compiler support and using the static lib workaround to get just the one file compiled with AVX-512. As Thomas suggested, a comment explaining this would also help - again copying what is in the i40e/meson.build file would probably be a good start. /Bruce