DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 1/2] common/mlx5: add mlx5 prefix to remaining internal functions
@ 2025-11-27 11:29 Maayan Kashani
  2025-11-27 11:29 ` [PATCH 2/2] net/mlx5: " Maayan Kashani
  0 siblings, 1 reply; 2+ messages in thread
From: Maayan Kashani @ 2025-11-27 11:29 UTC (permalink / raw)
  To: dev
  Cc: mkashani, rasland, Dariusz Sosnowski, Viacheslav Ovsiienko,
	Bing Zhao, Ori Kam, Suanming Mou, Matan Azrad

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


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

end of thread, other threads:[~2025-11-27 11:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-27 11:29 [PATCH 1/2] common/mlx5: add mlx5 prefix to remaining internal functions Maayan Kashani
2025-11-27 11:29 ` [PATCH 2/2] net/mlx5: " Maayan Kashani

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).