Commit a973f86b authored by Maor Gottlieb's avatar Maor Gottlieb Committed by Saeed Mahameed

RDMA/mlx5: Add support to multiple priorities for FDB rules

Currently, the driver ignores the user's priority for flow steering
rules in FDB namespace. Change it and create the rule in the right
priority.
It will allow to create FDB steering rules in up to 16 different
priorities.
Signed-off-by: default avatarMaor Gottlieb <maorg@nvidia.com>
Reviewed-by: default avatarMark Bloch <mbloch@nvidia.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
Acked-by: default avatarLeon Romanovsky <leonro@nvidia.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
parent c7d5fa10
...@@ -1517,7 +1517,7 @@ _get_flow_table(struct mlx5_ib_dev *dev, ...@@ -1517,7 +1517,7 @@ _get_flow_table(struct mlx5_ib_dev *dev,
reformat_l3_tunnel_to_l2) && reformat_l3_tunnel_to_l2) &&
esw_encap) esw_encap)
flags |= MLX5_FLOW_TABLE_TUNNEL_EN_REFORMAT; flags |= MLX5_FLOW_TABLE_TUNNEL_EN_REFORMAT;
priority = FDB_BYPASS_PATH; priority = fs_matcher->priority;
break; break;
case MLX5_FLOW_NAMESPACE_RDMA_RX: case MLX5_FLOW_NAMESPACE_RDMA_RX:
max_table_size = BIT( max_table_size = BIT(
...@@ -1547,7 +1547,7 @@ _get_flow_table(struct mlx5_ib_dev *dev, ...@@ -1547,7 +1547,7 @@ _get_flow_table(struct mlx5_ib_dev *dev,
prio = &dev->flow_db->egress_prios[priority]; prio = &dev->flow_db->egress_prios[priority];
break; break;
case MLX5_FLOW_NAMESPACE_FDB_BYPASS: case MLX5_FLOW_NAMESPACE_FDB_BYPASS:
prio = &dev->flow_db->fdb; prio = &dev->flow_db->fdb[priority];
break; break;
case MLX5_FLOW_NAMESPACE_RDMA_RX: case MLX5_FLOW_NAMESPACE_RDMA_RX:
prio = &dev->flow_db->rdma_rx[priority]; prio = &dev->flow_db->rdma_rx[priority];
......
...@@ -232,6 +232,7 @@ enum { ...@@ -232,6 +232,7 @@ enum {
#define MLX5_IB_NUM_FLOW_FT (MLX5_IB_FLOW_LEFTOVERS_PRIO + 1) #define MLX5_IB_NUM_FLOW_FT (MLX5_IB_FLOW_LEFTOVERS_PRIO + 1)
#define MLX5_IB_NUM_SNIFFER_FTS 2 #define MLX5_IB_NUM_SNIFFER_FTS 2
#define MLX5_IB_NUM_EGRESS_FTS 1 #define MLX5_IB_NUM_EGRESS_FTS 1
#define MLX5_IB_NUM_FDB_FTS MLX5_BY_PASS_NUM_REGULAR_PRIOS
struct mlx5_ib_flow_prio { struct mlx5_ib_flow_prio {
struct mlx5_flow_table *flow_table; struct mlx5_flow_table *flow_table;
unsigned int refcount; unsigned int refcount;
...@@ -276,7 +277,7 @@ struct mlx5_ib_flow_db { ...@@ -276,7 +277,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_ib_flow_prio fdb[MLX5_IB_NUM_FDB_FTS];
struct mlx5_ib_flow_prio rdma_rx[MLX5_IB_NUM_FLOW_FT]; struct mlx5_ib_flow_prio rdma_rx[MLX5_IB_NUM_FLOW_FT];
struct mlx5_ib_flow_prio rdma_tx[MLX5_IB_NUM_FLOW_FT]; struct mlx5_ib_flow_prio rdma_tx[MLX5_IB_NUM_FLOW_FT];
struct mlx5_ib_flow_prio opfcs[MLX5_IB_OPCOUNTER_MAX]; struct mlx5_ib_flow_prio opfcs[MLX5_IB_OPCOUNTER_MAX];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment