From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 973F71B204 for ; Wed, 10 Apr 2019 16:58:15 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Apr 2019 07:58:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,332,1549958400"; d="scan'208";a="336645630" Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by fmsmga005.fm.intel.com with ESMTP; 10 Apr 2019 07:58:13 -0700 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.31]) by IRSMSX103.ger.corp.intel.com ([169.254.3.30]) with mapi id 14.03.0415.000; Wed, 10 Apr 2019 15:57:55 +0100 From: "Ananyev, Konstantin" To: "Richardson, Bruce" , "aconole@redhat.com" CC: "dev@dpdk.org" Thread-Topic: [PATCH 2/2] bpf: remove use of weak functions Thread-Index: AQHU76O/mYSVPQ7SA0S0Bkl9tpgyVqY1fDYQ Date: Wed, 10 Apr 2019 14:57:55 +0000 Message-ID: <2601191342CEEE43887BDE71AB9772580148A95898@irsmsx105.ger.corp.intel.com> References: <20190410134517.63896-1-bruce.richardson@intel.com> <20190410134517.63896-3-bruce.richardson@intel.com> In-Reply-To: <20190410134517.63896-3-bruce.richardson@intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZDE3NDYxNTctZTZmYy00NmFlLWFjNjItYWUzN2U2ODYwNGM2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoidk5lMzBKWEkzVXdwR0Z0RVBsNXlUbGNPNnQ5alRuM0Z4aVluYlpMYnJIVzlrT1JMUjFGZGZlRTNFblRoWTJ0SCJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 2/2] bpf: 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:58:16 -0000 > -----Original Message----- > From: Richardson, Bruce > Sent: Wednesday, April 10, 2019 2:45 PM > To: Ananyev, Konstantin ; aconole@redhat.co= m > Cc: dev@dpdk.org; Richardson, Bruce > Subject: [PATCH 2/2] bpf: remove use of weak functions >=20 > 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 function is only used as a placeholder within th= is > library alone, we can replace it with a non-weak version protected using > preprocessor ifdefs. >=20 > Signed-off-by: Bruce Richardson > --- > lib/librte_bpf/bpf_load.c | 4 +++- > lib/librte_bpf/meson.build | 1 + > 2 files changed, 4 insertions(+), 1 deletion(-) >=20 > diff --git a/lib/librte_bpf/bpf_load.c b/lib/librte_bpf/bpf_load.c > index d9d163b7d..194103ec7 100644 > --- a/lib/librte_bpf/bpf_load.c > +++ b/lib/librte_bpf/bpf_load.c > @@ -131,7 +131,8 @@ rte_bpf_load(const struct rte_bpf_prm *prm) > return bpf; > } >=20 > -__rte_experimental __rte_weak struct rte_bpf * > +#ifndef RTE_LIBRTE_BPF_ELF > +__rte_experimental struct rte_bpf * > rte_bpf_elf_load(const struct rte_bpf_prm *prm, const char *fname, > const char *sname) > { > @@ -146,3 +147,4 @@ rte_bpf_elf_load(const struct rte_bpf_prm *prm, const= char *fname, > rte_errno =3D ENOTSUP; > return NULL; > } > +#endif > diff --git a/lib/librte_bpf/meson.build b/lib/librte_bpf/meson.build > index 8a79878ff..11c1fb558 100644 > --- a/lib/librte_bpf/meson.build > +++ b/lib/librte_bpf/meson.build > @@ -20,6 +20,7 @@ deps +=3D ['mbuf', 'net', 'ethdev'] >=20 > dep =3D dependency('libelf', required: false) > if dep.found() > + dpdk_conf.set('RTE_LIBRTE_BPF_ELF', 1) > sources +=3D files('bpf_load_elf.c') > ext_deps +=3D dep > endif > -- Acked-by: Konstantin Ananyev Tested-by: Konstantin Ananyev > 2.20.1 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 A236BA0096 for ; Wed, 10 Apr 2019 16:58:17 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 544C31B20A; Wed, 10 Apr 2019 16:58:17 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 973F71B204 for ; Wed, 10 Apr 2019 16:58:15 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Apr 2019 07:58:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,332,1549958400"; d="scan'208";a="336645630" Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by fmsmga005.fm.intel.com with ESMTP; 10 Apr 2019 07:58:13 -0700 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.31]) by IRSMSX103.ger.corp.intel.com ([169.254.3.30]) with mapi id 14.03.0415.000; Wed, 10 Apr 2019 15:57:55 +0100 From: "Ananyev, Konstantin" To: "Richardson, Bruce" , "aconole@redhat.com" CC: "dev@dpdk.org" Thread-Topic: [PATCH 2/2] bpf: remove use of weak functions Thread-Index: AQHU76O/mYSVPQ7SA0S0Bkl9tpgyVqY1fDYQ Date: Wed, 10 Apr 2019 14:57:55 +0000 Message-ID: <2601191342CEEE43887BDE71AB9772580148A95898@irsmsx105.ger.corp.intel.com> References: <20190410134517.63896-1-bruce.richardson@intel.com> <20190410134517.63896-3-bruce.richardson@intel.com> In-Reply-To: <20190410134517.63896-3-bruce.richardson@intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZDE3NDYxNTctZTZmYy00NmFlLWFjNjItYWUzN2U2ODYwNGM2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoidk5lMzBKWEkzVXdwR0Z0RVBsNXlUbGNPNnQ5alRuM0Z4aVluYlpMYnJIVzlrT1JMUjFGZGZlRTNFblRoWTJ0SCJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 2/2] bpf: 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: <20190410145755.AYfz8O1_1PIi6a1gzny2YMb6yMdc4toMCS7zudGuGrc@z> > -----Original Message----- > From: Richardson, Bruce > Sent: Wednesday, April 10, 2019 2:45 PM > To: Ananyev, Konstantin ; aconole@redhat.co= m > Cc: dev@dpdk.org; Richardson, Bruce > Subject: [PATCH 2/2] bpf: remove use of weak functions >=20 > 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 function is only used as a placeholder within th= is > library alone, we can replace it with a non-weak version protected using > preprocessor ifdefs. >=20 > Signed-off-by: Bruce Richardson > --- > lib/librte_bpf/bpf_load.c | 4 +++- > lib/librte_bpf/meson.build | 1 + > 2 files changed, 4 insertions(+), 1 deletion(-) >=20 > diff --git a/lib/librte_bpf/bpf_load.c b/lib/librte_bpf/bpf_load.c > index d9d163b7d..194103ec7 100644 > --- a/lib/librte_bpf/bpf_load.c > +++ b/lib/librte_bpf/bpf_load.c > @@ -131,7 +131,8 @@ rte_bpf_load(const struct rte_bpf_prm *prm) > return bpf; > } >=20 > -__rte_experimental __rte_weak struct rte_bpf * > +#ifndef RTE_LIBRTE_BPF_ELF > +__rte_experimental struct rte_bpf * > rte_bpf_elf_load(const struct rte_bpf_prm *prm, const char *fname, > const char *sname) > { > @@ -146,3 +147,4 @@ rte_bpf_elf_load(const struct rte_bpf_prm *prm, const= char *fname, > rte_errno =3D ENOTSUP; > return NULL; > } > +#endif > diff --git a/lib/librte_bpf/meson.build b/lib/librte_bpf/meson.build > index 8a79878ff..11c1fb558 100644 > --- a/lib/librte_bpf/meson.build > +++ b/lib/librte_bpf/meson.build > @@ -20,6 +20,7 @@ deps +=3D ['mbuf', 'net', 'ethdev'] >=20 > dep =3D dependency('libelf', required: false) > if dep.found() > + dpdk_conf.set('RTE_LIBRTE_BPF_ELF', 1) > sources +=3D files('bpf_load_elf.c') > ext_deps +=3D dep > endif > -- Acked-by: Konstantin Ananyev Tested-by: Konstantin Ananyev > 2.20.1