patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Gregory Etelson <getelson@nvidia.com>
To: <getelson@nvidia.com>
Cc: <matan@nvidia.com>, <orika@mellanox.com>, <shahafs@nvidia.com>,
	<stable@dpdk.org>, <viacheslavo@nvidia.com>,
	Christian Ehrhardt <christian.ehrhardt@canonical.com>,
	Alexander Kozyrev <akozyrev@nvidia.com>
Subject: [PATCH 19.11 v2 2/2] net/mlx5: fix GRE flow item matching
Date: Mon, 6 Dec 2021 12:39:07 +0200	[thread overview]
Message-ID: <20211206103907.29893-1-getelson@nvidia.com> (raw)
In-Reply-To: <20211202160314.26638-1-getelson@nvidia.com>

From: Alexander Kozyrev <akozyrev@nvidia.com>

[ upstream commit 9e61533df27fc4d76080da20a7e8f9c9e7e1b90f ]

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>
---
 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 a65a670045..2c7d5c7c02 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -5936,8 +5936,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.34.0


      parent reply	other threads:[~2021-12-06 10:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-02 16:03 [PATCH 19.11 4/6] net/mlx5: fix GRE protocol type translation Gregory Etelson
2021-12-06  9:54 ` Christian Ehrhardt
2021-12-06  9:57   ` Christian Ehrhardt
2021-12-06 10:10     ` Gregory Etelson
2021-12-06 10:38 ` [PATCH 19.11 v2 1/2] " Gregory Etelson
2021-12-06 10:39 ` Gregory Etelson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211206103907.29893-1-getelson@nvidia.com \
    --to=getelson@nvidia.com \
    --cc=akozyrev@nvidia.com \
    --cc=christian.ehrhardt@canonical.com \
    --cc=matan@nvidia.com \
    --cc=orika@mellanox.com \
    --cc=shahafs@nvidia.com \
    --cc=stable@dpdk.org \
    --cc=viacheslavo@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).