patch 'net/mlx5: fix local and host representor name collision' has been queued to stable release 24.11.9

luca.boccassi at gmail.com luca.boccassi at gmail.com
Mon Nov 16 23:51:33 CET 2026


Hi,

FYI, your patch has been queued to stable release 24.11.9

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/18/26. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/bde1426c9b417fd89567d1b152cc86bc88d25c87

Thanks.

Luca Boccassi

---
>From bde1426c9b417fd89567d1b152cc86bc88d25c87 Mon Sep 17 00:00:00 2001
From: Bing Zhao <bingz at nvidia.com>
Date: Tue, 3 Nov 2026 08:19:59 +0000
Subject: [PATCH] net/mlx5: fix local and host representor name collision

[ upstream commit 993be65c9dacc5c219aed7f1afdb319d74ee20cc ]

On BlueField with a single uplink and host PF, representor port names
omit the controller index. A local representor (pf0vf0, controller 0)
and a host representor (c1pf0vf0, controller 1) with the same index
were both named <BDF>_representor_vf0. Whichever was probed first took
the name. Probing the other one returned EEXIST, which is treated as
already spawned, so the attach succeeded silently without a new port.

Add controller and PF indexes to the names of local representors on
BlueField, detected by the presence of a host PF, for example
<BDF>_representor_c0pf0vf0 and <BDF>_representor_c0pf0sf0.
The host PF representor can also report controller 0, so it is
excluded explicitly. Host representor names are unchanged.

Also log a notice when a requested representor is already spawned,
so that probing it again is no longer silent.

Fixes: cb95feefdd03 ("net/mlx5: support sub-function representor")

Signed-off-by: Bing Zhao <bingz at nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski at nvidia.com>
---
 drivers/net/mlx5/linux/mlx5_os.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c
index 829bd6cb24..747576fc85 100644
--- a/drivers/net/mlx5/linux/mlx5_os.c
+++ b/drivers/net/mlx5/linux/mlx5_os.c
@@ -1048,6 +1048,13 @@ is_hpf(const struct mlx5_dev_spawn_data *spawn)
 	       spawn->info.name_type == MLX5_PHYS_PORT_NAME_TYPE_PFHPF;
 }
 
+static bool
+is_bluefield_local_representor(const struct mlx5_dev_spawn_data *spawn)
+{
+	return spawn->info.representor && spawn->info.ctrl_num == 0 &&
+	       spawn->nb_hpfs > 0 && !is_hpf(spawn);
+}
+
 static int
 build_port_name(struct rte_device *dpdk_dev,
 		struct mlx5_dev_spawn_data *spawn,
@@ -1097,12 +1104,14 @@ build_port_name(struct rte_device *dpdk_dev,
 		 * 1. Device is a bond (VF-LAG).
 		 * 2. There are multiple uplinks (MPESW).
 		 * 3. There are multiple host PFs (BlueField socket direct).
+		 * 4. Port is a local (controller 0) representor on BlueField. Local and
+		 *    host representors with the same index would otherwise share a name.
 		 *
 		 * If none of these conditions apply, then it is assumed that
 		 * this device manages a single non-shared E-Switch with single controller,
 		 * where there is only one uplink/PF and one host PF (on BlueField).
 		 */
-		if (!is_standard_eswitch(spawn))
+		if (!is_standard_eswitch(spawn) || is_bluefield_local_representor(spawn))
 			ret = snprintf(name + written, name_sz - written,
 				       "_representor_c%dpf%d%s%u",
 				       spawn->info.ctrl_num,
@@ -1323,6 +1332,9 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
 		 */
 		if (mkvlist)
 			mlx5_port_args_set_used(name, port_id, mkvlist);
+		if (switch_info->representor)
+			DRV_LOG(NOTICE, "representor \"%s\" is already spawned as port %u",
+				name, port_id);
 		rte_errno = EEXIST;
 		return NULL;
 	}
-- 
2.47.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-11-16 22:52:17.280179184 +0000
+++ 0019-net-mlx5-fix-local-and-host-representor-name-collisi.patch	2026-11-16 22:52:16.436232107 +0000
@@ -1 +1 @@
-From 993be65c9dacc5c219aed7f1afdb319d74ee20cc Mon Sep 17 00:00:00 2001
+From bde1426c9b417fd89567d1b152cc86bc88d25c87 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 993be65c9dacc5c219aed7f1afdb319d74ee20cc ]
+
@@ -23 +24,0 @@
-Cc: stable at dpdk.org
@@ -32 +33 @@
-index 4c35737292..bf6f5c0ae2 100644
+index 829bd6cb24..747576fc85 100644
@@ -35 +36 @@
-@@ -1081,6 +1081,13 @@ is_hpf(const struct mlx5_dev_spawn_data *spawn)
+@@ -1048,6 +1048,13 @@ is_hpf(const struct mlx5_dev_spawn_data *spawn)
@@ -49 +50 @@
-@@ -1130,12 +1137,14 @@ build_port_name(struct rte_device *dpdk_dev,
+@@ -1097,12 +1104,14 @@ build_port_name(struct rte_device *dpdk_dev,
@@ -65 +66 @@
-@@ -1359,6 +1368,9 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
+@@ -1323,6 +1332,9 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,


More information about the stable mailing list