Commit 02943ac2 authored by Patrisious Haddad's avatar Patrisious Haddad Committed by Leon Romanovsky
Browse files

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: 52931f55 ("net/mlx5: fs, add multiple prios to RDMA TRANSPORT steering domain")
Signed-off-by: default avatarPatrisious Haddad <phaddad@nvidia.com>
Link: https://patch.msgid.link/78cf89b5d8452caf1e979350b30ada6904362f66.1751451780.git.leon@kernel.org


Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
parent 1f6da566
Loading
Loading
Loading
Loading
+18 −4
Original line number Diff line number Diff line
@@ -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)