DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [RFC] meter: fix ABI break due to experimental tag removal
@ 2020-01-29 12:29 Ferruh Yigit
  2020-01-29 14:46 ` Bruce Richardson
                   ` (3 more replies)
  0 siblings, 4 replies; 71+ messages in thread
From: Ferruh Yigit @ 2020-01-29 12:29 UTC (permalink / raw)
  To: Neil Horman, Cristian Dumitrescu, Eelco Chaudron
  Cc: dev, Thomas Monjalon, Luca Boccassi, David Marchand,
	Bruce Richardson, Ian Stokes

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)

Updated meson build system to allow the versioning,
'use_function_versioning = true', not sure why it was disabled by
default.

Fixes: 30512af820fe ("meter: remove experimental flag from RFC4115 trTCM API")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
Cc: Neil Horman <nhorman@tuxdriver.com>
Cc: Thomas Monjalon <thomas@monjalon.net>
Cc: Luca Boccassi <bluca@debian.org>
Cc: David Marchand <david.marchand@redhat.com>
Cc: Bruce Richardson <bruce.richardson@intel.com>
Cc: Ian Stokes <ian.stokes@intel.com>
Cc: Eelco Chaudron <echaudro@redhat.com>

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/rte_meter.c                  | 59 ++++++++++++++++++-
 lib/librte_meter/rte_meter_version.map        |  8 +++
 lib/meson.build                               |  2 +-
 5 files changed, 71 insertions(+), 5 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/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 <rte_common.h>
 #include <rte_log.h>
 #include <rte_cycles.h>
+#include <rte_function_versioning.h>
 
 #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;
+};
diff --git a/lib/meson.build b/lib/meson.build
index 0af3efab2..553964831 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -48,7 +48,7 @@ foreach l:libraries
 	reason = '<unknown reason>' # set if build == false to explain why
 	name = l
 	allow_experimental_apis = false
-	use_function_versioning = false
+	use_function_versioning = true
 	sources = []
 	headers = []
 	includes = []
-- 
2.24.1


^ permalink raw reply	[flat|nested] 71+ messages in thread

end of thread, other threads:[~2020-05-19 14:24 UTC | newest]

Thread overview: 71+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-29 12:29 [dpdk-dev] [RFC] meter: fix ABI break due to experimental tag removal Ferruh Yigit
2020-01-29 14:46 ` Bruce Richardson
2020-01-29 14:57 ` Andrzej Ostruszka
2020-01-29 16:25   ` Ferruh Yigit
2020-01-29 16:30     ` Andrzej Ostruszka
2020-01-29 16:40       ` Ferruh Yigit
2020-01-29 16:43 ` [dpdk-dev] [RFC v2] " Ferruh Yigit
2020-01-29 17:49   ` Andrzej Ostruszka
2020-01-30 12:33   ` Thomas Monjalon
2020-01-30 12:57     ` Luca Boccassi
2020-01-30 14:17       ` Thomas Monjalon
2020-01-30 14:21         ` Luca Boccassi
2020-01-30 15:55           ` Thomas Monjalon
2020-01-30 16:04             ` Luca Boccassi
2020-01-30 16:15               ` Eelco Chaudron
2020-01-30 20:20                 ` Thomas Monjalon
2020-02-03 11:10                   ` Eelco Chaudron
2020-01-31  9:25     ` Ferruh Yigit
2020-05-13 12:11   ` [dpdk-dev] [PATCH] meter: provide experimental alias of API for old apps Ferruh Yigit
2020-05-13 16:30     ` Thomas Monjalon
2020-05-13 17:37       ` Ferruh Yigit
2020-05-13 18:05     ` [dpdk-dev] [PATCH v2] " Ferruh Yigit
2020-05-14  8:44       ` Ray Kinsella
2020-05-14 11:53         ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
2020-05-14 11:52     ` [dpdk-dev] [PATCH v3] " Ferruh Yigit
2020-05-14 15:10       ` Ray Kinsella
2020-05-14 15:32       ` David Marchand
2020-05-14 15:56         ` Ray Kinsella
2020-05-14 16:07         ` Ferruh Yigit
2020-05-14 16:30           ` David Marchand
2020-05-14 16:11     ` [dpdk-dev] [PATCH v4] " Ferruh Yigit
2020-05-15 13:31       ` Thomas Monjalon
2020-05-15 14:41         ` Ray Kinsella
2020-05-15 15:03         ` Ray Kinsella
2020-05-15 14:36       ` [dpdk-dev] [PATCH v5] abi: " Ray Kinsella
2020-05-15 15:01       ` [dpdk-dev] [PATCH v6] " Ray Kinsella
2020-05-16 11:53         ` Neil Horman
2020-05-18 17:18           ` Thomas Monjalon
2020-05-18 17:34             ` Ferruh Yigit
2020-05-18 17:51               ` Thomas Monjalon
2020-05-18 18:32                 ` Ferruh Yigit
2020-05-19 14:13                   ` Ray Kinsella
2020-05-19 14:14             ` Ray Kinsella
2020-05-17 19:52       ` [dpdk-dev] [PATCH v4] meter: " Dumitrescu, Cristian
2020-05-18  6:29         ` Ray Kinsella
2020-05-18  9:22           ` Thomas Monjalon
2020-05-18  9:30             ` Ray Kinsella
2020-05-18 10:46               ` Thomas Monjalon
2020-05-18 11:18                 ` Dumitrescu, Cristian
2020-05-18 11:49                   ` Ray Kinsella
2020-05-18 11:48                 ` Ray Kinsella
2020-05-18 12:13                   ` Thomas Monjalon
2020-05-18 13:06                     ` Ray Kinsella
2020-05-18 18:30     ` [dpdk-dev] [PATCH v5] " Ferruh Yigit
2020-05-19 12:16     ` [dpdk-dev] [PATCH v6] " Ferruh Yigit
2020-05-19 13:26       ` Dumitrescu, Cristian
2020-05-19 14:24         ` Thomas Monjalon
2020-05-19 14:22       ` Ray Kinsella
2020-02-02 18:53 ` [dpdk-dev] [RFC] meter: fix ABI break due to experimental tag removal Neil Horman
2020-02-03 12:53   ` Ferruh Yigit
2020-02-04 12:02     ` Neil Horman
2020-02-05 10:04       ` Luca Boccassi
2020-02-05 11:32         ` Neil Horman
2020-02-13 17:40           ` Ray Kinsella
2020-02-14  2:40             ` Neil Horman
2020-02-14 11:36               ` Bruce Richardson
2020-02-14 20:48                 ` Neil Horman
2020-02-14 21:52                   ` Bruce Richardson
2020-02-15 13:43                     ` Neil Horman
2020-02-17 14:23                   ` Ray Kinsella
2020-02-17 15:37                     ` Neil Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).