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 22F30A0093 for ; Mon, 18 May 2020 20:30:33 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E22D41D56C; Mon, 18 May 2020 20:30:32 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id EA1E01D54F; Mon, 18 May 2020 20:30:28 +0200 (CEST) IronPort-SDR: joh4C49tJrZ/q6kMfDWWCuLL0Ueursx4hFT2bJSi35YLfgTtQaSEHC8yKcT1v5aj6jK4Csf8xP X4PKUMnlzA+A== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 May 2020 11:30:28 -0700 IronPort-SDR: Y7X+yxSmD8Vqwu1vM9TEMzUvU8a3yQzM/Yy99Zhdi1GOfjo8ezYQqyisId9URSxOyBnodKXePw Qc4ypTgygFlw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,407,1583222400"; d="scan'208";a="254516245" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.180]) by fmsmga008.fm.intel.com with ESMTP; 18 May 2020 11:30:25 -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: Mon, 18 May 2020 19:30:23 +0100 Message-Id: <20200518183023.4185440-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-stable] [PATCH v5] meter: provide experimental alias of API for old apps X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list 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" 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 --- lib/librte_meter/Makefile | 2 +- lib/librte_meter/meson.build | 3 +- lib/librte_meter/rte_meter.c | 5 +-- lib/librte_meter/rte_meter_compat.c | 47 ++++++++++++++++++++++++++ lib/librte_meter/rte_meter_compat.h | 26 ++++++++++++++ lib/librte_meter/rte_meter_version.map | 7 ++++ 6 files changed, 86 insertions(+), 4 deletions(-) create mode 100644 lib/librte_meter/rte_meter_compat.c create mode 100644 lib/librte_meter/rte_meter_compat.h diff --git a/lib/librte_meter/Makefile b/lib/librte_meter/Makefile index 48366e82b0..e2f59fee7c 100644 --- a/lib/librte_meter/Makefile +++ b/lib/librte_meter/Makefile @@ -19,7 +19,7 @@ EXPORT_MAP := rte_meter_version.map # # all source are stored in SRCS-y # -SRCS-$(CONFIG_RTE_LIBRTE_METER) := rte_meter.c +SRCS-$(CONFIG_RTE_LIBRTE_METER) := rte_meter.c rte_meter_compat.c # install includes SYMLINK-$(CONFIG_RTE_LIBRTE_METER)-include := rte_meter.h diff --git a/lib/librte_meter/meson.build b/lib/librte_meter/meson.build index 646fd4d43f..fdc97dc4c9 100644 --- a/lib/librte_meter/meson.build +++ b/lib/librte_meter/meson.build @@ -1,5 +1,6 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2017 Intel Corporation -sources = files('rte_meter.c') +sources = files('rte_meter.c', 'rte_meter_compat.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..b5378f615e 100644 --- a/lib/librte_meter/rte_meter.c +++ b/lib/librte_meter/rte_meter.c @@ -11,6 +11,7 @@ #include #include "rte_meter.h" +#include "rte_meter_compat.h" #ifndef RTE_METER_TB_PERIOD_MIN #define RTE_METER_TB_PERIOD_MIN 100 @@ -120,7 +121,7 @@ rte_meter_trtcm_config(struct rte_meter_trtcm *m, } int -rte_meter_trtcm_rfc4115_profile_config( +rte_meter_trtcm_rfc4115_profile_config_( struct rte_meter_trtcm_rfc4115_profile *p, struct rte_meter_trtcm_rfc4115_params *params) { @@ -145,7 +146,7 @@ rte_meter_trtcm_rfc4115_profile_config( } int -rte_meter_trtcm_rfc4115_config( +rte_meter_trtcm_rfc4115_config_( struct rte_meter_trtcm_rfc4115 *m, struct rte_meter_trtcm_rfc4115_profile *p) { diff --git a/lib/librte_meter/rte_meter_compat.c b/lib/librte_meter/rte_meter_compat.c new file mode 100644 index 0000000000..ab04b9c244 --- /dev/null +++ b/lib/librte_meter/rte_meter_compat.c @@ -0,0 +1,47 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2020 Intel Corporation + */ + +#include + +#include "rte_meter.h" +#include "rte_meter_compat.h" + +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) +{ + return rte_meter_trtcm_rfc4115_profile_config_(p, params); +} +VERSION_SYMBOL_EXPERIMENTAL(rte_meter_trtcm_rfc4115_profile_config, _e); + + +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) +{ + 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_compat.h b/lib/librte_meter/rte_meter_compat.h new file mode 100644 index 0000000000..63c282b015 --- /dev/null +++ b/lib/librte_meter/rte_meter_compat.h @@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2020 Intel Corporation + */ + +int +rte_meter_trtcm_rfc4115_profile_config_( + 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); +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_config_s(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); +int +rte_meter_trtcm_rfc4115_config_( + struct rte_meter_trtcm_rfc4115 *m, + struct rte_meter_trtcm_rfc4115_profile *p); diff --git a/lib/librte_meter/rte_meter_version.map b/lib/librte_meter/rte_meter_version.map index 2c7dadbcac..3fef20366a 100644 --- a/lib/librte_meter/rte_meter_version.map +++ b/lib/librte_meter/rte_meter_version.map @@ -21,3 +21,10 @@ DPDK_21 { 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