From: Maayan Kashani <mkashani@nvidia.com>
To: <dev@dpdk.org>
Cc: <mkashani@nvidia.com>, <rasland@nvidia.com>,
Dariusz Sosnowski <dsosnowski@nvidia.com>,
Viacheslav Ovsiienko <viacheslavo@nvidia.com>,
"Bing Zhao" <bingz@nvidia.com>, Ori Kam <orika@nvidia.com>,
Suanming Mou <suanmingm@nvidia.com>,
Matan Azrad <matan@nvidia.com>
Subject: [PATCH 1/2] common/mlx5: add mlx5 prefix to remaining internal functions
Date: Thu, 27 Nov 2025 13:29:17 +0200 [thread overview]
Message-ID: <20251127112919.53710-1-mkashani@nvidia.com> (raw)
Several internal functions in the mlx5 driver were missing
the mlx5_ prefix, which could lead to symbol conflicts when linking.
This patch adds the proper prefix to all remaining global symbols
in common mlx5.
The following function categories were updated:
haswell_broadwell_cpu->mlx5_haswell_broadwell_cpu
Global variable:
atomic_sn is now static.
Bugzilla ID: 1794
Signed-off-by: Maayan Kashani <mkashani@nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
---
drivers/common/mlx5/linux/mlx5_common_os.c | 2 +-
drivers/common/mlx5/linux/mlx5_common_verbs.c | 2 +-
drivers/common/mlx5/linux/mlx5_nl.c | 2 +-
drivers/common/mlx5/mlx5_common.c | 14 +++++++-------
drivers/common/mlx5/mlx5_common.h | 2 +-
drivers/common/mlx5/windows/mlx5_common_os.c | 2 +-
6 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/common/mlx5/linux/mlx5_common_os.c b/drivers/common/mlx5/linux/mlx5_common_os.c
index 2867e216188..7d0c9492524 100644
--- a/drivers/common/mlx5/linux/mlx5_common_os.c
+++ b/drivers/common/mlx5/linux/mlx5_common_os.c
@@ -994,7 +994,7 @@ mlx5_os_wrapped_mkey_create(void *ctx, void *pd, uint32_t pdn, void *addr,
struct mlx5_devx_obj *mkey;
struct ibv_mr *ibv_mr = mlx5_glue->reg_mr(pd, addr, length,
IBV_ACCESS_LOCAL_WRITE |
- (haswell_broadwell_cpu ? 0 :
+ (mlx5_haswell_broadwell_cpu ? 0 :
IBV_ACCESS_RELAXED_ORDERING));
if (!ibv_mr) {
diff --git a/drivers/common/mlx5/linux/mlx5_common_verbs.c b/drivers/common/mlx5/linux/mlx5_common_verbs.c
index 98260df4707..2322d9d0335 100644
--- a/drivers/common/mlx5/linux/mlx5_common_verbs.c
+++ b/drivers/common/mlx5/linux/mlx5_common_verbs.c
@@ -115,7 +115,7 @@ mlx5_common_verbs_reg_mr(void *pd, void *addr, size_t length,
ibv_mr = mlx5_glue->reg_mr(pd, addr, length,
IBV_ACCESS_LOCAL_WRITE |
- (haswell_broadwell_cpu ? 0 :
+ (mlx5_haswell_broadwell_cpu ? 0 :
IBV_ACCESS_RELAXED_ORDERING));
if (!ibv_mr)
return -1;
diff --git a/drivers/common/mlx5/linux/mlx5_nl.c b/drivers/common/mlx5/linux/mlx5_nl.c
index d53543a1132..4fbb67af21d 100644
--- a/drivers/common/mlx5/linux/mlx5_nl.c
+++ b/drivers/common/mlx5/linux/mlx5_nl.c
@@ -176,7 +176,7 @@ struct mlx5_nl_mac_addr {
int mac_n; /**< Number of addresses in the array. */
};
-RTE_ATOMIC(uint32_t) atomic_sn;
+static RTE_ATOMIC(uint32_t) atomic_sn;
/* Generate Netlink sequence number. */
#define MLX5_NL_SN_GENERATE (rte_atomic_fetch_add_explicit(&atomic_sn, 1, \
diff --git a/drivers/common/mlx5/mlx5_common.c b/drivers/common/mlx5/mlx5_common.c
index 84a93e7dbde..f71dbe46378 100644
--- a/drivers/common/mlx5/mlx5_common.c
+++ b/drivers/common/mlx5/mlx5_common.c
@@ -21,8 +21,8 @@
#include "mlx5_common_defs.h"
#include "mlx5_common_private.h"
-RTE_EXPORT_INTERNAL_SYMBOL(haswell_broadwell_cpu)
-uint8_t haswell_broadwell_cpu;
+RTE_EXPORT_INTERNAL_SYMBOL(mlx5_haswell_broadwell_cpu)
+uint8_t mlx5_haswell_broadwell_cpu;
/* Driver type key for new device global syntax. */
#define MLX5_DRIVER_KEY "driver"
@@ -1273,7 +1273,7 @@ mlx5_common_init(void)
/**
* This function is responsible of initializing the variable
- * haswell_broadwell_cpu by checking if the cpu is intel
+ * mlx5_haswell_broadwell_cpu by checking if the cpu is intel
* and reading the data returned from mlx5_cpu_id().
* since haswell and broadwell cpus don't have improved performance
* when using relaxed ordering we want to check the cpu type before
@@ -1299,7 +1299,7 @@ RTE_INIT_PRIO(mlx5_is_haswell_broadwell_cpu, LOG)
vendor = ebx;
max_level = eax;
if (max_level < 1) {
- haswell_broadwell_cpu = 0;
+ mlx5_haswell_broadwell_cpu = 0;
return;
}
mlx5_cpu_id(1, &eax, &ebx, &ecx, &edx);
@@ -1314,18 +1314,18 @@ RTE_INIT_PRIO(mlx5_is_haswell_broadwell_cpu, LOG)
if (brand_id == 0 && family == 0x6) {
for (i = 0; i < RTE_DIM(broadwell_models); i++)
if (model == broadwell_models[i]) {
- haswell_broadwell_cpu = 1;
+ mlx5_haswell_broadwell_cpu = 1;
return;
}
for (i = 0; i < RTE_DIM(haswell_models); i++)
if (model == haswell_models[i]) {
- haswell_broadwell_cpu = 1;
+ mlx5_haswell_broadwell_cpu = 1;
return;
}
}
}
#endif
- haswell_broadwell_cpu = 0;
+ mlx5_haswell_broadwell_cpu = 0;
}
/**
diff --git a/drivers/common/mlx5/mlx5_common.h b/drivers/common/mlx5/mlx5_common.h
index 9403385195d..311e862f05a 100644
--- a/drivers/common/mlx5/mlx5_common.h
+++ b/drivers/common/mlx5/mlx5_common.h
@@ -477,7 +477,7 @@ __rte_internal
void mlx5_translate_port_name(const char *port_name_in,
struct mlx5_switch_info *port_info_out);
void mlx5_glue_constructor(void);
-extern uint8_t haswell_broadwell_cpu;
+extern uint8_t mlx5_haswell_broadwell_cpu;
__rte_internal
void mlx5_common_init(void);
diff --git a/drivers/common/mlx5/windows/mlx5_common_os.c b/drivers/common/mlx5/windows/mlx5_common_os.c
index 7fac361460b..16fcc5f9fcc 100644
--- a/drivers/common/mlx5/windows/mlx5_common_os.c
+++ b/drivers/common/mlx5/windows/mlx5_common_os.c
@@ -402,7 +402,7 @@ mlx5_os_reg_mr(void *pd,
mkey_attr.size = length;
mkey_attr.umem_id = ((struct mlx5_devx_umem *)(obj))->umem_id;
mkey_attr.pd = mlx5_pd->pdn;
- if (!haswell_broadwell_cpu) {
+ if (!mlx5_haswell_broadwell_cpu) {
mkey_attr.relaxed_ordering_write = attr.relaxed_ordering_write;
mkey_attr.relaxed_ordering_read = attr.relaxed_ordering_read;
}
--
2.21.0
next reply other threads:[~2025-11-27 11:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-27 11:29 Maayan Kashani [this message]
2025-11-27 11:29 ` [PATCH 2/2] net/mlx5: " Maayan Kashani
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=20251127112919.53710-1-mkashani@nvidia.com \
--to=mkashani@nvidia.com \
--cc=bingz@nvidia.com \
--cc=dev@dpdk.org \
--cc=dsosnowski@nvidia.com \
--cc=matan@nvidia.com \
--cc=orika@nvidia.com \
--cc=rasland@nvidia.com \
--cc=suanmingm@nvidia.com \
--cc=viacheslavo@nvidia.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;
as well as URLs for NNTP newsgroup(s).