From: Dariusz Sosnowski <dsosnowski@nvidia.com>
To: Thomas Monjalon <thomas@monjalon.net>,
Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
Ori Kam <orika@nvidia.com>
Cc: <dev@dpdk.org>, David Marchand <david.marchand@redhat.com>,
"Bruce Richardson" <bruce.richardson@intel.com>,
Yu Jiang <yux.jiang@intel.com>
Subject: [PATCH 5/5] ethdev: fix promoted flow metadata symbols
Date: Tue, 23 Jun 2026 13:37:51 +0200 [thread overview]
Message-ID: <20260623113752.1100072-6-dsosnowski@nvidia.com> (raw)
In-Reply-To: <20260623113752.1100072-1-dsosnowski@nvidia.com>
Offending patch stabilized the following symbols:
- 1 function symbol:
- rte_flow_dynf_metadata_register
- 2 global variable symbols:
- rte_flow_dynf_metadata_offs
- rte_flow_dynf_metadata_mask
Any application using these flow metadata symbols,
which was linked dynamically against 25.11 version of ethdev
library and using current version of ethdev library
would fail on symbol resolution, because EXPERIMENTAL versions
were not exported.
Specifically, on application start up
variable symbol lookup error happens:
/tmp/dpdk-25.11/usr/local/bin/dpdk-testpmd:
symbol lookup error: /tmp/dpdk-25.11/usr/local/bin/dpdk-testpmd:
undefined symbol: rte_flow_dynf_metadata_offs, version EXPERIMENTAL
This error occurss because symbol lookup for global variables
happens on application startup.
This patch addresses that by adding versioned aliases
for the following variable symbols:
- rte_flow_dynf_metadata_offs
- rte_flow_dynf_metadata_mask
Versioned function symbols are also added
for rte_flow_dynf_metadata_register().
Bugzilla ID: 1957
Fixes: 4ee2f5c1cedf ("ethdev: promote flow metadata API to stable")
Reported-by: Yu Jiang <yux.jiang@intel.com>
Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
---
lib/ethdev/meson.build | 2 ++
lib/ethdev/rte_flow.c | 33 ++++++++++++++++++++++-----------
2 files changed, 24 insertions(+), 11 deletions(-)
diff --git a/lib/ethdev/meson.build b/lib/ethdev/meson.build
index 8ba6c708a2..63fd866af9 100644
--- a/lib/ethdev/meson.build
+++ b/lib/ethdev/meson.build
@@ -1,6 +1,8 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2017 Intel Corporation
+use_function_versioning = true
+
sources = files(
'ethdev_driver.c',
'ethdev_private.c',
diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c
index ec0fe08355..a8c01ffe8a 100644
--- a/lib/ethdev/rte_flow.c
+++ b/lib/ethdev/rte_flow.c
@@ -23,12 +23,20 @@
#define FLOW_LOG RTE_ETHDEV_LOG_LINE
/* Mbuf dynamic field name for metadata. */
-RTE_EXPORT_SYMBOL(rte_flow_dynf_metadata_offs)
-int32_t rte_flow_dynf_metadata_offs = -1;
+static int32_t rte_flow_dynf_metadata_offs_impl = -1;
+
+RTE_DEFAULT_SYMBOL_ALIAS(26, int32_t, rte_flow_dynf_metadata_offs,
+ rte_flow_dynf_metadata_offs_impl);
+RTE_VERSION_EXPERIMENTAL_SYMBOL_ALIAS(int32_t, rte_flow_dynf_metadata_offs,
+ rte_flow_dynf_metadata_offs_impl);
/* Mbuf dynamic field flag bit number for metadata. */
-RTE_EXPORT_SYMBOL(rte_flow_dynf_metadata_mask)
-uint64_t rte_flow_dynf_metadata_mask;
+static uint64_t rte_flow_dynf_metadata_mask_impl = 0;
+
+RTE_DEFAULT_SYMBOL_ALIAS(26, uint64_t, rte_flow_dynf_metadata_mask,
+ rte_flow_dynf_metadata_mask_impl);
+RTE_VERSION_EXPERIMENTAL_SYMBOL_ALIAS(uint64_t, rte_flow_dynf_metadata_mask,
+ rte_flow_dynf_metadata_mask_impl);
/**
* Flow elements description tables.
@@ -281,9 +289,7 @@ static const struct rte_flow_desc_data rte_flow_desc_action[] = {
MK_FLOW_ACTION(JUMP_TO_TABLE_INDEX, sizeof(struct rte_flow_action_jump_to_table_index)),
};
-RTE_EXPORT_SYMBOL(rte_flow_dynf_metadata_register)
-int
-rte_flow_dynf_metadata_register(void)
+RTE_DEFAULT_SYMBOL(26, int, rte_flow_dynf_metadata_register, (void))
{
int offset;
int flag;
@@ -303,19 +309,24 @@ rte_flow_dynf_metadata_register(void)
flag = rte_mbuf_dynflag_register(&desc_flag);
if (flag < 0)
goto error;
- rte_flow_dynf_metadata_offs = offset;
- rte_flow_dynf_metadata_mask = RTE_BIT64(flag);
+ rte_flow_dynf_metadata_offs_impl = offset;
+ rte_flow_dynf_metadata_mask_impl = RTE_BIT64(flag);
rte_flow_trace_dynf_metadata_register(offset, RTE_BIT64(flag));
return 0;
error:
- rte_flow_dynf_metadata_offs = -1;
- rte_flow_dynf_metadata_mask = UINT64_C(0);
+ rte_flow_dynf_metadata_offs_impl = -1;
+ rte_flow_dynf_metadata_mask_impl = UINT64_C(0);
return -rte_errno;
}
+RTE_VERSION_EXPERIMENTAL_SYMBOL(int, rte_flow_dynf_metadata_register, (void))
+{
+ return rte_flow_dynf_metadata_register();
+}
+
static inline void
fts_enter(struct rte_eth_dev *dev)
{
--
2.47.3
next prev parent reply other threads:[~2026-06-23 11:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-23 11:37 [PATCH 0/5] add versioned symbols for recently stabilized APIs Dariusz Sosnowski
2026-06-23 11:37 ` [PATCH 1/5] eal: fix macro for versioned experimental symbol Dariusz Sosnowski
2026-06-23 13:50 ` Stephen Hemminger
2026-06-23 11:37 ` [PATCH 2/5] drivers: support function versioning Dariusz Sosnowski
2026-06-23 11:37 ` [PATCH 3/5] net/mlx5: fix stabilized function versions Dariusz Sosnowski
2026-06-23 11:37 ` [PATCH 4/5] eal: support aliases for versioned variable symbols Dariusz Sosnowski
2026-06-23 11:37 ` Dariusz Sosnowski [this message]
2026-06-23 13:48 ` [PATCH 0/5] add versioned symbols for recently stabilized APIs Stephen Hemminger
2026-06-23 13:50 ` David Marchand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260623113752.1100072-6-dsosnowski@nvidia.com \
--to=dsosnowski@nvidia.com \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=bruce.richardson@intel.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=orika@nvidia.com \
--cc=thomas@monjalon.net \
--cc=yux.jiang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox