From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58]) by dpdk.org (Postfix) with ESMTP id DF1742E8A for ; Wed, 6 Aug 2014 20:53:03 +0200 (CEST) Received: from hmsreliant.think-freely.org ([2001:470:8:a08:7aac:c0ff:fec2:933b] helo=localhost) by smtp.tuxdriver.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.63) (envelope-from ) id 1XF6Mv-0000MV-GH; Wed, 06 Aug 2014 14:55:31 -0400 Date: Wed, 6 Aug 2014 14:55:24 -0400 From: Neil Horman To: Konstantin Ananyev Message-ID: <20140806185524.GB23133@hmsreliant.think-freely.org> References: <1407347625-24646-1-git-send-email-konstantin.ananyev@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1407347625-24646-1-git-send-email-konstantin.ananyev@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Score: -2.9 (--) X-Spam-Status: No Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH] librte_acl make it build/work for 'default' target X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2014 18:53:04 -0000 On Wed, Aug 06, 2014 at 06:53:45PM +0100, Konstantin Ananyev wrote: > Make ACL library to build/work on 'default' architecture: > - make rte_acl_classify_scalar really scalar > (make sure it wouldn't use sse4 instrincts through resolve_priority()). > - Provide two versions of rte_acl_classify code path: > rte_acl_classify_sse() - could be build and used only on systems with sse4.2 > and upper, return -ENOTSUP on lower arch. > rte_acl_classify_scalar() - a slower version, but could be build and used > on all systems. > - rte_acl_classify() - becomes just a macro pointing to one of the functions > mentioned abovei (highest avaialbe version at build time). > - keep code common for both version code. > > Signed-off-by: Konstantin Ananyev > --- > lib/librte_acl/acl_bld.c | 5 +- > lib/librte_acl/acl_match_check.def | 92 +++++ > lib/librte_acl/acl_run.c | 692 ++++--------------------------------- > lib/librte_acl/acl_run_sse.h | 629 +++++++++++++++++++++++++++++++++ > lib/librte_acl/rte_acl.h | 12 +- > 5 files changed, 806 insertions(+), 624 deletions(-) > create mode 100644 lib/librte_acl/acl_match_check.def > create mode 100644 lib/librte_acl/acl_run_sse.h > This is still compile time selected. You've gone to all the trouble to separate the scalar and sse vector paths. Why not make it run time selectable based on cpu testing? Just because its built for the default machine doesn't mean it will run on the default machine. We may as well take advantage of the faster paths when we're able. Neil