diff options
author | Erez Shitrit <erezsh@nvidia.com> | 2023-03-13 15:10:20 +0300 |
---|---|---|
committer | Saeed Mahameed <saeedm@nvidia.com> | 2023-09-20 09:33:08 +0300 |
commit | f6f46e7173cb4613b84a0c0640355826ee39654f (patch) | |
tree | d4005f1a3da95cb487d6d198f40b9e2e473d8cf6 /drivers/net/ethernet/mellanox/mlx5/core | |
parent | 653b7eb9d74426397c95061fd57da3063625af65 (diff) | |
download | linux-f6f46e7173cb4613b84a0c0640355826ee39654f.tar.xz |
net/mlx5: DR, Add check for multi destination FTE
The driver should not allow rule that forward to more than one FT in TX
flow unless there is a specific support from the FW.
Signed-off-by: Erez Shitrit <erezsh@nvidia.com>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Reviewed-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c index 5b83da08692d..7179542e9164 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c @@ -55,6 +55,12 @@ static const char *dr_action_id_to_str(enum mlx5dr_action_type action_id) return action_type_to_str[action_id]; } +static bool mlx5dr_action_supp_fwd_fdb_multi_ft(struct mlx5_core_dev *dev) +{ + return (MLX5_CAP_ESW_FLOWTABLE(dev, fdb_multi_path_any_table_limit_regc) || + MLX5_CAP_ESW_FLOWTABLE(dev, fdb_multi_path_any_table)); +} + static const enum dr_action_valid_state next_action_state[DR_ACTION_DOMAIN_MAX][DR_ACTION_STATE_MAX][DR_ACTION_TYP_MAX] = { [DR_ACTION_DOMAIN_NIC_INGRESS] = { @@ -1167,6 +1173,7 @@ mlx5dr_action_create_mult_dest_tbl(struct mlx5dr_domain *dmn, struct mlx5dr_action **ref_actions; struct mlx5dr_action *action; bool reformat_req = false; + u16 num_dst_ft = 0; u32 num_of_ref = 0; u32 ref_act_cnt; int ret; @@ -1210,6 +1217,12 @@ mlx5dr_action_create_mult_dest_tbl(struct mlx5dr_domain *dmn, break; case DR_ACTION_TYP_FT: + if (num_dst_ft && + !mlx5dr_action_supp_fwd_fdb_multi_ft(dmn->mdev)) { + mlx5dr_dbg(dmn, "multiple FT destinations not supported\n"); + goto free_ref_actions; + } + num_dst_ft++; hw_dests[i].type = MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE; if (dest_action->dest_tbl->is_fw_tbl) hw_dests[i].ft_id = dest_action->dest_tbl->fw_tbl.id; |