From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 96A65F98A for ; Thu, 19 Jan 2017 15:59:27 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP; 19 Jan 2017 06:59:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,254,1477983600"; d="scan'208";a="32720676" Received: from dhunt5-mobl.ger.corp.intel.com (HELO [10.237.221.69]) ([10.237.221.69]) by orsmga002.jf.intel.com with ESMTP; 19 Jan 2017 06:59:25 -0800 To: Bruce Richardson References: <1482381428-148094-2-git-send-email-david.hunt@intel.com> <1483948248-91364-1-git-send-email-david.hunt@intel.com> <1483948248-91364-3-git-send-email-david.hunt@intel.com> <20170113152653.GB201464@bricha3-MOBL3.ger.corp.intel.com> Cc: dev@dpdk.org From: "Hunt, David" Message-ID: <996ea2a2-e61d-8ca1-8fa3-c5f7f8228eba@intel.com> Date: Thu, 19 Jan 2017 14:59:25 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <20170113152653.GB201464@bricha3-MOBL3.ger.corp.intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v4 2/6] lib: add distributor vector flow matching 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: , X-List-Received-Date: Thu, 19 Jan 2017 14:59:28 -0000 On 13/1/2017 3:26 PM, Bruce Richardson wrote: > On Mon, Jan 09, 2017 at 07:50:44AM +0000, David Hunt wrote: >> Signed-off-by: David Hunt >> --- >> lib/librte_distributor/Makefile | 4 + >> lib/librte_distributor/rte_distributor_burst.c | 11 +- >> lib/librte_distributor/rte_distributor_match_sse.c | 113 +++++++++++++++++++++ >> lib/librte_distributor/rte_distributor_priv.h | 6 ++ >> 4 files changed, 133 insertions(+), 1 deletion(-) >> create mode 100644 lib/librte_distributor/rte_distributor_match_sse.c >> >> diff --git a/lib/librte_distributor/Makefile b/lib/librte_distributor/Makefile >> index 2acc54d..a725aaf 100644 >> --- a/lib/librte_distributor/Makefile >> +++ b/lib/librte_distributor/Makefile >> @@ -44,6 +44,10 @@ LIBABIVER := 1 >> # all source are stored in SRCS-y >> SRCS-$(CONFIG_RTE_LIBRTE_DISTRIBUTOR) := rte_distributor.c >> SRCS-$(CONFIG_RTE_LIBRTE_DISTRIBUTOR) += rte_distributor_burst.c >> +ifeq ($(CONFIG_RTE_ARCH_X86),y) >> +SRCS-$(CONFIG_RTE_LIBRTE_DISTRIBUTOR) += rte_distributor_match_sse.c >> +endif >> + >> > I believe some of the intrinsics used in the vector code are SSE4.2 > instructions, so you need to pass that flag for the compilation for e.g. > the "default" target for packaging into distros. > >> # install this header file >> SYMLINK-$(CONFIG_RTE_LIBRTE_DISTRIBUTOR)-include := rte_distributor.h >> diff --git a/lib/librte_distributor/rte_distributor_burst.c b/lib/librte_distributor/rte_distributor_burst.c >> index ae7cf9d..35044c4 100644 >> --- a/lib/librte_distributor/rte_distributor_burst.c >> +++ b/lib/librte_distributor/rte_distributor_burst.c >> @@ -352,6 +352,9 @@ rte_distributor_process_burst(struct rte_distributor_burst *d, >> } >> >> switch (d->dist_match_fn) { >> + case RTE_DIST_MATCH_VECTOR: >> + find_match_vec(d, &flows[0], &matches[0]); >> + break; >> default: >> find_match_scalar(d, &flows[0], &matches[0]); >> } >> @@ -538,7 +541,13 @@ rte_distributor_create_burst(const char *name, >> snprintf(d->name, sizeof(d->name), "%s", name); >> d->num_workers = num_workers; >> >> - d->dist_match_fn = RTE_DIST_MATCH_SCALAR; >> +#if defined(RTE_ARCH_X86) >> + if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_SSE2)) { >> + d->dist_match_fn = RTE_DIST_MATCH_VECTOR; >> + } else { >> +#endif >> + d->dist_match_fn = RTE_DIST_MATCH_SCALAR; >> + } >> > Two issues here: > 1) the check needs to be for SSE4.2, not SSE2 [minimum for DPDK on x86 > is SSE3 anyway, so no need for any checks for SSE2] > 2) The closing brace should be ifdefed out to fix compilation on non-x86 > platforms. A simpler/better solution might actually be to remove the > braces since only a single line is involved in each branch. > > Regards, > /Bruce Will be resolved up in next revision. Thanks, Dave.