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 294FCA0526; Wed, 8 Jul 2020 21:56:26 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EA5001DBC2; Wed, 8 Jul 2020 21:56:24 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 3794B1D942 for ; Wed, 8 Jul 2020 21:56:23 +0200 (CEST) IronPort-SDR: bWRl9h92MkXQ1tbrjQ9rgHaIUz7cy8XxCccK/da3y1fagzehscLhyU1IrLVy0IwcNHvf61/1tt 4d5fBitz++QA== X-IronPort-AV: E=McAfee;i="6000,8403,9676"; a="127480524" X-IronPort-AV: E=Sophos;i="5.75,329,1589266800"; d="scan'208";a="127480524" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jul 2020 12:56:22 -0700 IronPort-SDR: hbF0wp+4IXYLdKROkxHnOzrrQH15eJv722ynJsCf71numFlVnVC5Zz5Yh+sVdFjEwU3NvJBxIs LCYnky7nf7jA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,329,1589266800"; d="scan'208";a="306152053" Received: from vmedvedk-mobl.ger.corp.intel.com (HELO [10.213.247.70]) ([10.213.247.70]) by fmsmga004.fm.intel.com with ESMTP; 08 Jul 2020 12:56:19 -0700 To: "Ananyev, Konstantin" , "dev@dpdk.org" Cc: "Richardson, Bruce" References: <99bcffd72d5678e58289830c43ce2bf3829d310a.1589890263.git.vladimir.medvedkin@intel.com> From: "Medvedkin, Vladimir" Message-ID: Date: Wed, 8 Jul 2020 20:56:17 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v3 7/8] fib6: 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" Hi Konstantin, Thanks for review, On 08/07/2020 13:23, Ananyev, Konstantin wrote: > >> >> Add new lookup implementation for FIB6 trie algorithm using >> AVX512 instruction set >> >> Signed-off-by: Vladimir Medvedkin >> --- >> lib/librte_fib/Makefile | 10 ++ >> lib/librte_fib/meson.build | 9 ++ >> lib/librte_fib/rte_fib6.h | 3 +- >> lib/librte_fib/trie.c | 21 ++++ >> lib/librte_fib/trie_avx512.c | 269 +++++++++++++++++++++++++++++++++++++++++++ >> lib/librte_fib/trie_avx512.h | 20 ++++ >> 6 files changed, 331 insertions(+), 1 deletion(-) >> create mode 100644 lib/librte_fib/trie_avx512.c >> create mode 100644 lib/librte_fib/trie_avx512.h >> >> diff --git a/lib/librte_fib/Makefile b/lib/librte_fib/Makefile >> index 3958da1..761c7c8 100644 >> --- a/lib/librte_fib/Makefile >> +++ b/lib/librte_fib/Makefile >> @@ -25,12 +25,22 @@ grep -q __AVX512F__ && echo 1) >> CC_AVX512DQ_SUPPORT=$(shell $(CC) -mavx512dq -dM -E - &1 | \ >> grep -q __AVX512DQ__ && echo 1) >> >> +CC_AVX512BW_SUPPORT=$(shell $(CC) -mavx512bw -dM -E - &1 | \ >> +grep -q __AVX512BW__ && echo 1) >> + >> ifeq ($(CC_AVX512F_SUPPORT), 1) >> ifeq ($(CC_AVX512DQ_SUPPORT), 1) >> SRCS-$(CONFIG_RTE_LIBRTE_FIB) += dir24_8_avx512.c >> CFLAGS_dir24_8_avx512.o += -mavx512f >> CFLAGS_dir24_8_avx512.o += -mavx512dq >> CFLAGS_dir24_8.o += -DCC_DIR24_8_AVX512_SUPPORT >> +ifeq ($(CC_AVX512BW_SUPPORT), 1) >> +SRCS-$(CONFIG_RTE_LIBRTE_FIB) += trie_avx512.c >> +CFLAGS_trie_avx512.o += -mavx512f >> +CFLAGS_trie_avx512.o += -mavx512dq >> +CFLAGS_trie_avx512.o += -mavx512bw >> +CFLAGS_trie.o += -DCC_TRIE_AVX512_SUPPORT >> +endif >> endif >> endif >> include $(RTE_SDK)/mk/rte.lib.mk >> diff --git a/lib/librte_fib/meson.build b/lib/librte_fib/meson.build >> index 0963f3c..98adf11 100644 >> --- a/lib/librte_fib/meson.build >> +++ b/lib/librte_fib/meson.build >> @@ -14,5 +14,14 @@ if dpdk_conf.has('RTE_ARCH_X86') and cc.has_argument('-mavx512f') >> c_args: cflags + ['-mavx512f'] + ['-mavx512dq']) >> objs += dir24_8_avx512_tmp.extract_objects('dir24_8_avx512.c') >> cflags += '-DCC_DIR24_8_AVX512_SUPPORT' >> +if cc.has_argument('-mavx512bw') >> +trie_avx512_tmp = static_library('trie_avx512_tmp', >> +'trie_avx512.c', >> +dependencies: static_rte_eal, >> +c_args: cflags + ['-mavx512f'] + \ >> +['-mavx512dq'] + ['-mavx512bw']) >> +objs += trie_avx512_tmp.extract_objects('trie_avx512.c') >> +cflags += '-DCC_TRIE_AVX512_SUPPORT' >> +endif >> endif >> endif >> diff --git a/lib/librte_fib/rte_fib6.h b/lib/librte_fib/rte_fib6.h >> index b70369a..c55efdf 100644 >> --- a/lib/librte_fib/rte_fib6.h >> +++ b/lib/librte_fib/rte_fib6.h >> @@ -53,7 +53,8 @@ enum rte_fib_trie_nh_sz { >> }; >> >> enum rte_fib_trie_lookup_type { >> -RTE_FIB6_TRIE_SCALAR >> +RTE_FIB6_TRIE_SCALAR, >> +RTE_FIB6_TRIE_VECTOR > > As a nit - does this enum needs to be public? > If it does, then probably worth to name it VECTOR_AVX512, > in case someone in future will want to add another vector implementation. > Probably same thought for v4. This enum is used with rte_fib_set_lookup_fn() so it needs to be public. I'll change name to be with _AVX512 suffix. The same for v4. > Apart from that - LGTM. > Acked-by: Konstantin Ananyev > -- Regards, Vladimir