patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH] net/mlx5: fix GRE item matching
@ 2021-11-24  4:32 Alexander Kozyrev
  2021-11-24  8:16 ` Gregory Etelson
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Alexander Kozyrev @ 2021-11-24  4:32 UTC (permalink / raw)
  To: dev; +Cc: stable, rasland, viacheslavo, matan, getelson

GRE protocol type is implicitly set in the matching translation in case
an application doesn't specify any type explicitly in a flow rule.
It is extracted from the inner header type, but this type may be absent.
In this case, GRE item matching is broken. Check if we have the inner
header type before setting it to allow matching on all GRE packets.

Fixes: be26e81bfc1c ("net/mlx5: fix GRE protocol type translation")
Cc: stable@dpdk.org

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 9d4bd0560c..7bb092ea9f 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -8823,8 +8823,9 @@ flow_dv_translate_item_gre(void *matcher, void *key,
 	protocol_v = rte_be_to_cpu_16(gre_v->protocol);
 	if (!protocol_m) {
 		/* Force next protocol to prevent matchers duplication */
-		protocol_m = 0xFFFF;
 		protocol_v = mlx5_translate_tunnel_etypes(pattern_flags);
+		if (protocol_v)
+			protocol_m = 0xFFFF;
 	}
 	MLX5_SET(fte_match_set_misc, misc_m, gre_protocol, protocol_m);
 	MLX5_SET(fte_match_set_misc, misc_v, gre_protocol,
-- 
2.18.2


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

* RE: [PATCH] net/mlx5: fix GRE item matching
  2021-11-24  4:32 [PATCH] net/mlx5: fix GRE item matching Alexander Kozyrev
@ 2021-11-24  8:16 ` Gregory Etelson
  2021-11-24  8:48   ` Gregory Etelson
  2021-11-24 10:14 ` Slava Ovsiienko
  2021-11-24 13:05 ` Raslan Darawsheh
  2 siblings, 1 reply; 5+ messages in thread
From: Gregory Etelson @ 2021-11-24  8:16 UTC (permalink / raw)
  To: Alexander Kozyrev; +Cc: stable, Raslan Darawsheh, Slava Ovsiienko, Matan Azrad

Hello Alexander,

> GRE protocol type is implicitly set in the
> matching translation in case
> an application doesn't specify any type explicitly
> in a flow rule.
> It is extracted from the inner header type, but
> this type may be absent.
> In this case, GRE item matching is broken. Check
> if we have the inner
> header type before setting it to allow matching
> on all GRE packets.
> 
> Fixes: be26e81bfc1c ("net/mlx5: fix GRE protocol
> type translation")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Alexander Kozyrev
> <akozyrev@nvidia.com>
> ---
>  drivers/net/mlx5/mlx5_flow_dv.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_flow_dv.c
> b/drivers/net/mlx5/mlx5_flow_dv.c
> index 9d4bd0560c..7bb092ea9f 100644
> --- a/drivers/net/mlx5/mlx5_flow_dv.c
> +++ b/drivers/net/mlx5/mlx5_flow_dv.c
> @@ -8823,8 +8823,9 @@
> flow_dv_translate_item_gre(void *matcher, void
> *key,
>  	protocol_v = rte_be_to_cpu_16(gre_v-
> >protocol);
>  	if (!protocol_m) {
>  		/* Force next protocol to prevent
> matchers duplication */
> -		protocol_m = 0xFFFF;
>  		protocol_v =
> mlx5_translate_tunnel_etypes(pattern_flags);
> +		if (protocol_v)
> +			protocol_m = 0xFFFF;
>  	}
>  	MLX5_SET(fte_match_set_misc, misc_m,
> gre_protocol, protocol_m);
>  	MLX5_SET(fte_match_set_misc, misc_v,
> gre_protocol,
> --
> 2.18.2

The main idea of the  be26e81bfc1c ("net/mlx5: fix GRE protocol type translation") patch
was to *always* force GRE protocol mask. Otherwise we get back to the original issue that patch has solved.

Regards,
Gregory 

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

* RE: [PATCH] net/mlx5: fix GRE item matching
  2021-11-24  8:16 ` Gregory Etelson
@ 2021-11-24  8:48   ` Gregory Etelson
  0 siblings, 0 replies; 5+ messages in thread
From: Gregory Etelson @ 2021-11-24  8:48 UTC (permalink / raw)
  To: Alexander Kozyrev; +Cc: stable, Raslan Darawsheh, Slava Ovsiienko, Matan Azrad

Hello Alex,

Your patch is correct.
Please ignore my previous email.

Regards,
Gregory

> -----Original Message-----
> From: Gregory Etelson
> Sent: Wednesday, November 24, 2021 10:16
> To: Alexander Kozyrev <akozyrev@nvidia.com>
> Cc: stable@dpdk.org; Raslan Darawsheh
> <rasland@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>; Matan Azrad
> <matan@nvidia.com>
> Subject: RE: [PATCH] net/mlx5: fix GRE item
> matching
> 
> Hello Alexander,
> 
> > GRE protocol type is implicitly set in the
> > matching translation in case
> > an application doesn't specify any type
> explicitly
> > in a flow rule.
> > It is extracted from the inner header type, but
> > this type may be absent.
> > In this case, GRE item matching is broken.
> Check
> > if we have the inner
> > header type before setting it to allow matching
> > on all GRE packets.
> >
> > Fixes: be26e81bfc1c ("net/mlx5: fix GRE
> protocol
> > type translation")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Alexander Kozyrev
> > <akozyrev@nvidia.com>
> > ---
> >  drivers/net/mlx5/mlx5_flow_dv.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/mlx5/mlx5_flow_dv.c
> > b/drivers/net/mlx5/mlx5_flow_dv.c
> > index 9d4bd0560c..7bb092ea9f 100644
> > --- a/drivers/net/mlx5/mlx5_flow_dv.c
> > +++ b/drivers/net/mlx5/mlx5_flow_dv.c
> > @@ -8823,8 +8823,9 @@
> > flow_dv_translate_item_gre(void *matcher,
> void
> > *key,
> >  	protocol_v = rte_be_to_cpu_16(gre_v-
> > >protocol);
> >  	if (!protocol_m) {
> >  		/* Force next protocol to prevent
> > matchers duplication */
> > -		protocol_m = 0xFFFF;
> >  		protocol_v =
> > mlx5_translate_tunnel_etypes(pattern_flags);
> > +		if (protocol_v)
> > +			protocol_m = 0xFFFF;
> >  	}
> >  	MLX5_SET(fte_match_set_misc, misc_m,
> > gre_protocol, protocol_m);
> >  	MLX5_SET(fte_match_set_misc, misc_v,
> > gre_protocol,
> > --
> > 2.18.2
> 
> The main idea of the  be26e81bfc1c ("net/mlx5:
> fix GRE protocol type translation") patch
> was to *always* force GRE protocol mask.
> Otherwise we get back to the original issue that
> patch has solved.
> 
> Regards,
> Gregory

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

* RE: [PATCH] net/mlx5: fix GRE item matching
  2021-11-24  4:32 [PATCH] net/mlx5: fix GRE item matching Alexander Kozyrev
  2021-11-24  8:16 ` Gregory Etelson
@ 2021-11-24 10:14 ` Slava Ovsiienko
  2021-11-24 13:05 ` Raslan Darawsheh
  2 siblings, 0 replies; 5+ messages in thread
From: Slava Ovsiienko @ 2021-11-24 10:14 UTC (permalink / raw)
  To: Alexander Kozyrev, dev
  Cc: stable, Raslan Darawsheh, Matan Azrad, Gregory Etelson

> -----Original Message-----
> From: Alexander Kozyrev <akozyrev@nvidia.com>
> Sent: Wednesday, November 24, 2021 6:33
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Raslan Darawsheh <rasland@nvidia.com>; Slava
> Ovsiienko <viacheslavo@nvidia.com>; Matan Azrad <matan@nvidia.com>;
> Gregory Etelson <getelson@nvidia.com>
> Subject: [PATCH] net/mlx5: fix GRE item matching
> 
> GRE protocol type is implicitly set in the matching translation in case an
> application doesn't specify any type explicitly in a flow rule.
> It is extracted from the inner header type, but this type may be absent.
> In this case, GRE item matching is broken. Check if we have the inner header
> type before setting it to allow matching on all GRE packets.
> 
> Fixes: be26e81bfc1c ("net/mlx5: fix GRE protocol type translation")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>


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

* RE: [PATCH] net/mlx5: fix GRE item matching
  2021-11-24  4:32 [PATCH] net/mlx5: fix GRE item matching Alexander Kozyrev
  2021-11-24  8:16 ` Gregory Etelson
  2021-11-24 10:14 ` Slava Ovsiienko
@ 2021-11-24 13:05 ` Raslan Darawsheh
  2 siblings, 0 replies; 5+ messages in thread
From: Raslan Darawsheh @ 2021-11-24 13:05 UTC (permalink / raw)
  To: Alexander Kozyrev, dev
  Cc: stable, Slava Ovsiienko, Matan Azrad, Gregory Etelson

Hi,


> -----Original Message-----
> From: Alexander Kozyrev <akozyrev@nvidia.com>
> Sent: Wednesday, November 24, 2021 6:33 AM
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Raslan Darawsheh <rasland@nvidia.com>; Slava
> Ovsiienko <viacheslavo@nvidia.com>; Matan Azrad <matan@nvidia.com>;
> Gregory Etelson <getelson@nvidia.com>
> Subject: [PATCH] net/mlx5: fix GRE item matching
> 
> GRE protocol type is implicitly set in the matching translation in case
> an application doesn't specify any type explicitly in a flow rule.
> It is extracted from the inner header type, but this type may be absent.
> In this case, GRE item matching is broken. Check if we have the inner
> header type before setting it to allow matching on all GRE packets.
> 
> Fixes: be26e81bfc1c ("net/mlx5: fix GRE protocol type translation")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
> ---

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

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

end of thread, other threads:[~2021-11-24 13:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-24  4:32 [PATCH] net/mlx5: fix GRE item matching Alexander Kozyrev
2021-11-24  8:16 ` Gregory Etelson
2021-11-24  8:48   ` Gregory Etelson
2021-11-24 10:14 ` Slava Ovsiienko
2021-11-24 13:05 ` Raslan Darawsheh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).