Skip to content

Commit 02943ac

Browse files
PatrisiousHaddadrleon
authored andcommitted
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: 52931f5 ("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>
1 parent 1f6da56 commit 02943ac

1 file changed

Lines changed: 18 additions & 4 deletions

File tree

  • drivers/net/ethernet/mellanox/mlx5/core

drivers/net/ethernet/mellanox/mlx5/core/fs_core.c

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3247,6 +3247,7 @@ init_rdma_transport_rx_root_ns_one(struct mlx5_flow_steering *steering,
32473247
{
32483248
struct mlx5_flow_root_namespace *root_ns;
32493249
struct fs_prio *prio;
3250+
int ret;
32503251
int i;
32513252

32523253
steering->rdma_transport_rx_root_ns[vport_idx] =
@@ -3258,11 +3259,17 @@ init_rdma_transport_rx_root_ns_one(struct mlx5_flow_steering *steering,
32583259

32593260
for (i = 0; i < MLX5_RDMA_TRANSPORT_BYPASS_PRIO; i++) {
32603261
prio = fs_create_prio(&root_ns->ns, i, 1);
3261-
if (IS_ERR(prio))
3262-
return PTR_ERR(prio);
3262+
if (IS_ERR(prio)) {
3263+
ret = PTR_ERR(prio);
3264+
goto err;
3265+
}
32633266
}
32643267
set_prio_attrs(root_ns);
32653268
return 0;
3269+
3270+
err:
3271+
cleanup_root_ns(root_ns);
3272+
return ret;
32663273
}
32673274

32683275
static int
@@ -3271,6 +3278,7 @@ init_rdma_transport_tx_root_ns_one(struct mlx5_flow_steering *steering,
32713278
{
32723279
struct mlx5_flow_root_namespace *root_ns;
32733280
struct fs_prio *prio;
3281+
int ret;
32743282
int i;
32753283

32763284
steering->rdma_transport_tx_root_ns[vport_idx] =
@@ -3282,11 +3290,17 @@ init_rdma_transport_tx_root_ns_one(struct mlx5_flow_steering *steering,
32823290

32833291
for (i = 0; i < MLX5_RDMA_TRANSPORT_BYPASS_PRIO; i++) {
32843292
prio = fs_create_prio(&root_ns->ns, i, 1);
3285-
if (IS_ERR(prio))
3286-
return PTR_ERR(prio);
3293+
if (IS_ERR(prio)) {
3294+
ret = PTR_ERR(prio);
3295+
goto err;
3296+
}
32873297
}
32883298
set_prio_attrs(root_ns);
32893299
return 0;
3300+
3301+
err:
3302+
cleanup_root_ns(root_ns);
3303+
return ret;
32903304
}
32913305

32923306
static int init_rdma_transport_rx_root_ns(struct mlx5_flow_steering *steering)

0 commit comments

Comments
 (0)