Skip to contentSkip to conversation

net/mlx5: fs, fix RDMA TRANSPORT init cleanup flow

PATCH Applied Leon Romanovsky 2 participants 4 messages Jul 2, 2025

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/mlx5: fs, fix RDMA TRANSPORT init cleanup flow

From: Patrisious Haddad <[email protected]>

Failing during the initialization of root_namespace didn't cleanup the priorities of the namespace on which the failure occurred.

Properly cleanup said priorities on failure.

Fixes e6746b0c7423 ("net/mlx5: fs, add multiple prios to RDMA TRANSPORT steering domain")
---
 .../net/ethernet/mellanox/mlx5/core/fs_core.c | 22 +++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +18 -4
index 7f5608081ea0..424a6d168c53 100644
@@ -3247,6 +3247,7 @@ init_rdma_transport_rx_root_ns_one(struct mlx5_flow_steering *steering,
 {
 	struct mlx5_flow_root_namespace *root_ns;
 	struct fs_prio *prio;
+	int ret;
 	int i;
 
 	steering->rdma_transport_rx_root_ns[vport_idx] =
@@ -3258,11 +3259,17 @@ init_rdma_transport_rx_root_ns_one(struct mlx5_flow_steering *steering,
 
 	for (i = 0; i < MLX5_RDMA_TRANSPORT_BYPASS_PRIO; i++) {
 		prio = fs_create_prio(&root_ns->ns, i, 1);
-		if (IS_ERR(prio))
-			return PTR_ERR(prio);
+		if (IS_ERR(prio)) {
+			ret = PTR_ERR(prio);
+			goto err;
+		}
 	}
 	set_prio_attrs(root_ns);
 	return 0;
+
+err:
+	cleanup_root_ns(root_ns);
+	return ret;
 }
 
 static int
@@ -3271,6 +3278,7 @@ init_rdma_transport_tx_root_ns_one(struct mlx5_flow_steering *steering,
 {
 	struct mlx5_flow_root_namespace *root_ns;
 	struct fs_prio *prio;
+	int ret;
 	int i;
 
 	steering->rdma_transport_tx_root_ns[vport_idx] =
@@ -3282,11 +3290,17 @@ init_rdma_transport_tx_root_ns_one(struct mlx5_flow_steering *steering,
 
 	for (i = 0; i < MLX5_RDMA_TRANSPORT_BYPASS_PRIO; i++) {
 		prio = fs_create_prio(&root_ns->ns, i, 1);
-		if (IS_ERR(prio))
-			return PTR_ERR(prio);
+		if (IS_ERR(prio)) {
+			ret = PTR_ERR(prio);
+			goto err;
+		}
 	}
 	set_prio_attrs(root_ns);
 	return 0;
+
+err:
+	cleanup_root_ns(root_ns);
+	return ret;
 }
 
 static int init_rdma_transport_rx_root_ns(struct mlx5_flow_steering *steering)
Signature · 1 line
2.50.0
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Leon Romanovsky

From: Patrisious Haddad <[email protected]>

Failing during the initialization of root_namespace didn't cleanup the priorities of the namespace on which the failure occurred.

Properly cleanup said priorities on failure.

Fixes e6746b0c7423 ("net/mlx5: fs, add multiple prios to RDMA TRANSPORT steering domain")

Hi Leon and Patrisious,

Maybe there has been a rebase, there is something weird on my side, or for some reason it doesn't matter. But I see a different hash in mlx5-next [1].

Fixes 52931f55159e ("net/mlx5: fs, add multiple prios to RDMA TRANSPORT steering domain")

[1] https://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux.git/log/?h=mlx5-next

Quoted 2 lines

Otherwise, LGTM.

#2 lore raw
Quoted 17 lines · Simon Horman
Quoted 8 lines · Leon Romanovsky

From: Patrisious Haddad <[email protected]>

Failing during the initialization of root_namespace didn't cleanup the priorities of the namespace on which the failure occurred.

Properly cleanup said priorities on failure.

Fixes e6746b0c7423 ("net/mlx5: fs, add multiple prios to RDMA TRANSPORT steering domain")

Hi Leon and Patrisious,

Maybe there has been a rebase, there is something weird on my side, or for some reason it doesn't matter. But I see a different hash in mlx5-next [1].

Fixes 52931f55159e ("net/mlx5: fs, add multiple prios to RDMA TRANSPORT steering domain")
Quoted 8 lines

[1] https://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux.git/log/?h=mlx5-next

Quoted 2 lines

Otherwise, LGTM.

Thanks a lot, you are right about Fixes lines, I fixed it locally when applied the patch.

Quoted 1 line