patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH 19.11 6/6] net/mlx5: fix GENEVE and VXLAN-GPE flow item matching
@ 2021-12-02 16:04 Gregory Etelson
  2021-12-03  6:06 ` Christian Ehrhardt
  0 siblings, 1 reply; 2+ messages in thread
From: Gregory Etelson @ 2021-12-02 16:04 UTC (permalink / raw)
  To: stable, getelson
  Cc: Alexander Kozyrev, Viacheslav Ovsiienko, Matan Azrad, Shahaf Shuler

From: Alexander Kozyrev <akozyrev@nvidia.com>

[ upstream commit 94421842de9a821778b95b928945ed8ea382302d ]

GENEVE and VXLAN-GPE item matching is done similarly to GRE matching.
Users can skip the specification of the protocol type and expect that
this type is deducted from the inner header type automatically.
But the inner header type may not be specified in order to match all the
protocol types. In this case, PMD should not specify the protocol type.
Check if we have the inner header type before setting the protocol type.

Fixes: 690391dd0e8b ("net/mlx5: fix GENEVE protocol type translation")
Fixes: 861fa3796f75 ("net/mlx5: fix VXLAN-GPE next protocol translation")
Cc: stable@dpdk.org

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index cd55deaf56..4766ce155d 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -6119,7 +6119,6 @@ flow_dv_translate_item_vxlan_gpe(void *matcher, void *key,
 	m_protocol = vxlan_m->protocol;
 	v_protocol = vxlan_v->protocol;
 	if (!m_protocol) {
-		m_protocol = 0xff;
 		/* Force next protocol to ensure next headers parsing. */
 		if (pattern_flags & MLX5_FLOW_LAYER_INNER_L2)
 			v_protocol = RTE_VXLAN_GPE_TYPE_ETH;
@@ -6127,6 +6126,8 @@ flow_dv_translate_item_vxlan_gpe(void *matcher, void *key,
 			v_protocol = RTE_VXLAN_GPE_TYPE_IPV4;
 		else if (pattern_flags & MLX5_FLOW_LAYER_INNER_L3_IPV6)
 			v_protocol = RTE_VXLAN_GPE_TYPE_IPV6;
+		if (v_protocol)
+			m_protocol = 0xFF;
 	}
 	MLX5_SET(fte_match_set_misc3, misc_m,
 		 outer_vxlan_gpe_next_protocol, m_protocol);
@@ -6197,8 +6198,9 @@ flow_dv_translate_item_geneve(void *matcher, void *key,
 	protocol_v = rte_be_to_cpu_16(geneve_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, geneve_protocol_type, protocol_m);
 	MLX5_SET(fte_match_set_misc, misc_v, geneve_protocol_type,
-- 
2.34.0


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

* Re: [PATCH 19.11 6/6] net/mlx5: fix GENEVE and VXLAN-GPE flow item matching
  2021-12-02 16:04 [PATCH 19.11 6/6] net/mlx5: fix GENEVE and VXLAN-GPE flow item matching Gregory Etelson
@ 2021-12-03  6:06 ` Christian Ehrhardt
  0 siblings, 0 replies; 2+ messages in thread
From: Christian Ehrhardt @ 2021-12-03  6:06 UTC (permalink / raw)
  To: Gregory Etelson
  Cc: stable, Alexander Kozyrev, Viacheslav Ovsiienko, Matan Azrad,
	Shahaf Shuler

On Thu, Dec 2, 2021 at 5:04 PM Gregory Etelson <getelson@nvidia.com> wrote:
>
> From: Alexander Kozyrev <akozyrev@nvidia.com>
>
> [ upstream commit 94421842de9a821778b95b928945ed8ea382302d ]

Thank you for the backports,
patch 2 of the series was already applied - the other 5 I added now.

> GENEVE and VXLAN-GPE item matching is done similarly to GRE matching.
> Users can skip the specification of the protocol type and expect that
> this type is deducted from the inner header type automatically.
> But the inner header type may not be specified in order to match all the
> protocol types. In this case, PMD should not specify the protocol type.
> Check if we have the inner header type before setting the protocol type.
>
> Fixes: 690391dd0e8b ("net/mlx5: fix GENEVE protocol type translation")
> Fixes: 861fa3796f75 ("net/mlx5: fix VXLAN-GPE next protocol translation")
> Cc: stable@dpdk.org
>
> Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
> ---
>  drivers/net/mlx5/mlx5_flow_dv.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
> index cd55deaf56..4766ce155d 100644
> --- a/drivers/net/mlx5/mlx5_flow_dv.c
> +++ b/drivers/net/mlx5/mlx5_flow_dv.c
> @@ -6119,7 +6119,6 @@ flow_dv_translate_item_vxlan_gpe(void *matcher, void *key,
>         m_protocol = vxlan_m->protocol;
>         v_protocol = vxlan_v->protocol;
>         if (!m_protocol) {
> -               m_protocol = 0xff;
>                 /* Force next protocol to ensure next headers parsing. */
>                 if (pattern_flags & MLX5_FLOW_LAYER_INNER_L2)
>                         v_protocol = RTE_VXLAN_GPE_TYPE_ETH;
> @@ -6127,6 +6126,8 @@ flow_dv_translate_item_vxlan_gpe(void *matcher, void *key,
>                         v_protocol = RTE_VXLAN_GPE_TYPE_IPV4;
>                 else if (pattern_flags & MLX5_FLOW_LAYER_INNER_L3_IPV6)
>                         v_protocol = RTE_VXLAN_GPE_TYPE_IPV6;
> +               if (v_protocol)
> +                       m_protocol = 0xFF;
>         }
>         MLX5_SET(fte_match_set_misc3, misc_m,
>                  outer_vxlan_gpe_next_protocol, m_protocol);
> @@ -6197,8 +6198,9 @@ flow_dv_translate_item_geneve(void *matcher, void *key,
>         protocol_v = rte_be_to_cpu_16(geneve_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, geneve_protocol_type, protocol_m);
>         MLX5_SET(fte_match_set_misc, misc_v, geneve_protocol_type,
> --
> 2.34.0
>


-- 
Christian Ehrhardt
Staff Engineer, Ubuntu Server
Canonical Ltd

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

end of thread, other threads:[~2021-12-03  6:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-02 16:04 [PATCH 19.11 6/6] net/mlx5: fix GENEVE and VXLAN-GPE flow item matching Gregory Etelson
2021-12-03  6:06 ` Christian Ehrhardt

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