DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Bing Zhao <bingz@nvidia.com>
To: <dsosnowski@nvidia.com>, <viacheslavo@nvidia.com>,
	<orika@nvidia.com>, <suanmingm@nvidia.com>, <matan@nvidia.com>
Cc: <dev@dpdk.org>, <stable@dpdk.org>
Subject: [PATCH] net/mlx5/hws: fix strict eCPRI matching
Date: Wed, 11 Nov 2026 10:11:28 +0200	[thread overview]
Message-ID: <20261111081128.6924-1-bingz@nvidia.com> (raw)

The shared flex-parser field helper adds implicit ESP protocol and
UDP port matches in strict mode. Typed eCPRI patterns also use this
helper, so Ethernet eCPRI rules acquire an unrelated IP protocol 50
condition and miss their packets. Untyped eCPRI patterns skip the
helper and continue to match.

Remove the ESP-specific conditions from the generic helper and drop
its unused item index argument. Keep the existing strict-mode ESP
matching in the dedicated ESP item converter unchanged.

Fixes: f2f75ffe14a5 ("net/mlx5/hws: fix ESP header match in strict mode")
Cc: stable@dpdk.org

Signed-off-by: Bing Zhao <bingz@nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_definer.c | 33 +++------------------------
 1 file changed, 3 insertions(+), 30 deletions(-)

diff --git a/drivers/net/mlx5/hws/mlx5dr_definer.c b/drivers/net/mlx5/hws/mlx5dr_definer.c
index 7400b8f252..c56a53fd67 100644
--- a/drivers/net/mlx5/hws/mlx5dr_definer.c
+++ b/drivers/net/mlx5/hws/mlx5dr_definer.c
@@ -2548,8 +2548,7 @@ mlx5dr_definer_conv_item_meter_color(struct mlx5dr_definer_conv_data *cd,
 
 static struct mlx5dr_definer_fc *
 mlx5dr_definer_get_flex_parser_fc(struct mlx5dr_definer_conv_data *cd,
-				  uint32_t byte_off,
-				  int item_idx)
+				  uint32_t byte_off)
 {
 	uint32_t byte_off_fp7 = MLX5_BYTE_OFF(definer_hl, flex_parser.flex_parser_7);
 	uint32_t byte_off_fp0 = MLX5_BYTE_OFF(definer_hl, flex_parser.flex_parser_0);
@@ -2562,32 +2561,6 @@ mlx5dr_definer_get_flex_parser_fc(struct mlx5dr_definer_conv_data *cd,
 		return NULL;
 	}
 
-	/* To match on ESP we must match on ip_protocol and optionally on l4_dport */
-	if (!cd->relaxed) {
-		bool over_udp;
-
-		fc = &cd->fc[DR_CALC_FNAME(IP_PROTOCOL, false)];
-		over_udp = fc->tag_set == &mlx5dr_definer_udp_protocol_set;
-
-		if (over_udp) {
-			fc = &cd->fc[DR_CALC_FNAME(L4_DPORT, false)];
-			if (!fc->tag_set) {
-				fc->item_idx = item_idx;
-				fc->tag_mask_set = &mlx5dr_definer_ones_set;
-				fc->tag_set = &mlx5dr_definer_ipsec_udp_port_set;
-				DR_CALC_SET(fc, eth_l4, destination_port, false);
-			}
-		} else {
-			fc = &cd->fc[DR_CALC_FNAME(IP_PROTOCOL, false)];
-			if (!fc->tag_set) {
-				fc->item_idx = item_idx;
-				fc->tag_set = &mlx5dr_definer_ipsec_protocol_set;
-				fc->tag_mask_set = &mlx5dr_definer_ones_set;
-				DR_CALC_SET(fc, eth_l3, protocol_next_header, false);
-			}
-		}
-	}
-
 	idx = (byte_off_fp0 - byte_off) / (sizeof(uint32_t));
 	fname += (enum mlx5dr_definer_fname)idx;
 	fc = &cd->fc[fname];
@@ -2639,7 +2612,7 @@ mlx5dr_definer_conv_item_ipv6_routing_ext(struct mlx5dr_definer_conv_data *cd,
 
 	if (m->hdr.next_hdr || m->hdr.type || m->hdr.segments_left) {
 		byte_off = flow_hw_get_srh_flex_parser_byte_off_from_ctx(cd->ctx);
-		fc = mlx5dr_definer_get_flex_parser_fc(cd, byte_off, item_idx);
+		fc = mlx5dr_definer_get_flex_parser_fc(cd, byte_off);
 		if (!fc)
 			return rte_errno;
 
@@ -2761,7 +2734,7 @@ mlx5dr_definer_conv_item_ecpri(struct mlx5dr_definer_conv_data *cd,
 		if (!mask)
 			continue;
 		mask = htobe32(mask);
-		fc = mlx5dr_definer_get_flex_parser_fc(cd, byte_off[i], item_idx);
+		fc = mlx5dr_definer_get_flex_parser_fc(cd, byte_off[i]);
 		if (!fc)
 			return rte_errno;
 
-- 
2.43.0


             reply	other threads:[~2026-11-11  8:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-11  8:11 Bing Zhao [this message]
2026-11-11 13:11 ` [PATCH] net/mlx5/hws: fix strict eCPRI matching 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=20261111081128.6924-1-bingz@nvidia.com \
    --to=bingz@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=dsosnowski@nvidia.com \
    --cc=matan@nvidia.com \
    --cc=orika@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