RDMA/mlx5: Access the prio bypass inside the FDB flow table namespace
Now that we have a specific prio inside the FDB namespace allow retrieving it from the RDMA side. Signed-off-by: Mark Bloch <markb@mellanox.com> Reviewed-by: Maor Gottlieb <maorg@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
This commit is contained in:
parent
2e5b8a0116
commit
13a4376568
|
@ -3809,11 +3809,16 @@ _get_flow_table(struct mlx5_ib_dev *dev,
|
||||||
bool mcast)
|
bool mcast)
|
||||||
{
|
{
|
||||||
struct mlx5_flow_namespace *ns = NULL;
|
struct mlx5_flow_namespace *ns = NULL;
|
||||||
struct mlx5_ib_flow_prio *prio;
|
struct mlx5_ib_flow_prio *prio = NULL;
|
||||||
int max_table_size;
|
int max_table_size = 0;
|
||||||
u32 flags = 0;
|
u32 flags = 0;
|
||||||
int priority;
|
int priority;
|
||||||
|
|
||||||
|
if (mcast)
|
||||||
|
priority = MLX5_IB_FLOW_MCAST_PRIO;
|
||||||
|
else
|
||||||
|
priority = ib_prio_to_core_prio(fs_matcher->priority, false);
|
||||||
|
|
||||||
if (fs_matcher->ns_type == MLX5_FLOW_NAMESPACE_BYPASS) {
|
if (fs_matcher->ns_type == MLX5_FLOW_NAMESPACE_BYPASS) {
|
||||||
max_table_size = BIT(MLX5_CAP_FLOWTABLE_NIC_RX(dev->mdev,
|
max_table_size = BIT(MLX5_CAP_FLOWTABLE_NIC_RX(dev->mdev,
|
||||||
log_max_ft_size));
|
log_max_ft_size));
|
||||||
|
@ -3822,29 +3827,33 @@ _get_flow_table(struct mlx5_ib_dev *dev,
|
||||||
if (MLX5_CAP_FLOWTABLE_NIC_RX(dev->mdev,
|
if (MLX5_CAP_FLOWTABLE_NIC_RX(dev->mdev,
|
||||||
reformat_l3_tunnel_to_l2))
|
reformat_l3_tunnel_to_l2))
|
||||||
flags |= MLX5_FLOW_TABLE_TUNNEL_EN_REFORMAT;
|
flags |= MLX5_FLOW_TABLE_TUNNEL_EN_REFORMAT;
|
||||||
} else { /* Can only be MLX5_FLOW_NAMESPACE_EGRESS */
|
} else if (fs_matcher->ns_type == MLX5_FLOW_NAMESPACE_EGRESS) {
|
||||||
max_table_size = BIT(MLX5_CAP_FLOWTABLE_NIC_TX(dev->mdev,
|
max_table_size = BIT(
|
||||||
log_max_ft_size));
|
MLX5_CAP_FLOWTABLE_NIC_TX(dev->mdev, log_max_ft_size));
|
||||||
if (MLX5_CAP_FLOWTABLE_NIC_TX(dev->mdev, reformat))
|
if (MLX5_CAP_FLOWTABLE_NIC_TX(dev->mdev, reformat))
|
||||||
flags |= MLX5_FLOW_TABLE_TUNNEL_EN_REFORMAT;
|
flags |= MLX5_FLOW_TABLE_TUNNEL_EN_REFORMAT;
|
||||||
|
} else if (fs_matcher->ns_type == MLX5_FLOW_NAMESPACE_FDB) {
|
||||||
|
max_table_size = BIT(
|
||||||
|
MLX5_CAP_ESW_FLOWTABLE_FDB(dev->mdev, log_max_ft_size));
|
||||||
|
priority = FDB_BYPASS_PATH;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (max_table_size < MLX5_FS_MAX_ENTRIES)
|
if (max_table_size < MLX5_FS_MAX_ENTRIES)
|
||||||
return ERR_PTR(-ENOMEM);
|
return ERR_PTR(-ENOMEM);
|
||||||
|
|
||||||
if (mcast)
|
|
||||||
priority = MLX5_IB_FLOW_MCAST_PRIO;
|
|
||||||
else
|
|
||||||
priority = ib_prio_to_core_prio(fs_matcher->priority, false);
|
|
||||||
|
|
||||||
ns = mlx5_get_flow_namespace(dev->mdev, fs_matcher->ns_type);
|
ns = mlx5_get_flow_namespace(dev->mdev, fs_matcher->ns_type);
|
||||||
if (!ns)
|
if (!ns)
|
||||||
return ERR_PTR(-ENOTSUPP);
|
return ERR_PTR(-ENOTSUPP);
|
||||||
|
|
||||||
if (fs_matcher->ns_type == MLX5_FLOW_NAMESPACE_BYPASS)
|
if (fs_matcher->ns_type == MLX5_FLOW_NAMESPACE_BYPASS)
|
||||||
prio = &dev->flow_db->prios[priority];
|
prio = &dev->flow_db->prios[priority];
|
||||||
else
|
else if (fs_matcher->ns_type == MLX5_FLOW_NAMESPACE_EGRESS)
|
||||||
prio = &dev->flow_db->egress_prios[priority];
|
prio = &dev->flow_db->egress_prios[priority];
|
||||||
|
else if (fs_matcher->ns_type == MLX5_FLOW_NAMESPACE_FDB)
|
||||||
|
prio = &dev->flow_db->fdb;
|
||||||
|
|
||||||
|
if (!prio)
|
||||||
|
return ERR_PTR(-EINVAL);
|
||||||
|
|
||||||
if (prio->flow_table)
|
if (prio->flow_table)
|
||||||
return prio;
|
return prio;
|
||||||
|
|
|
@ -194,6 +194,7 @@ struct mlx5_ib_flow_db {
|
||||||
struct mlx5_ib_flow_prio egress_prios[MLX5_IB_NUM_FLOW_FT];
|
struct mlx5_ib_flow_prio egress_prios[MLX5_IB_NUM_FLOW_FT];
|
||||||
struct mlx5_ib_flow_prio sniffer[MLX5_IB_NUM_SNIFFER_FTS];
|
struct mlx5_ib_flow_prio sniffer[MLX5_IB_NUM_SNIFFER_FTS];
|
||||||
struct mlx5_ib_flow_prio egress[MLX5_IB_NUM_EGRESS_FTS];
|
struct mlx5_ib_flow_prio egress[MLX5_IB_NUM_EGRESS_FTS];
|
||||||
|
struct mlx5_ib_flow_prio fdb;
|
||||||
struct mlx5_flow_table *lag_demux_ft;
|
struct mlx5_flow_table *lag_demux_ft;
|
||||||
/* Protect flow steering bypass flow tables
|
/* Protect flow steering bypass flow tables
|
||||||
* when add/del flow rules.
|
* when add/del flow rules.
|
||||||
|
|
Loading…
Reference in New Issue