patch 'net/mlx5: fix IPv6 SRH flex node header length' has been queued to stable release 25.11.1
Kevin Traynor
ktraynor at redhat.com
Thu Feb 26 14:09:50 CET 2026
Hi,
FYI, your patch has been queued to stable release 25.11.1
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/02/26. 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/b9a087313705267302a3613ac4d91bcd5e7b6552
Thanks.
Kevin
---
>From b9a087313705267302a3613ac4d91bcd5e7b6552 Mon Sep 17 00:00:00 2001
From: Gregory Etelson <getelson at nvidia.com>
Date: Thu, 25 Dec 2025 13:02:00 +0200
Subject: [PATCH] net/mlx5: fix IPv6 SRH flex node header length
[ upstream commit f9399efbf39fe16d5a8beda666b72e7312103f99 ]
MLX5 PARSE_GRAPH_NODE defines the header_length_field_offset_mode bit,
starting from ConnectX-8. The bit value must match
HCA_CAP.header_length_field_offset_mode.
1. The patch copies header_length_field_offset_mode bit from a port
PARSE_GRAPH node capabilities to PARSE_GRAPH node definition.
2. The patch fixes the header_length_field_offset value to match
HCA_CAP.header_length_mask_width.
3. The patch replaces the static value in PARSE_GRAPH node
header_length_field_mask definition with one that matches
HCA_CAP.header_length_mask_width.
Fixes: a2234609bf7e ("net/mlx5: fix flex flow item header length")
Signed-off-by: Gregory Etelson <getelson at nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo at nvidia.com>
---
drivers/net/mlx5/mlx5.c | 28 +++++++++++++++++-----------
drivers/net/mlx5/mlx5.h | 3 ++-
drivers/net/mlx5/mlx5_flow.h | 2 ++
drivers/net/mlx5/mlx5_flow_flex.c | 2 +-
4 files changed, 22 insertions(+), 13 deletions(-)
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index bde4d01e48..264ad4a0f7 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -1039,4 +1039,9 @@ error:
}
+/* IPv6 SRH header is defined in RFC 8754 */
+#define MLX5_SRH_HEADER_LENGTH_FIELD_OFFSET 8
+#define MLX5_SRH_HEADER_LENGTH_FIELD_SIZE 8
+#define MLX5_SRH_HEADER_LENGTH_SHIFT 3
+
/*
* Allocation of a flex parser for srh. Once refcnt is zero, the resources held
@@ -1079,16 +1084,12 @@ mlx5_alloc_srh_flex_parser(struct rte_eth_dev *dev)
node.header_length_base_value = 0x8;
/* The unit is uint64_t. */
- node.header_length_field_shift = 0x3;
+ node.header_length_field_shift = MLX5_SRH_HEADER_LENGTH_SHIFT;
+ node.header_length_field_offset_mode = !attr->header_length_field_mode_wa;
/* Header length is the 2nd byte. */
- 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;
+ node.header_length_field_offset = MLX5_SRH_HEADER_LENGTH_FIELD_OFFSET;
+ if (attr->header_length_mask_width < MLX5_SRH_HEADER_LENGTH_FIELD_SIZE)
+ node.header_length_field_offset +=
+ MLX5_SRH_HEADER_LENGTH_FIELD_SIZE - attr->header_length_mask_width;
+ node.header_length_field_mask = mlx5_flex_hdr_len_mask(MLX5_SRH_HEADER_LENGTH_SHIFT, attr);
/* One byte next header protocol. */
node.next_header_field_size = 0x8;
@@ -1144,4 +1145,9 @@ mlx5_alloc_srh_flex_parser(struct rte_eth_dev *dev)
}
priv->sh->srh_flex_parser.flex.map[0].shift = 0;
+ DRV_LOG(NOTICE,
+ "SRH flex parser node object is created successfully. "
+ "Header extension length field size: %d bits\n",
+ attr->header_length_mask_width > MLX5_SRH_HEADER_LENGTH_FIELD_SIZE ?
+ MLX5_SRH_HEADER_LENGTH_FIELD_SIZE : attr->header_length_mask_width);
return 0;
error:
diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index 966e802f5f..d84445db49 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -1473,5 +1473,6 @@ struct mlx5_flex_item {
/*
- * Sample an IPv6 address and the first dword of SRv6 header.
+ * Sample IPv6 address in the first segment list
+ * and the first dword of SRv6 header.
* Then it is 16 + 4 = 20 bytes which is 5 dwords.
*/
diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h
index 09084d311e..030f51c509 100644
--- a/drivers/net/mlx5/mlx5_flow.h
+++ b/drivers/net/mlx5/mlx5_flow.h
@@ -3715,4 +3715,6 @@ flow_hw_get_ipv6_route_ext_mod_id_from_ctx(void *dr_ctx, uint8_t idx)
}
+uint8_t mlx5_flex_hdr_len_mask(uint8_t shift, const struct mlx5_hca_flex_attr *attr);
+
static inline bool
mlx5_dv_modify_ipv6_traffic_class_supported(struct mlx5_priv *priv)
diff --git a/drivers/net/mlx5/mlx5_flow_flex.c b/drivers/net/mlx5/mlx5_flow_flex.c
index d21e28f7fd..12d79ffb9e 100644
--- a/drivers/net/mlx5/mlx5_flow_flex.c
+++ b/drivers/net/mlx5/mlx5_flow_flex.c
@@ -459,5 +459,5 @@ mlx5_flex_release_index(struct rte_eth_dev *dev,
* 7 b00000001 0x01
*/
-static uint8_t
+uint8_t
mlx5_flex_hdr_len_mask(uint8_t shift,
const struct mlx5_hca_flex_attr *attr)
--
2.53.0
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-02-26 10:16:51.279253191 +0000
+++ 0108-net-mlx5-fix-IPv6-SRH-flex-node-header-length.patch 2026-02-26 10:16:47.105459911 +0000
@@ -1 +1 @@
-From f9399efbf39fe16d5a8beda666b72e7312103f99 Mon Sep 17 00:00:00 2001
+From b9a087313705267302a3613ac4d91bcd5e7b6552 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit f9399efbf39fe16d5a8beda666b72e7312103f99 ]
+
@@ -21 +22,0 @@
-Cc: stable at dpdk.org
More information about the stable
mailing list