All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v2] net/mlx5e: flower: check for unsupported control flags
@ 2024-04-22 15:27 Asbjørn Sloth Tønnesen
  2024-04-23  3:54 ` Jianbo Liu
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Asbjørn Sloth Tønnesen @ 2024-04-22 15:27 UTC (permalink / raw
  To: netdev
  Cc: Asbjørn Sloth Tønnesen, linux-kernel, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Saeed Mahameed,
	Tariq Toukan, Leon Romanovsky, Jianbo Liu

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>
---

Changelog:

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

v1: https://lore.kernel.org/netdev/20240417135110.99900-1-ast@fiberby.net/

 drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
index aeb32cb27182..30673292e15f 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -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)) {
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next v2] net/mlx5e: flower: check for unsupported control flags
  2024-04-22 15:27 [PATCH net-next v2] net/mlx5e: flower: check for unsupported control flags Asbjørn Sloth Tønnesen
@ 2024-04-23  3:54 ` Jianbo Liu
  2024-04-23 14:08 ` Simon Horman
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Jianbo Liu @ 2024-04-23  3:54 UTC (permalink / raw
  To: ast@fiberby.net, netdev@vger.kernel.org
  Cc: davem@davemloft.net, Tariq Toukan, linux-kernel@vger.kernel.org,
	kuba@kernel.org, pabeni@redhat.com, edumazet@google.com,
	Saeed Mahameed, leon@kernel.org

On Mon, 2024-04-22 at 15:27 +0000, Asbjørn Sloth Tønnesen 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.
> 
> 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>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next v2] net/mlx5e: flower: check for unsupported control flags
  2024-04-22 15:27 [PATCH net-next v2] net/mlx5e: flower: check for unsupported control flags Asbjørn Sloth Tønnesen
  2024-04-23  3:54 ` Jianbo Liu
@ 2024-04-23 14:08 ` Simon Horman
  2024-04-30  5:15 ` Tariq Toukan
  2024-05-03  1:40 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 6+ messages in thread
From: Simon Horman @ 2024-04-23 14:08 UTC (permalink / raw
  To: Asbjørn Sloth Tønnesen
  Cc: netdev, linux-kernel, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Saeed Mahameed, Tariq Toukan,
	Leon Romanovsky, Jianbo Liu

On Mon, Apr 22, 2024 at 03:27:27PM +0000, Asbjørn Sloth Tønnesen 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.
> 
> 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: Simon Horman <horms@kernel.org>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next v2] net/mlx5e: flower: check for unsupported control flags
  2024-04-22 15:27 [PATCH net-next v2] net/mlx5e: flower: check for unsupported control flags Asbjørn Sloth Tønnesen
  2024-04-23  3:54 ` Jianbo Liu
  2024-04-23 14:08 ` Simon Horman
@ 2024-04-30  5:15 ` Tariq Toukan
  2024-05-02 11:30   ` Paolo Abeni
  2024-05-03  1:40 ` patchwork-bot+netdevbpf
  3 siblings, 1 reply; 6+ messages in thread
From: Tariq Toukan @ 2024-04-30  5:15 UTC (permalink / raw
  To: Asbjørn Sloth Tønnesen, netdev
  Cc: linux-kernel, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Saeed Mahameed, Tariq Toukan, Leon Romanovsky,
	Jianbo Liu



On 22/04/2024 18:27, Asbjørn Sloth Tønnesen 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.
> 
> 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>
> ---
> 
> Changelog:
> 
> v2:
> - remove existing FLOW_DIS_FIRST_FRAG "support" (requested by Jianbo)
> 
> v1: https://lore.kernel.org/netdev/20240417135110.99900-1-ast@fiberby.net/
> 
>   drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 10 ++++------
>   1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
> index aeb32cb27182..30673292e15f 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
> @@ -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)) {

Acked-by: Tariq Toukan <tariqt@nvidia.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next v2] net/mlx5e: flower: check for unsupported control flags
  2024-04-30  5:15 ` Tariq Toukan
@ 2024-05-02 11:30   ` Paolo Abeni
  0 siblings, 0 replies; 6+ messages in thread
From: Paolo Abeni @ 2024-05-02 11:30 UTC (permalink / raw
  To: Tariq Toukan, Asbjørn Sloth Tønnesen, netdev
  Cc: linux-kernel, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Saeed Mahameed, Tariq Toukan, Leon Romanovsky, Jianbo Liu

On Tue, 2024-04-30 at 08:15 +0300, Tariq Toukan wrote:
> 
> On 22/04/2024 18:27, Asbjørn Sloth Tønnesen 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.
> > 
> > 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>
> > ---
> > 
> > Changelog:
> > 
> > v2:
> > - remove existing FLOW_DIS_FIRST_FRAG "support" (requested by Jianbo)
> > 
> > v1: https://lore.kernel.org/netdev/20240417135110.99900-1-ast@fiberby.net/
> > 
> >   drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 10 ++++------
> >   1 file changed, 4 insertions(+), 6 deletions(-)
> > 
> > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
> > index aeb32cb27182..30673292e15f 100644
> > --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
> > +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
> > @@ -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)) {
> 
> Acked-by: Tariq Toukan <tariqt@nvidia.com>

@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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next v2] net/mlx5e: flower: check for unsupported control flags
  2024-04-22 15:27 [PATCH net-next v2] net/mlx5e: flower: check for unsupported control flags Asbjørn Sloth Tønnesen
                   ` (2 preceding siblings ...)
  2024-04-30  5:15 ` Tariq Toukan
@ 2024-05-03  1:40 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-05-03  1:40 UTC (permalink / raw
  To: =?utf-8?b?QXNiasO4cm4gU2xvdGggVMO4bm5lc2VuIDxhc3RAZmliZXJieS5uZXQ+?=
  Cc: netdev, linux-kernel, davem, edumazet, kuba, pabeni, saeedm,
	tariqt, leon, jianbol

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-05-03  1:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-22 15:27 [PATCH net-next v2] net/mlx5e: flower: check for unsupported control flags Asbjørn Sloth Tønnesen
2024-04-23  3:54 ` Jianbo Liu
2024-04-23 14:08 ` Simon Horman
2024-04-30  5:15 ` Tariq Toukan
2024-05-02 11:30   ` Paolo Abeni
2024-05-03  1:40 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.