Skip to contentSkip to conversation

net/mlx5e: flower: check for unsupported control flags

PATCH Applied Asbjørn Sloth Tønnesen 6 participants 6 messages Apr 22, 2024 – May 3, 2024

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 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.

---

Changelog:

v2:
- remove existing FLOW_DIS_FIRST_FRAG "support" (requested by Jianbo)

v1: https://lore.kernel.org/netdev/[email protected]/

 drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +4 -6
index aeb32cb27182..30673292e15f 100644
@@ -2801,12 +2801,6 @@ static int __parse_cls_flower(struct mlx5e_priv *priv,
 		flow_rule_match_control(rule, &match);
 		addr_type = match.key->addr_type;
 
-		/* the HW doesn't support frag first/later */
-		if (match.mask->flags & FLOW_DIS_FIRST_FRAG) {
-			NL_SET_ERR_MSG_MOD(extack, "Match on frag first/later is not supported");
-			return -EOPNOTSUPP;
-		}
-
 		if (match.mask->flags & FLOW_DIS_IS_FRAGMENT) {
 			MLX5_SET(fte_match_set_lyr_2_4, headers_c, frag, 1);
 			MLX5_SET(fte_match_set_lyr_2_4, headers_v, frag,
@@ -2819,6 +2813,10 @@ static int __parse_cls_flower(struct mlx5e_priv *priv,
 			else
 				*match_level = MLX5_MATCH_L3;
 		}
+
+		if (!flow_rule_is_supp_control_flags(FLOW_DIS_IS_FRAGMENT,
+						     match.mask->flags, extack))
+			return -EOPNOTSUPP;
 	}
 
 	if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_BASIC)) {
Signature · 1 line
2.43.0
Reviewed-by on v2 1/1
#1 lore raw
Quoted 7 lines · Asbjørn Sloth Tønnesen

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.

Quoted 6 lines

Remove FLOW_DIS_FIRST_FRAG specific error message, and treat it as any other unsupported control flag.

Only compile-tested.

reviewer Reviewed-by on v2 1/1
#2 lore raw
In reply to Asbjørn Sloth Tønnesen
Quoted 7 lines · Asbjørn Sloth Tønnesen

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.

Quoted 6 lines

Remove FLOW_DIS_FIRST_FRAG specific error message, and treat it as any other unsupported control flag.

Only compile-tested.

Acked-by on v2 1/1
#3 lore raw
In reply to Asbjørn Sloth Tønnesen
Quoted 43 lines · Asbjørn Sloth Tønnesen

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.

---

Changelog:

v2:
- remove existing FLOW_DIS_FIRST_FRAG "support" (requested by Jianbo)

v1: https://lore.kernel.org/netdev/[email protected]/

  drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 10 ++++------
  1 file changed, 4 insertions(+), 6 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +0 -6
index aeb32cb27182..30673292e15f 100644
@@ -2801,12 +2801,6 @@ static int __parse_cls_flower(struct mlx5e_priv *priv,
  		flow_rule_match_control(rule, &match);
  		addr_type = match.key->addr_type;
 
-		/* the HW doesn't support frag first/later */
-		if (match.mask->flags & FLOW_DIS_FIRST_FRAG) {
-			NL_SET_ERR_MSG_MOD(extack, "Match on frag first/later is not supported");
-			return -EOPNOTSUPP;
-		}
-
  		if (match.mask->flags & FLOW_DIS_IS_FRAGMENT) {
  			MLX5_SET(fte_match_set_lyr_2_4, headers_c, frag, 1);
  			MLX5_SET(fte_match_set_lyr_2_4, headers_v, frag,

drivers/net/ethernet/mellanox/mlx5/core/en_tc.c static int __parse_cls_flower(struct mlx5e_priv *priv, · line 2822

Quoted 10 lines
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +4 -0
@@ -2819,6 +2813,10 @@ static int __parse_cls_flower(struct mlx5e_priv *priv,
  			else
  				*match_level = MLX5_MATCH_L3;
  		}
+
+		if (!flow_rule_is_supp_control_flags(FLOW_DIS_IS_FRAGMENT,
+						     match.mask->flags, extack))
+			return -EOPNOTSUPP;
  	}
 
  	if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_BASIC)) {
maintainer
#4 lore raw
Quoted 54 lines · Tariq Toukan
Quoted 52 lines · Asbjørn Sloth Tønnesen

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.

---

Changelog:

v2:
- remove existing FLOW_DIS_FIRST_FRAG "support" (requested by Jianbo)

v1: https://lore.kernel.org/netdev/[email protected]/

  drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 10 ++++------
  1 file changed, 4 insertions(+), 6 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +4 -6
index aeb32cb27182..30673292e15f 100644
@@ -2801,12 +2801,6 @@ static int __parse_cls_flower(struct mlx5e_priv *priv,
  		flow_rule_match_control(rule, &match);
  		addr_type = match.key->addr_type;
 
-		/* the HW doesn't support frag first/later */
-		if (match.mask->flags & FLOW_DIS_FIRST_FRAG) {
-			NL_SET_ERR_MSG_MOD(extack, "Match on frag first/later is not supported");
-			return -EOPNOTSUPP;
-		}
-
  		if (match.mask->flags & FLOW_DIS_IS_FRAGMENT) {
  			MLX5_SET(fte_match_set_lyr_2_4, headers_c, frag, 1);
  			MLX5_SET(fte_match_set_lyr_2_4, headers_v, frag,
@@ -2819,6 +2813,10 @@ static int __parse_cls_flower(struct mlx5e_priv *priv,
  			else
  				*match_level = MLX5_MATCH_L3;
  		}
+
+		if (!flow_rule_is_supp_control_flags(FLOW_DIS_IS_FRAGMENT,
+						     match.mask->flags, extack))
+			return -EOPNOTSUPP;
  	}
 
Quoted 3 lines

drivers/net/ethernet/mellanox/mlx5/core/en_tc.c static int __parse_cls_flower(struct mlx5e_priv *priv, · line 2822

Quoted 1 line
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +0 -0
  	if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_BASIC)) {

@Tariq/@Saeed: do you want to take this patch towards your tree and send or do you prefer we merge it directly? I tend to read the above ack as the 2nd option, but given this is only build tested I guess the first would be better...

Thanks,

Paolo

#5 lore raw
In reply to Asbjørn Sloth Tønnesen
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Mon, 22 Apr 2024 15:27:27 +0000 you wrote:

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.

[...]

Here is the summary with links:
- [net-next,v2] net/mlx5e: flower: check for unsupported control flags

    https://git.kernel.org/netdev/net-next/c/3d549c382297

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html