patch 'net/mlx5: fix write-after-read in flow modify action' has been queued to stable release 25.11.5

Kevin Traynor ktraynor at redhat.com
Thu Dec 3 14:05:48 CET 2026


Hi,

FYI, your patch has been queued to stable release 25.11.5

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 12/08/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/8be6d7382883cb8c3b97e4269b61604c9ba40cb7

Thanks.

Kevin

---
>From 8be6d7382883cb8c3b97e4269b61604c9ba40cb7 Mon Sep 17 00:00:00 2001
From: Maayan Kashani <mkashani at nvidia.com>
Date: Mon, 9 Nov 2026 14:50:34 +0200
Subject: [PATCH] net/mlx5: fix write-after-read in flow modify action

[ upstream commit f50df3cbcf8fdb060748209eadae2225bdd56a68 ]

In HWS non-root groups, modify field actions are compiled into a
modify header pattern. When a COPY or ADD_FIELD reads a field and the
next SET or ADD writes that same field, no NOP was inserted between
them. Firmware rejects the resulting pattern at template table
creation with syndrome 0xa0a3a8.

flow_hw_should_insert_nop() only compared the new command's
destination with the previous command's destination. After a
COPY or ADD_FIELD it never compared against the previous source
field, which is the one that was read.

Extend the checks so a NOP is inserted when:
- a SET or ADD writes a field read by the previous COPY or ADD_FIELD,
- a COPY or ADD_FIELD writes a field read by the previous COPY or
  ADD_FIELD.

Two consecutive reads of the same field still do not need a NOP.

Fixes: 0f4aa72b99da ("net/mlx5: support flow modify field with HWS")

Signed-off-by: Maayan Kashani <mkashani at nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski at nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_hw.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index e44b353173..d44890aaa0 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -1540,5 +1540,6 @@ flow_hw_should_insert_nop(const struct mlx5_hw_modify_header_action *mhdr,
 		else if (last_type == MLX5_MODIFICATION_TYPE_COPY ||
 			 last_type == MLX5_MODIFICATION_TYPE_ADD_FIELD)
-			should_insert = new_cmd.field == last_cmd.dst_field;
+			should_insert = (new_cmd.field == last_cmd.dst_field ||
+					 new_cmd.field == last_cmd.field);
 		else if (last_type == MLX5_MODIFICATION_TYPE_NOP)
 			should_insert = false;
@@ -1555,5 +1556,6 @@ flow_hw_should_insert_nop(const struct mlx5_hw_modify_header_action *mhdr,
 			 last_type == MLX5_MODIFICATION_TYPE_ADD_FIELD)
 			should_insert = (new_cmd.field == last_cmd.dst_field ||
-					 new_cmd.dst_field == last_cmd.dst_field);
+					 new_cmd.dst_field == last_cmd.dst_field ||
+					 new_cmd.dst_field == last_cmd.field);
 		else if (last_type == MLX5_MODIFICATION_TYPE_NOP)
 			should_insert = false;
-- 
2.56.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-12-03 12:52:51.128638698 +0000
+++ 0422-net-mlx5-fix-write-after-read-in-flow-modify-action.patch	2026-12-03 12:52:39.324938809 +0000
@@ -1 +1 @@
-From f50df3cbcf8fdb060748209eadae2225bdd56a68 Mon Sep 17 00:00:00 2001
+From 8be6d7382883cb8c3b97e4269b61604c9ba40cb7 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit f50df3cbcf8fdb060748209eadae2225bdd56a68 ]
+
@@ -25 +26,0 @@
-Cc: stable at dpdk.org
@@ -34 +35 @@
-index 1d73324bd2..fe25b9b3ba 100644
+index e44b353173..d44890aaa0 100644
@@ -37 +38 @@
-@@ -1573,5 +1573,6 @@ flow_hw_should_insert_nop(const struct mlx5_hw_modify_header_action *mhdr,
+@@ -1540,5 +1540,6 @@ flow_hw_should_insert_nop(const struct mlx5_hw_modify_header_action *mhdr,
@@ -45 +46 @@
-@@ -1588,5 +1589,6 @@ flow_hw_should_insert_nop(const struct mlx5_hw_modify_header_action *mhdr,
+@@ -1555,5 +1556,6 @@ flow_hw_should_insert_nop(const struct mlx5_hw_modify_header_action *mhdr,



More information about the stable mailing list