From patchwork Wed Jan 29 16:43:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ferruh Yigit X-Patchwork-Id: 65345 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 14DC1A052F; Wed, 29 Jan 2020 17:43:59 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DB9F21BFFB; Wed, 29 Jan 2020 17:43:57 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 6EC831BFEE for ; Wed, 29 Jan 2020 17:43:56 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Jan 2020 08:43:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,378,1574150400"; d="scan'208";a="402040390" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.180]) by orsmga005.jf.intel.com with ESMTP; 29 Jan 2020 08:43:52 -0800 From: Ferruh Yigit To: Neil Horman , Cristian Dumitrescu , Eelco Chaudron Cc: dev@dpdk.org, Thomas Monjalon , Luca Boccassi , David Marchand , Bruce Richardson , Ian Stokes , Andrzej Ostruszka Date: Wed, 29 Jan 2020 16:43:50 +0000 Message-Id: <20200129164350.3724793-1-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200129122953.2016199-1-ferruh.yigit@intel.com> References: <20200129122953.2016199-1-ferruh.yigit@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [RFC v2] meter: fix ABI break due to experimental tag removal 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" Duplicated the existing symbol and versioned one as experimental and other as stable. Created VERSION_SYMBOL_EXPERIMENTAL helper macro. Updated the 'check-experimental-syms.sh' buildtool, which was complaining that the symbol is in EXPERIMENTAL tag in .map file but it is not in the .experimental section (__rte_experimental tag is missing). Updated tool in a way it won't complain if the symbol in the EXPERIMENTAL tag duplicated in some other block in .map file (versioned) Enabled function versioning for meson build for the library. Fixes: 30512af820fe ("meter: remove experimental flag from RFC4115 trTCM API") Signed-off-by: Ferruh Yigit --- Cc: Neil Horman Cc: Thomas Monjalon Cc: Luca Boccassi Cc: David Marchand Cc: Bruce Richardson Cc: Ian Stokes Cc: Eelco Chaudron Cc: Andrzej Ostruszka v2: * allow versioning only for meter library, instead of enabling it globally I didn't like the idea of duplicating the symbol but not able to find to alias it without duplicating, if there is a way please share. Also not tested with old binaries, only verified the symbols in new binaries. --- buildtools/check-experimental-syms.sh | 3 +- .../common/include/rte_function_versioning.h | 4 ++ lib/librte_meter/meson.build | 1 + lib/librte_meter/rte_meter.c | 59 ++++++++++++++++++- lib/librte_meter/rte_meter_version.map | 8 +++ 5 files changed, 71 insertions(+), 4 deletions(-) diff --git a/buildtools/check-experimental-syms.sh b/buildtools/check-experimental-syms.sh index f3603e5ba..35c4bf006 100755 --- a/buildtools/check-experimental-syms.sh +++ b/buildtools/check-experimental-syms.sh @@ -26,7 +26,8 @@ ret=0 for SYM in `$LIST_SYMBOL -S EXPERIMENTAL $MAPFILE |cut -d ' ' -f 3` do if grep -q "\.text.*[[:space:]]$SYM$" $DUMPFILE && - ! grep -q "\.text\.experimental.*[[:space:]]$SYM$" $DUMPFILE + ! grep -q "\.text\.experimental.*[[:space:]]$SYM$" $DUMPFILE && + $LIST_SYMBOL -s $SYM $MAPFILE | grep -q EXPERIMENTAL then cat >&2 <<- END_OF_MESSAGE $SYM is not flagged as experimental diff --git a/lib/librte_eal/common/include/rte_function_versioning.h b/lib/librte_eal/common/include/rte_function_versioning.h index c924351d5..ab102b06e 100644 --- a/lib/librte_eal/common/include/rte_function_versioning.h +++ b/lib/librte_eal/common/include/rte_function_versioning.h @@ -46,6 +46,9 @@ */ #define VERSION_SYMBOL(b, e, n) __asm__(".symver " RTE_STR(b) RTE_STR(e) ", " RTE_STR(b) "@DPDK_" RTE_STR(n)) + +#define VERSION_SYMBOL_EXPERIMENTAL(b, e) __asm__(".symver " RTE_STR(b) RTE_STR(e) ", " RTE_STR(b) "@EXPERIMENTAL") + /* * BIND_DEFAULT_SYMBOL * Creates a symbol version entry instructing the linker to bind references to @@ -79,6 +82,7 @@ * No symbol versioning in use */ #define VERSION_SYMBOL(b, e, n) +#define VERSION_SYMBOL_EXPERIMENTAL(b, e) #define __vsym #define BIND_DEFAULT_SYMBOL(b, e, n) #define MAP_STATIC_SYMBOL(f, p) f __attribute__((alias(RTE_STR(p)))) diff --git a/lib/librte_meter/meson.build b/lib/librte_meter/meson.build index 646fd4d43..fce036843 100644 --- a/lib/librte_meter/meson.build +++ b/lib/librte_meter/meson.build @@ -3,3 +3,4 @@ sources = files('rte_meter.c') headers = files('rte_meter.h') +use_function_versioning = true diff --git a/lib/librte_meter/rte_meter.c b/lib/librte_meter/rte_meter.c index da01429a8..5244537fa 100644 --- a/lib/librte_meter/rte_meter.c +++ b/lib/librte_meter/rte_meter.c @@ -9,6 +9,7 @@ #include #include #include +#include #include "rte_meter.h" @@ -119,8 +120,8 @@ rte_meter_trtcm_config(struct rte_meter_trtcm *m, return 0; } -int -rte_meter_trtcm_rfc4115_profile_config( +static int +rte_meter_trtcm_rfc4115_profile_config_( struct rte_meter_trtcm_rfc4115_profile *p, struct rte_meter_trtcm_rfc4115_params *params) { @@ -145,7 +146,35 @@ rte_meter_trtcm_rfc4115_profile_config( } int -rte_meter_trtcm_rfc4115_config( +rte_meter_trtcm_rfc4115_profile_config_s( + struct rte_meter_trtcm_rfc4115_profile *p, + struct rte_meter_trtcm_rfc4115_params *params); +int +rte_meter_trtcm_rfc4115_profile_config_s( + struct rte_meter_trtcm_rfc4115_profile *p, + struct rte_meter_trtcm_rfc4115_params *params) +{ + return rte_meter_trtcm_rfc4115_profile_config_(p, params); +} +BIND_DEFAULT_SYMBOL(rte_meter_trtcm_rfc4115_profile_config, _s, 20.0.1); +MAP_STATIC_SYMBOL(int rte_meter_trtcm_rfc4115_profile_config(struct rte_meter_trtcm_rfc4115_profile *p, + struct rte_meter_trtcm_rfc4115_params *params), rte_meter_trtcm_rfc4115_profile_config_s); + +int +rte_meter_trtcm_rfc4115_profile_config_e( + struct rte_meter_trtcm_rfc4115_profile *p, + struct rte_meter_trtcm_rfc4115_params *params); +int +rte_meter_trtcm_rfc4115_profile_config_e( + struct rte_meter_trtcm_rfc4115_profile *p, + struct rte_meter_trtcm_rfc4115_params *params) +{ + return rte_meter_trtcm_rfc4115_profile_config_(p, params); +} +VERSION_SYMBOL_EXPERIMENTAL(rte_meter_trtcm_rfc4115_profile_config, _e); + +static int +rte_meter_trtcm_rfc4115_config_( struct rte_meter_trtcm_rfc4115 *m, struct rte_meter_trtcm_rfc4115_profile *p) { @@ -160,3 +189,27 @@ rte_meter_trtcm_rfc4115_config( return 0; } + +int +rte_meter_trtcm_rfc4115_config_s(struct rte_meter_trtcm_rfc4115 *m, + struct rte_meter_trtcm_rfc4115_profile *p); +int +rte_meter_trtcm_rfc4115_config_s(struct rte_meter_trtcm_rfc4115 *m, + struct rte_meter_trtcm_rfc4115_profile *p) +{ + return rte_meter_trtcm_rfc4115_config_(m, p); +} +BIND_DEFAULT_SYMBOL(rte_meter_trtcm_rfc4115_config, _s, 20.0.1); +MAP_STATIC_SYMBOL(int rte_meter_trtcm_rfc4115_config(struct rte_meter_trtcm_rfc4115 *m, + struct rte_meter_trtcm_rfc4115_profile *p), rte_meter_trtcm_rfc4115_config_s); + +int +rte_meter_trtcm_rfc4115_config_e(struct rte_meter_trtcm_rfc4115 *m, + struct rte_meter_trtcm_rfc4115_profile *p); +int +rte_meter_trtcm_rfc4115_config_e(struct rte_meter_trtcm_rfc4115 *m, + struct rte_meter_trtcm_rfc4115_profile *p) +{ + return rte_meter_trtcm_rfc4115_config_(m, p); +} +VERSION_SYMBOL_EXPERIMENTAL(rte_meter_trtcm_rfc4115_config, _e); diff --git a/lib/librte_meter/rte_meter_version.map b/lib/librte_meter/rte_meter_version.map index fc12cc0bf..b4b043174 100644 --- a/lib/librte_meter/rte_meter_version.map +++ b/lib/librte_meter/rte_meter_version.map @@ -20,4 +20,12 @@ DPDK_20.0.1 { rte_meter_trtcm_rfc4115_color_blind_check; rte_meter_trtcm_rfc4115_config; rte_meter_trtcm_rfc4115_profile_config; + } DPDK_20.0; + +EXPERIMENTAL { + global: + + rte_meter_trtcm_rfc4115_config; + rte_meter_trtcm_rfc4115_profile_config; +};