summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrisious Haddad <phaddad@nvidia.com>2025-07-02 13:24:04 +0300
committerLeon Romanovsky <leon@kernel.org>2025-07-02 14:08:18 -0400
commit02943ac2f6fbba8fc5e57c57e7cbc2d7c67ebf0d (patch)
treebc442b5e4ad122a6f4ca6e4474adb2a9ec8c0269
parent1f6da56679d33c733aaee929fd9af962ad66edbd (diff)
net/mlx5: fs, fix RDMA TRANSPORT init cleanup flow
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: 52931f55159e ("net/mlx5: fs, add multiple prios to RDMA TRANSPORT steering domain") Signed-off-by: Patrisious Haddad <phaddad@nvidia.com> Link: https://patch.msgid.link/78cf89b5d8452caf1e979350b30ada6904362f66.1751451780.git.leon@kernel.org Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: Leon Romanovsky <leon@kernel.org>
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/fs_core.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
index 7f5608081ea0..424a6d168c53 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
@@ -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)