DPDK patches and discussions
 help / color / mirror / Atom feed
From: Maayan Kashani <mkashani@nvidia.com>
To: <dev@dpdk.org>
Cc: <mkashani@nvidia.com>, <dsosnowski@nvidia.com>,
	<rasland@nvidia.com>, <stable@dpdk.org>,
	Bing Zhao <bingz@nvidia.com>,
	Viacheslav Ovsiienko <viacheslavo@nvidia.com>,
	Ori Kam <orika@nvidia.com>, Suanming Mou <suanmingm@nvidia.com>,
	Matan Azrad <matan@nvidia.com>,
	Gregory Etelson <getelson@nvidia.com>
Subject: [PATCH] net/mlx5: fix failed to match on empty gre on root table
Date: Wed, 12 Mar 2025 13:23:48 +0200	[thread overview]
Message-ID: <20250312112348.61807-1-mkashani@nvidia.com> (raw)

The currnent implementation sets a gre mask with protocol masked in
case the user did not supply the protocol mask.
In template mode, for group 0, the gre translation was called
once with the mask and later with the value.
with gre open matcher(mask/value is null) default values were assigned
gre protocol mask=0xffff and gre protocol value=0.

Therefore gre packet with protocol value not equal zero,
will not match the rule.
Changed the default protocol mask to be zero instead of 0xffff.

In case of empty gre match,
this fix will ignore the protocol field matching,
gre will only be matched by the IP next header field in
previous header in packet.

Fixes: 25ab2cbba31d ("net/mlx5: fix GRE flow item translation for root table")
Cc: stable@dpdk.org

Signed-off-by: Maayan Kashani <mkashani@nvidia.com>
Acked-by: Bing Zhao <bingz@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index c77041317b4..3473c6f7713 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -9850,7 +9850,7 @@ flow_dv_translate_item_gre(void *key, const struct rte_flow_item *item,
 	/* HWS mask logic only */
 	if (key_type & MLX5_SET_MATCHER_HS_M) {
 		if (!gre_m)
-			gre_m = &rte_flow_item_gre_mask;
+			gre_m = &empty_gre;
 		gre_v = gre_m;
 	} else if (!gre_v) {
 		gre_v = &empty_gre;
-- 
2.21.0


             reply	other threads:[~2025-03-12 11:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-12 11:23 Maayan Kashani [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-03-12  9:55 Maayan Kashani

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=20250312112348.61807-1-mkashani@nvidia.com \
    --to=mkashani@nvidia.com \
    --cc=bingz@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=dsosnowski@nvidia.com \
    --cc=getelson@nvidia.com \
    --cc=matan@nvidia.com \
    --cc=orika@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=stable@dpdk.org \
    --cc=suanmingm@nvidia.com \
    --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).