mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-04 20:19:47 +08:00
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>
This commit is contained in:
parent
e04c78d86a
commit
52931f5515
@ -3245,34 +3245,48 @@ static int
|
|||||||
init_rdma_transport_rx_root_ns_one(struct mlx5_flow_steering *steering,
|
init_rdma_transport_rx_root_ns_one(struct mlx5_flow_steering *steering,
|
||||||
int vport_idx)
|
int vport_idx)
|
||||||
{
|
{
|
||||||
|
struct mlx5_flow_root_namespace *root_ns;
|
||||||
struct fs_prio *prio;
|
struct fs_prio *prio;
|
||||||
|
int i;
|
||||||
|
|
||||||
steering->rdma_transport_rx_root_ns[vport_idx] =
|
steering->rdma_transport_rx_root_ns[vport_idx] =
|
||||||
create_root_ns(steering, FS_FT_RDMA_TRANSPORT_RX);
|
create_root_ns(steering, FS_FT_RDMA_TRANSPORT_RX);
|
||||||
if (!steering->rdma_transport_rx_root_ns[vport_idx])
|
if (!steering->rdma_transport_rx_root_ns[vport_idx])
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
/* create 1 prio*/
|
root_ns = steering->rdma_transport_rx_root_ns[vport_idx];
|
||||||
prio = fs_create_prio(&steering->rdma_transport_rx_root_ns[vport_idx]->ns,
|
|
||||||
MLX5_RDMA_TRANSPORT_BYPASS_PRIO, 1);
|
for (i = 0; i < MLX5_RDMA_TRANSPORT_BYPASS_PRIO; i++) {
|
||||||
return PTR_ERR_OR_ZERO(prio);
|
prio = fs_create_prio(&root_ns->ns, i, 1);
|
||||||
|
if (IS_ERR(prio))
|
||||||
|
return PTR_ERR(prio);
|
||||||
|
}
|
||||||
|
set_prio_attrs(root_ns);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
init_rdma_transport_tx_root_ns_one(struct mlx5_flow_steering *steering,
|
init_rdma_transport_tx_root_ns_one(struct mlx5_flow_steering *steering,
|
||||||
int vport_idx)
|
int vport_idx)
|
||||||
{
|
{
|
||||||
|
struct mlx5_flow_root_namespace *root_ns;
|
||||||
struct fs_prio *prio;
|
struct fs_prio *prio;
|
||||||
|
int i;
|
||||||
|
|
||||||
steering->rdma_transport_tx_root_ns[vport_idx] =
|
steering->rdma_transport_tx_root_ns[vport_idx] =
|
||||||
create_root_ns(steering, FS_FT_RDMA_TRANSPORT_TX);
|
create_root_ns(steering, FS_FT_RDMA_TRANSPORT_TX);
|
||||||
if (!steering->rdma_transport_tx_root_ns[vport_idx])
|
if (!steering->rdma_transport_tx_root_ns[vport_idx])
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
/* create 1 prio*/
|
root_ns = steering->rdma_transport_tx_root_ns[vport_idx];
|
||||||
prio = fs_create_prio(&steering->rdma_transport_tx_root_ns[vport_idx]->ns,
|
|
||||||
MLX5_RDMA_TRANSPORT_BYPASS_PRIO, 1);
|
for (i = 0; i < MLX5_RDMA_TRANSPORT_BYPASS_PRIO; i++) {
|
||||||
return PTR_ERR_OR_ZERO(prio);
|
prio = fs_create_prio(&root_ns->ns, i, 1);
|
||||||
|
if (IS_ERR(prio))
|
||||||
|
return PTR_ERR(prio);
|
||||||
|
}
|
||||||
|
set_prio_attrs(root_ns);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int init_rdma_transport_rx_root_ns(struct mlx5_flow_steering *steering)
|
static int init_rdma_transport_rx_root_ns(struct mlx5_flow_steering *steering)
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
|
|
||||||
#define MLX5_SET_CFG(p, f, v) MLX5_SET(create_flow_group_in, p, f, v)
|
#define MLX5_SET_CFG(p, f, v) MLX5_SET(create_flow_group_in, p, f, v)
|
||||||
|
|
||||||
#define MLX5_RDMA_TRANSPORT_BYPASS_PRIO 0
|
#define MLX5_RDMA_TRANSPORT_BYPASS_PRIO 16
|
||||||
#define MLX5_FS_MAX_POOL_SIZE BIT(30)
|
#define MLX5_FS_MAX_POOL_SIZE BIT(30)
|
||||||
|
|
||||||
enum mlx5_flow_destination_type {
|
enum mlx5_flow_destination_type {
|
||||||
|
Loading…
Reference in New Issue
Block a user