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 203B0A0093; Tue, 19 May 2020 14:16:37 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E63311D5E1; Tue, 19 May 2020 14:16:36 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 349831C11F; Tue, 19 May 2020 14:16:35 +0200 (CEST) IronPort-SDR: fUr8p3V2cV3CkHOhkLdtQZbTj1jSwZd+VCSnqKzlJrLKn26fivTyPEGw7sWAIvG4ePfmOh8TeD 5UWLBu6xOE+g== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 May 2020 05:16:34 -0700 IronPort-SDR: PU+/8bmU1mcXY5+/JkDSrD/w4inn5Pn4qQAKlBhSyOGIm9suO+9YhwSPm1y+E+UTIKQQ8wEUn7 hz3YRNHHKFlA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,410,1583222400"; d="scan'208";a="288939115" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.180]) by fmsmga004.fm.intel.com with ESMTP; 19 May 2020 05:16:31 -0700 From: Ferruh Yigit To: Cristian Dumitrescu , Ray Kinsella , Neil Horman , Eelco Chaudron Cc: dev@dpdk.org, Ferruh Yigit , Thomas Monjalon , David Marchand , stable@dpdk.org, Luca Boccassi , Bruce Richardson , Ian Stokes , Andrzej Ostruszka Date: Tue, 19 May 2020 13:16:29 +0100 Message-Id: <20200519121629.3590459-1-ferruh.yigit@intel.com> 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 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v6] meter: provide experimental alias of API for old apps 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" 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. 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. With DPDK_21 ABI (DPDK v20.11) all aliasing will be removed and only stable version of the APIs will remain. 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 Cc: cristian.dumitrescu@intel.com v2: * Commit log updated v3: * added suggested comment to VERSION_SYMBOL_EXPERIMENTAL macro v4: * update script name in commit log, remove empty line v5: * Patch has only meter library changes * Aliasing moved into rte_meter_compat.c v6: * Move aliasing back to rte_meter.c * Rename static function to have '__' prefix * Add comment to alias code --- lib/librte_meter/meson.build | 1 + lib/librte_meter/rte_meter.c | 73 ++++++++++++++++++++++++-- lib/librte_meter/rte_meter_version.map | 8 +++ 3 files changed, 79 insertions(+), 3 deletions(-) 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..149cf58bdd 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,15 @@ rte_meter_trtcm_config(struct rte_meter_trtcm *m, return 0; } -int -rte_meter_trtcm_rfc4115_profile_config( +/* + * ABI aliasing done for 'rte_meter_trtcm_rfc4115_profile_config' + * to support both EXPERIMENTAL and DPDK_21 versions + * This versioning will be removed on next ABI version (v20.11) + * and '__rte_meter_trtcm_rfc4115_profile_config' will be restrored back to + * 'rte_meter_trtcm_rfc4115_profile_config' without versioning. + */ +static int +__rte_meter_trtcm_rfc4115_profile_config( struct rte_meter_trtcm_rfc4115_profile *p, struct rte_meter_trtcm_rfc4115_params *params) { @@ -145,7 +153,42 @@ 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); + +/* + * ABI aliasing done for 'rte_meter_trtcm_rfc4115_config' + * to support both EXPERIMENTAL and DPDK_21 versions + * This versioning will be removed on next ABI version (v20.11) + * and '__rte_meter_trtcm_rfc4115_config' will be restrored back to + * 'rte_meter_trtcm_rfc4115_config' without versioning. + */ +static int +__rte_meter_trtcm_rfc4115_config( struct rte_meter_trtcm_rfc4115 *m, struct rte_meter_trtcm_rfc4115_profile *p) { @@ -160,3 +203,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; +}; -- 2.25.4