meter: provide experimental alias for matured API
authorFerruh Yigit <ferruh.yigit@intel.com>
Tue, 19 May 2020 12:16:29 +0000 (13:16 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 19 May 2020 14:25:09 +0000 (16:25 +0200)
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 <ferruh.yigit@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
lib/librte_meter/meson.build
lib/librte_meter/rte_meter.c
lib/librte_meter/rte_meter_version.map

index 646fd4d..fce0368 100644 (file)
@@ -3,3 +3,4 @@
 
 sources = files('rte_meter.c')
 headers = files('rte_meter.h')
+use_function_versioning = true
index da01429..149cf58 100644 (file)
@@ -9,6 +9,7 @@
 #include <rte_common.h>
 #include <rte_log.h>
 #include <rte_cycles.h>
+#include <rte_function_versioning.h>
 
 #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);
index 2c7dadb..b493bce 100644 (file)
@@ -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;
+};