patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Kevin Traynor <ktraynor@redhat.com>
To: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Cc: dpdk stable <stable@dpdk.org>
Subject: patch 'net/mlx5: fix flex flow item header length' has been queued to stable release 24.11.4
Date: Tue, 25 Nov 2025 15:05:53 +0000	[thread overview]
Message-ID: <20251125150558.232595-4-ktraynor@redhat.com> (raw)
In-Reply-To: <20251125150558.232595-1-ktraynor@redhat.com>

Hi,

FYI, your patch has been queued to stable release 24.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/28/25. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/1935158d6558c55a1f67f06a3995d3453c89aa20

Thanks.

Kevin

---
From 1935158d6558c55a1f67f06a3995d3453c89aa20 Mon Sep 17 00:00:00 2001
From: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Date: Tue, 18 Nov 2025 16:57:06 +0200
Subject: [PATCH] net/mlx5: fix flex flow item header length

[ upstream commit a2234609bf7e4f5bb1ad8f6f60c5f574f32c3558 ]

There is the updated firmware providing the new capability
bit "header_length_field_offset_mode". If this bit is set
the length field offset in flex parser configuration should
not be adjusted by the supported field mask left margin,
and the bit "header_length_field_offset_mode" should be set
in configuration command on the flex parser creation
firmware call.

Fixes: b04b06f4cb3f ("net/mlx5: fix flex item header length field translation")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/common/mlx5/mlx5_devx_cmds.c |  4 ++++
 drivers/common/mlx5/mlx5_devx_cmds.h |  2 ++
 drivers/common/mlx5/mlx5_prm.h       |  8 ++++++--
 drivers/net/mlx5/mlx5.c              | 12 +++++++++---
 drivers/net/mlx5/mlx5_flow_flex.c    |  3 ++-
 5 files changed, 23 insertions(+), 6 deletions(-)

diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c b/drivers/common/mlx5/mlx5_devx_cmds.c
index a75f011750..3b4da3db9b 100644
--- a/drivers/common/mlx5/mlx5_devx_cmds.c
+++ b/drivers/common/mlx5/mlx5_devx_cmds.c
@@ -744,4 +744,6 @@ mlx5_devx_cmd_create_flex_parser(void *ctx,
 	MLX5_SET(parse_graph_flex, flex, header_length_mode,
 		 data->header_length_mode);
+	MLX5_SET(parse_graph_flex, flex, header_length_field_offset_mode,
+		 data->header_length_field_offset_mode);
 	MLX5_SET64(parse_graph_flex, flex, modify_field_select,
 		   data->modify_field_select);
@@ -871,4 +873,6 @@ mlx5_devx_cmd_query_hca_parse_graph_node_cap
 	attr->header_length_mask_width = MLX5_GET(parse_graph_node_cap, hcattr,
 						  header_length_mask_width);
+	attr->header_length_field_mode_wa = !MLX5_GET(parse_graph_node_cap, hcattr,
+						      header_length_field_offset_mode);
 	/* Get the max supported samples from HCA CAP 2 */
 	hcattr = mlx5_devx_get_hca_cap(ctx, in, out, &rc,
diff --git a/drivers/common/mlx5/mlx5_devx_cmds.h b/drivers/common/mlx5/mlx5_devx_cmds.h
index f523bf8529..9e67c16a4c 100644
--- a/drivers/common/mlx5/mlx5_devx_cmds.h
+++ b/drivers/common/mlx5/mlx5_devx_cmds.h
@@ -120,4 +120,5 @@ struct mlx5_hca_flex_attr {
 	uint8_t  zero_size_supported:1;
 	uint8_t  sample_id_in_out:1;
+	uint8_t  header_length_field_mode_wa:1;
 	uint16_t max_base_header_length;
 	uint8_t  max_sample_base_offset;
@@ -631,4 +632,5 @@ struct mlx5_devx_graph_node_attr {
 	uint32_t header_length_field_shift:4;
 	uint32_t header_length_field_offset:16;
+	uint32_t header_length_field_offset_mode:1;
 	uint32_t header_length_field_mask;
 	struct mlx5_devx_match_sample_attr sample[MLX5_GRAPH_NODE_SAMPLE_NUM];
diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h
index 4f45b104ae..43b48a96de 100644
--- a/drivers/common/mlx5/mlx5_prm.h
+++ b/drivers/common/mlx5/mlx5_prm.h
@@ -2112,5 +2112,7 @@ struct mlx5_ifc_parse_graph_node_cap_bits {
 	u8 max_num_arc_out[0x08];
 	u8 max_num_sample[0x08];
-	u8 reserved_at_78[0x03];
+	u8 reserved_at_78[0x01];
+	u8 header_length_field_offset_mode[0x1];
+	u8 reserved_at_79[0x01];
 	u8 parse_graph_anchor[0x1];
 	u8 reserved_at_7c[0x01];
@@ -4921,5 +4923,7 @@ struct mlx5_ifc_parse_graph_flex_bits {
 	u8 reserved_at_160[0x12];
 	u8 head_anchor_id[0x6];
-	u8 reserved_at_178[0x3];
+	u8 reserved_at_178[0x1];
+	u8 header_length_field_offset_mode[0x1];
+	u8 reserved_at_17a[0x1];
 	u8 next_header_field_size[0x5];
 	u8 header_length_field_mask[0x20];
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 3c45643464..8dce017867 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -1093,7 +1093,13 @@ mlx5_alloc_srh_flex_parser(struct rte_eth_dev *dev)
 	node.header_length_field_shift = 0x3;
 	/* Header length is the 2nd byte. */
-	node.header_length_field_offset = 0x8;
-	if (attr->header_length_mask_width < 8)
-		node.header_length_field_offset += 8 - attr->header_length_mask_width;
+	if (attr->header_length_field_mode_wa) {
+		/* Legacy firmware before ConnectX-8, we should provide offset WA. */
+		node.header_length_field_offset = 8;
+		if (attr->header_length_mask_width < 8)
+			node.header_length_field_offset += 8 - attr->header_length_mask_width;
+	} else {
+		/* The new firmware, we can specify the correct offset directly. */
+		node.header_length_field_offset = 12;
+	}
 	node.header_length_field_mask = 0xF;
 	/* One byte next header protocol. */
diff --git a/drivers/net/mlx5/mlx5_flow_flex.c b/drivers/net/mlx5/mlx5_flow_flex.c
index afed16985a..76a81dad16 100644
--- a/drivers/net/mlx5/mlx5_flow_flex.c
+++ b/drivers/net/mlx5/mlx5_flow_flex.c
@@ -555,5 +555,5 @@ mlx5_flex_translate_length(struct mlx5_hca_flex_attr *attr,
 		msb++;
 		offset += field->field_size - msb;
-		if (msb < attr->header_length_mask_width) {
+		if (attr->header_length_field_mode_wa && msb < attr->header_length_mask_width) {
 			if (attr->header_length_mask_width - msb > offset)
 				return rte_flow_error_set
@@ -573,4 +573,5 @@ mlx5_flex_translate_length(struct mlx5_hca_flex_attr *attr,
 		node->header_length_field_shift = shift;
 		node->header_length_field_offset = offset;
+		node->header_length_field_offset_mode = !attr->header_length_field_mode_wa;
 		break;
 	}
-- 
2.51.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-11-25 15:03:57.978869017 +0000
+++ 0004-net-mlx5-fix-flex-flow-item-header-length.patch	2025-11-25 15:03:57.840651314 +0000
@@ -1 +1 @@
-From a2234609bf7e4f5bb1ad8f6f60c5f574f32c3558 Mon Sep 17 00:00:00 2001
+From 1935158d6558c55a1f67f06a3995d3453c89aa20 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit a2234609bf7e4f5bb1ad8f6f60c5f574f32c3558 ]
+
@@ -15 +16,0 @@
-Cc: stable@dpdk.org
@@ -27 +28 @@
-index 22f6b29089..d12ebf8487 100644
+index a75f011750..3b4da3db9b 100644
@@ -30 +31 @@
-@@ -785,4 +785,6 @@ mlx5_devx_cmd_create_flex_parser(void *ctx,
+@@ -744,4 +744,6 @@ mlx5_devx_cmd_create_flex_parser(void *ctx,
@@ -37 +38 @@
-@@ -912,4 +914,6 @@ mlx5_devx_cmd_query_hca_parse_graph_node_cap
+@@ -871,4 +873,6 @@ mlx5_devx_cmd_query_hca_parse_graph_node_cap
@@ -45 +46 @@
-index 4c7747cbec..da50fc686c 100644
+index f523bf8529..9e67c16a4c 100644
@@ -54 +55 @@
-@@ -655,4 +656,5 @@ struct mlx5_devx_graph_node_attr {
+@@ -631,4 +632,5 @@ struct mlx5_devx_graph_node_attr {
@@ -61 +62 @@
-index 9383e09893..ba33336e58 100644
+index 4f45b104ae..43b48a96de 100644
@@ -64 +65 @@
-@@ -2120,5 +2120,7 @@ struct mlx5_ifc_parse_graph_node_cap_bits {
+@@ -2112,5 +2112,7 @@ struct mlx5_ifc_parse_graph_node_cap_bits {
@@ -73 +74 @@
-@@ -4992,5 +4994,7 @@ struct mlx5_ifc_parse_graph_flex_bits {
+@@ -4921,5 +4923,7 @@ struct mlx5_ifc_parse_graph_flex_bits {
@@ -83 +84 @@
-index 447fd31fd4..c1cfcb1f67 100644
+index 3c45643464..8dce017867 100644
@@ -86 +87 @@
-@@ -1081,7 +1081,13 @@ mlx5_alloc_srh_flex_parser(struct rte_eth_dev *dev)
+@@ -1093,7 +1093,13 @@ mlx5_alloc_srh_flex_parser(struct rte_eth_dev *dev)
@@ -104 +105 @@
-index b1174fe0ed..d21e28f7fd 100644
+index afed16985a..76a81dad16 100644


  parent reply	other threads:[~2025-11-25 15:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-25 15:05 patch 'examples/l3fwd: add Tx burst size configuration option' " Kevin Traynor
2025-11-25 15:05 ` patch 'examples/server_node_efd: fix format overflow' " Kevin Traynor
2025-11-25 15:05 ` patch 'examples/vdpa: " Kevin Traynor
2025-11-25 15:05 ` Kevin Traynor [this message]
2025-11-25 15:05 ` patch 'doc: add Pollara 400 device in ionic guide' " Kevin Traynor
2025-11-25 15:13   ` Kevin Traynor
2025-11-25 15:26     ` Boyer, Andrew
2025-11-25 15:05 ` patch 'doc: fix note in FreeBSD " Kevin Traynor
2025-11-26 11:08 ` patch 'examples/l3fwd: add Tx burst size configuration option' " Kevin Traynor
2025-11-26 11:19   ` Ande, Venkat Kumar
2025-11-26 11:51     ` Kevin Traynor

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=20251125150558.232595-4-ktraynor@redhat.com \
    --to=ktraynor@redhat.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).