From: Maayan Kashani <mkashani@nvidia.com>
To: <dev@dpdk.org>
Cc: <dsosnowski@nvidia.com>, <viacheslavo@nvidia.com>,
<bingz@nvidia.com>, <orika@nvidia.com>, <suanmingm@nvidia.com>,
<matan@nvidia.com>, "Maayan Kashani" <mkashani@nvidia.com>,
<stable@dpdk.org>
Subject: [PATCH] net/mlx5: fix NOP insertion for modify field read-write
Date: Mon, 9 Nov 2026 14:50:34 +0200 [thread overview]
Message-ID: <20261109125034.4027845-1-mkashani@nvidia.com> (raw)
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")
Cc: stable@dpdk.org
Signed-off-by: Maayan Kashani <mkashani@nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski@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 8b74f66770b..acbbeb4002f 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -1572,7 +1572,8 @@ flow_hw_should_insert_nop(const struct mlx5_hw_modify_header_action *mhdr,
should_insert = new_cmd.field == last_cmd.field;
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;
else
@@ -1587,7 +1588,8 @@ 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 ||
- 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;
else
--
2.25.1
next reply other threads:[~2026-11-09 12:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-09 12:50 Maayan Kashani [this message]
2026-11-11 13:10 ` [PATCH] net/mlx5: fix NOP insertion for modify field read-write 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=20261109125034.4027845-1-mkashani@nvidia.com \
--to=mkashani@nvidia.com \
--cc=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