From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id B7DA31B105 for ; Wed, 10 Apr 2019 16:08:57 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 26B6F3082E4C; Wed, 10 Apr 2019 14:08:57 +0000 (UTC) Received: from dhcp-25.97.bos.redhat.com (unknown [10.18.25.61]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8ECE3619A6; Wed, 10 Apr 2019 14:08:56 +0000 (UTC) From: Aaron Conole To: Bruce Richardson Cc: konstantin.ananyev@intel.com, dev@dpdk.org References: <20190410134517.63896-1-bruce.richardson@intel.com> <20190410134517.63896-2-bruce.richardson@intel.com> <20190410140232.GD718@bricha3-MOBL.ger.corp.intel.com> Date: Wed, 10 Apr 2019 10:08:55 -0400 In-Reply-To: <20190410140232.GD718@bricha3-MOBL.ger.corp.intel.com> (Bruce Richardson's message of "Wed, 10 Apr 2019 15:02:32 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Wed, 10 Apr 2019 14:08:57 +0000 (UTC) Subject: Re: [dpdk-dev] [PATCH 1/2] acl: remove use of weak functions 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: Wed, 10 Apr 2019 14:08:58 -0000 Bruce Richardson writes: > On Wed, Apr 10, 2019 at 09:54:02AM -0400, Aaron Conole wrote: >> Bruce Richardson writes: >> >> > Weak functions don't work well with static libraries and require the >> > use of "whole-archive" flag to ensure that the correct function is used >> > when linking. Since the weak functions are only used as placeholders >> > within this library alone, we can replace them with non-weak functions >> > using preprocessor ifdefs. >> > >> > Signed-off-by: Bruce Richardson --- >> > lib/librte_acl/meson.build | 7 ++++++- lib/librte_acl/rte_acl.c | 18 >> > ++++++++++++++---- mk/rte.app.mk | 3 --- 3 files changed, >> > 20 insertions(+), 8 deletions(-) >> > >> > diff --git a/lib/librte_acl/meson.build b/lib/librte_acl/meson.build >> > index 2207dbafe..98ece7d85 100644 --- a/lib/librte_acl/meson.build +++ >> > b/lib/librte_acl/meson.build @@ -6,7 +6,7 @@ sources = >> > files('acl_bld.c', 'acl_gen.c', 'acl_run_scalar.c', 'rte_acl.c', >> > 'tb_mem.c') headers = files('rte_acl.h', 'rte_acl_osdep.h') >> > >> > -if arch_subdir == 'x86' +if dpdk_conf.has('RTE_ARCH_X86') sources += >> > files('acl_run_sse.c') >> > >> > # compile AVX2 version if either: @@ -28,4 +28,9 @@ if arch_subdir >> > == 'x86' cflags += '-DCC_AVX2_SUPPORT' endif >> > >> > +elif dpdk_conf.has('RTE_ARCH_ARM') or dpdk_conf.has('RTE_ARCH_ARM64') >> > + cflags += '-flax-vector-conversions' + sources += >> > files('acl_run_neon.c') >> >> This will also need -Wno-uninitialized (otherwise it will generate >> warnings about the search_neon_4 and search_neon_8 functions). >> >> But I don't like papering over these conversions. I'd prefer instead the >> patches I posted at: >> >> http://mails.dpdk.org/archives/dev/2019-April/129540.html and >> http://mails.dpdk.org/archives/dev/2019-April/129541.html >> >> Are you opposed to merging those? >> > Nope, not in the least. I'm happy enough to rework this patch on top of > those - I'd just had forgotten about them in my rush to get a potential > solution out here. I did these up quickly to show how easy it is to remove > the need for the weak functions and the subsequent linker "--whole-archive" > flag. > > /Bruce > > PS: I see your patch 2 does not include the Wno-uninitialized flag, is it > not needed in your patch, or just an oversight? It isn't needed, I resolved the issue with an explicit initialization. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id F2A6CA0096 for ; Wed, 10 Apr 2019 16:08:58 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 762421B116; Wed, 10 Apr 2019 16:08:58 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id B7DA31B105 for ; Wed, 10 Apr 2019 16:08:57 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 26B6F3082E4C; Wed, 10 Apr 2019 14:08:57 +0000 (UTC) Received: from dhcp-25.97.bos.redhat.com (unknown [10.18.25.61]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8ECE3619A6; Wed, 10 Apr 2019 14:08:56 +0000 (UTC) From: Aaron Conole To: Bruce Richardson Cc: konstantin.ananyev@intel.com, dev@dpdk.org References: <20190410134517.63896-1-bruce.richardson@intel.com> <20190410134517.63896-2-bruce.richardson@intel.com> <20190410140232.GD718@bricha3-MOBL.ger.corp.intel.com> Date: Wed, 10 Apr 2019 10:08:55 -0400 In-Reply-To: <20190410140232.GD718@bricha3-MOBL.ger.corp.intel.com> (Bruce Richardson's message of "Wed, 10 Apr 2019 15:02:32 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Wed, 10 Apr 2019 14:08:57 +0000 (UTC) Subject: Re: [dpdk-dev] [PATCH 1/2] acl: remove use of weak functions 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" Message-ID: <20190410140855.aYT9qXrAp_mDuMCl0Efwr2LqioCxsNaGheL6I2ZmkT4@z> Bruce Richardson writes: > On Wed, Apr 10, 2019 at 09:54:02AM -0400, Aaron Conole wrote: >> Bruce Richardson writes: >> >> > Weak functions don't work well with static libraries and require the >> > use of "whole-archive" flag to ensure that the correct function is used >> > when linking. Since the weak functions are only used as placeholders >> > within this library alone, we can replace them with non-weak functions >> > using preprocessor ifdefs. >> > >> > Signed-off-by: Bruce Richardson --- >> > lib/librte_acl/meson.build | 7 ++++++- lib/librte_acl/rte_acl.c | 18 >> > ++++++++++++++---- mk/rte.app.mk | 3 --- 3 files changed, >> > 20 insertions(+), 8 deletions(-) >> > >> > diff --git a/lib/librte_acl/meson.build b/lib/librte_acl/meson.build >> > index 2207dbafe..98ece7d85 100644 --- a/lib/librte_acl/meson.build +++ >> > b/lib/librte_acl/meson.build @@ -6,7 +6,7 @@ sources = >> > files('acl_bld.c', 'acl_gen.c', 'acl_run_scalar.c', 'rte_acl.c', >> > 'tb_mem.c') headers = files('rte_acl.h', 'rte_acl_osdep.h') >> > >> > -if arch_subdir == 'x86' +if dpdk_conf.has('RTE_ARCH_X86') sources += >> > files('acl_run_sse.c') >> > >> > # compile AVX2 version if either: @@ -28,4 +28,9 @@ if arch_subdir >> > == 'x86' cflags += '-DCC_AVX2_SUPPORT' endif >> > >> > +elif dpdk_conf.has('RTE_ARCH_ARM') or dpdk_conf.has('RTE_ARCH_ARM64') >> > + cflags += '-flax-vector-conversions' + sources += >> > files('acl_run_neon.c') >> >> This will also need -Wno-uninitialized (otherwise it will generate >> warnings about the search_neon_4 and search_neon_8 functions). >> >> But I don't like papering over these conversions. I'd prefer instead the >> patches I posted at: >> >> http://mails.dpdk.org/archives/dev/2019-April/129540.html and >> http://mails.dpdk.org/archives/dev/2019-April/129541.html >> >> Are you opposed to merging those? >> > Nope, not in the least. I'm happy enough to rework this patch on top of > those - I'd just had forgotten about them in my rush to get a potential > solution out here. I did these up quickly to show how easy it is to remove > the need for the weak functions and the subsequent linker "--whole-archive" > flag. > > /Bruce > > PS: I see your patch 2 does not include the Wno-uninitialized flag, is it > not needed in your patch, or just an oversight? It isn't needed, I resolved the issue with an explicit initialization.