Skip to content

Commit 3d549c3

Browse files
Asbjørn Sloth Tønnesenkuba-moo
authored andcommitted
net/mlx5e: flower: check for unsupported control flags
Use flow_rule_is_supp_control_flags() to reject filters with unsupported control flags. In case any unsupported control flags are masked, flow_rule_is_supp_control_flags() sets a NL extended error message, and we return -EOPNOTSUPP. Remove FLOW_DIS_FIRST_FRAG specific error message, and treat it as any other unsupported control flag. Only compile-tested. Signed-off-by: Asbjørn Sloth Tønnesen <ast@fiberby.net> Reviewed-by: Jianbo Liu <jianbol@nvidia.com> Reviewed-by: Simon Horman <horms@kernel.org> Acked-by: Tariq Toukan <tariqt@nvidia.com> Link: https://lore.kernel.org/r/20240422152728.175677-1-ast@fiberby.net Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent e958da0 commit 3d549c3

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

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

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2801,12 +2801,6 @@ static int __parse_cls_flower(struct mlx5e_priv *priv,
28012801
flow_rule_match_control(rule, &match);
28022802
addr_type = match.key->addr_type;
28032803

2804-
/* the HW doesn't support frag first/later */
2805-
if (match.mask->flags & FLOW_DIS_FIRST_FRAG) {
2806-
NL_SET_ERR_MSG_MOD(extack, "Match on frag first/later is not supported");
2807-
return -EOPNOTSUPP;
2808-
}
2809-
28102804
if (match.mask->flags & FLOW_DIS_IS_FRAGMENT) {
28112805
MLX5_SET(fte_match_set_lyr_2_4, headers_c, frag, 1);
28122806
MLX5_SET(fte_match_set_lyr_2_4, headers_v, frag,
@@ -2819,6 +2813,10 @@ static int __parse_cls_flower(struct mlx5e_priv *priv,
28192813
else
28202814
*match_level = MLX5_MATCH_L3;
28212815
}
2816+
2817+
if (!flow_rule_is_supp_control_flags(FLOW_DIS_IS_FRAGMENT,
2818+
match.mask->flags, extack))
2819+
return -EOPNOTSUPP;
28222820
}
28232821

28242822
if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_BASIC)) {

0 commit comments

Comments
 (0)