Skip to content

Commit 52931f5

Browse files
PatrisiousHaddadrleon
authored andcommitted
net/mlx5: fs, add multiple prios to RDMA TRANSPORT steering domain
RDMA TRANSPORT domains were initially limited to a single priority. This change allows the domains to have multiple priorities, making it possible to add several rules and control the order in which they're evaluated. Signed-off-by: Patrisious Haddad <phaddad@nvidia.com> Reviewed-by: Mark Bloch <mbloch@nvidia.com> Link: https://patch.msgid.link/b299cbb4c8678a33da6e6b6988b5bf6145c54b88.1750148083.git.leon@kernel.org Signed-off-by: Leon Romanovsky <leon@kernel.org>
1 parent e04c78d commit 52931f5

2 files changed

Lines changed: 23 additions & 9 deletions

File tree

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

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

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3245,34 +3245,48 @@ static int
32453245
init_rdma_transport_rx_root_ns_one(struct mlx5_flow_steering *steering,
32463246
int vport_idx)
32473247
{
3248+
struct mlx5_flow_root_namespace *root_ns;
32483249
struct fs_prio *prio;
3250+
int i;
32493251

32503252
steering->rdma_transport_rx_root_ns[vport_idx] =
32513253
create_root_ns(steering, FS_FT_RDMA_TRANSPORT_RX);
32523254
if (!steering->rdma_transport_rx_root_ns[vport_idx])
32533255
return -ENOMEM;
32543256

3255-
/* create 1 prio*/
3256-
prio = fs_create_prio(&steering->rdma_transport_rx_root_ns[vport_idx]->ns,
3257-
MLX5_RDMA_TRANSPORT_BYPASS_PRIO, 1);
3258-
return PTR_ERR_OR_ZERO(prio);
3257+
root_ns = steering->rdma_transport_rx_root_ns[vport_idx];
3258+
3259+
for (i = 0; i < MLX5_RDMA_TRANSPORT_BYPASS_PRIO; i++) {
3260+
prio = fs_create_prio(&root_ns->ns, i, 1);
3261+
if (IS_ERR(prio))
3262+
return PTR_ERR(prio);
3263+
}
3264+
set_prio_attrs(root_ns);
3265+
return 0;
32593266
}
32603267

32613268
static int
32623269
init_rdma_transport_tx_root_ns_one(struct mlx5_flow_steering *steering,
32633270
int vport_idx)
32643271
{
3272+
struct mlx5_flow_root_namespace *root_ns;
32653273
struct fs_prio *prio;
3274+
int i;
32663275

32673276
steering->rdma_transport_tx_root_ns[vport_idx] =
32683277
create_root_ns(steering, FS_FT_RDMA_TRANSPORT_TX);
32693278
if (!steering->rdma_transport_tx_root_ns[vport_idx])
32703279
return -ENOMEM;
32713280

3272-
/* create 1 prio*/
3273-
prio = fs_create_prio(&steering->rdma_transport_tx_root_ns[vport_idx]->ns,
3274-
MLX5_RDMA_TRANSPORT_BYPASS_PRIO, 1);
3275-
return PTR_ERR_OR_ZERO(prio);
3281+
root_ns = steering->rdma_transport_tx_root_ns[vport_idx];
3282+
3283+
for (i = 0; i < MLX5_RDMA_TRANSPORT_BYPASS_PRIO; i++) {
3284+
prio = fs_create_prio(&root_ns->ns, i, 1);
3285+
if (IS_ERR(prio))
3286+
return PTR_ERR(prio);
3287+
}
3288+
set_prio_attrs(root_ns);
3289+
return 0;
32763290
}
32773291

32783292
static int init_rdma_transport_rx_root_ns(struct mlx5_flow_steering *steering)

include/linux/mlx5/fs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
#define MLX5_SET_CFG(p, f, v) MLX5_SET(create_flow_group_in, p, f, v)
4242

43-
#define MLX5_RDMA_TRANSPORT_BYPASS_PRIO 0
43+
#define MLX5_RDMA_TRANSPORT_BYPASS_PRIO 16
4444
#define MLX5_FS_MAX_POOL_SIZE BIT(30)
4545

4646
enum mlx5_flow_destination_type {

0 commit comments

Comments
 (0)