DPDK patches and discussions
 help / color / mirror / Atom feed
From: Dariusz Sosnowski <dsosnowski@nvidia.com>
To: 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>
Cc: <dev@dpdk.org>, Raslan Darawsheh <rasland@nvidia.com>
Subject: [PATCH] net/mlx5: fix next L3 protocol fetching
Date: Thu, 14 Mar 2024 11:59:02 +0100	[thread overview]
Message-ID: <20240314105902.399968-1-dsosnowski@nvidia.com> (raw)

During flow pattern validation in DV, the next protocol type
should be calculated if and only if protocol mask is defined.

Fixes: 1d7b7ec3a236 ("net/mlx5: remove code duplications")
Cc: getelson@nvidia.com

Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 815f74ec5c..d434c678c8 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -7524,9 +7524,9 @@ mlx5_flow_l3_next_protocol(const struct rte_flow_item *l3_item,
 	uint8_t next_protocol;
 
 	if (l3_item->mask != NULL && l3_item->spec != NULL) {
-		next_protocol = MLX5_L3_NEXT_PROTOCOL(l3_item, spec);
+		next_protocol = MLX5_L3_NEXT_PROTOCOL(l3_item, mask);
 		if (next_protocol)
-			next_protocol &= MLX5_L3_NEXT_PROTOCOL(l3_item, mask);
+			next_protocol &= MLX5_L3_NEXT_PROTOCOL(l3_item, spec);
 		else
 			next_protocol = 0xff;
 	} else if (key_type == MLX5_SET_MATCHER_HS_M && l3_item->mask != NULL) {
-- 
2.39.2


             reply	other threads:[~2024-03-14 11:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-14 10:59 Dariusz Sosnowski [this message]
2024-03-14 11:14 ` Raslan Darawsheh

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