From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id CD7A7A00C3 for ; Fri, 15 May 2020 16:36:54 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B32F01DA26; Fri, 15 May 2020 16:36:54 +0200 (CEST) Received: from qrelay51.mxroute.com (qrelay51.mxroute.com [172.82.139.51]) by dpdk.org (Postfix) with ESMTP id BF4DA1DA7E for ; Fri, 15 May 2020 16:36:53 +0200 (CEST) Received: from filter003.mxroute.com ([168.235.111.26] 168-235-111-26.cloud.ramnode.com) (Authenticated sender: mN4UYu2MZsgR) by qrelay51.mxroute.com (ZoneMTA) with ESMTPA id 17218c42df7000add6.003 for ; Fri, 15 May 2020 14:36:49 +0000 X-Zone-Loop: 183ffc8a64ec8dff9a7e7fde4c587a0e93a862a59c88 X-Originating-IP: [168.235.111.26] Received: from galaxy.mxroute.com (unknown [23.92.70.113]) by filter003.mxroute.com (Postfix) with ESMTPS id F02276002C; Fri, 15 May 2020 14:36:43 +0000 (UTC) Received: from [192.198.151.44] (helo=localhost) by galaxy.mxroute.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.91) (envelope-from ) id 1jZb0c-0008K8-Ug; Fri, 15 May 2020 10:08:19 -0400 From: Ray Kinsella To: dev@dpdk.org, Ray Kinsella , Neil Horman , Cristian Dumitrescu , Eelco Chaudron Cc: Ferruh Yigit , Thomas Monjalon , David Marchand , stable@dpdk.org, Luca Boccassi , Bruce Richardson , Ian Stokes , Andrzej Ostruszka , John McNamara , Marko Kovacevic Date: Fri, 15 May 2020 15:36:15 +0100 Message-Id: <20200514161104.1546493-1-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <20200513121149.2283385-1-ferruh.yigit@intel.com> References: <20200513121149.2283385-1-ferruh.yigit@intel.com> Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 X-Patchwork-Submitter: Ferruh Yigit X-Patchwork-Id: 70280 X-Patchwork-Delegate: thomas@monjalon.net Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 85758A0352; Thu, 14 May 2020 18:11:15 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B185C1D9FB; Thu, 14 May 2020 18:11:14 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 1A5271D9F8; Thu, 14 May 2020 18:11:12 +0200 (CEST) IronPort-SDR: WsCVTfLqljMA8Kpse8H9So2GAVRpgevDBg2jlC2u3WNpmx0NdSZfXGXzwjw8GdexhBo0SnNgUJ VO5LrNamtH0w== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 May 2020 09:11:12 -0700 IronPort-SDR: B4NSqQizGWGDUuADbQDxQPtmZuYEzKFICMSqvbOOQuJ7m875DNN/DXjEXuNW9I6NH2SHod3raK f51oBPuNRiCw== X-IronPort-AV: E=Sophos;i="5.73,392,1583222400"; d="scan'208";a="252118579" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.180]) by fmsmga007.fm.intel.com with ESMTP; 14 May 2020 09:11:07 -0700 X-Mailer: git-send-email 2.25.4 In-Reply-To: <20200513121149.2283385-1-ferruh.yigit@intel.com> References: <20200513121149.2283385-1-ferruh.yigit@intel.com> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list Content-Transfer-Encoding: 7bit X-AuthUser: mdr@ashroe.eu Subject: [dpdk-stable] [dpdk-dev] [PATCH v4] meter: provide experimental alias of API for old apps X-BeenThere: stable@dpdk.org List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Message-ID: <20200515143615.e3OrUKpJIK7-uzCkWMJI7T2lWmDqx-5zqRiGy5KccEU@z> From: Ferruh Yigit On v20.02 some meter APIs have been matured and symbols moved from EXPERIMENTAL to DPDK_20.0.1 block. This can break the applications that were using these mentioned APIs on v19.11. Although there is no modification on the APIs and the action is positive and matures the APIs, the affect can be negative to applications. Since experimental APIs can change or go away without notice as part of contract, to prevent this negative affect that may occur by maturing experimental API, a process update already suggested, which enables aliasing without forcing it: https://patches.dpdk.org/patch/65863/ This patch provides aliasing by duplicating the existing and versioned symbols as experimental. Since symbols moved from DPDK_20.0.1 to DPDK_21 block in the v20.05, the aliasing done between EXPERIMENTAL and DPDK_21. Also following changes done to enabling aliasing: Created VERSION_SYMBOL_EXPERIMENTAL helper macro. Updated the 'check-symbols.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") Cc: stable@dpdk.org 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 Cc: Ray Kinsella v2: * Commit log updated v3: * added suggested comment to VERSION_SYMBOL_EXPERIMENTAL macro v4: * update script name in commit log, remove empty line --- buildtools/check-symbols.sh | 3 +- .../include/rte_function_versioning.h | 9 +++ lib/librte_meter/meson.build | 1 + lib/librte_meter/rte_meter.c | 59 ++++++++++++++++++- lib/librte_meter/rte_meter_version.map | 8 +++ 5 files changed, 76 insertions(+), 4 deletions(-) diff --git a/buildtools/check-symbols.sh b/buildtools/check-symbols.sh index 3df57c322c..e407553a34 100755 --- a/buildtools/check-symbols.sh +++ b/buildtools/check-symbols.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/include/rte_function_versioning.h b/lib/librte_eal/include/rte_function_versioning.h index b9f862d295..f588f2643b 100644 --- a/lib/librte_eal/include/rte_function_versioning.h +++ b/lib/librte_eal/include/rte_function_versioning.h @@ -46,6 +46,14 @@ */ #define VERSION_SYMBOL(b, e, n) __asm__(".symver " RTE_STR(b) RTE_STR(e) ", " RTE_STR(b) "@DPDK_" RTE_STR(n)) +/* + * VERSION_SYMBOL_EXPERIMENTAL + * Creates a symbol version table entry binding the symbol @EXPERIMENTAL to the internal + * function name . The macro is used when a symbol matures to become part of the stable ABI, + * to provide an alias to experimental for some time. + */ +#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 +87,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 646fd4d43f..fce0368437 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 da01429a8b..c600b05064 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, 21); +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, 21); +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 2c7dadbcac..b493bcebe9 100644 --- a/lib/librte_meter/rte_meter_version.map +++ b/lib/librte_meter/rte_meter_version.map @@ -20,4 +20,12 @@ DPDK_21 { 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; +};