From: Bing Zhao <bingz@nvidia.com>
To: <viacheslavo@nvidia.com>, <dev@dpdk.org>, <rasland@nvidia.com>
Cc: <orika@nvidia.com>, <dsosnowski@nvidia.com>,
<suanmingm@nvidia.com>, <matan@nvidia.com>, <thomas@monjalon.net>,
<stable@dpdk.org>
Subject: [PATCH] net/mlx5: fix NAT64 HW registers calculation
Date: Wed, 25 Mar 2026 11:58:26 +0200 [thread overview]
Message-ID: <20260325095826.5459-1-bingz@nvidia.com> (raw)
mlx5 PMD needs to select a set of 3 HW registers
which will be used to implement NAT64 flow action.
For compatibility reasons one of these registers has to be REG_C_6.
Offending patch introduced a bug to register selection logic.
If REG_C_6 was not available for use,
no registers were selected for NAT64.
So all the registers' information would not be initialized for the
temporary storage of headers information of NAT64.
This patch adds missing logic to use the last 3 available tag registers
in this case, allowing NAT64 flow action to be used.
Fixes: f15535128617 ("net/mlx5: fix NAT64 register selection")
Cc: dsosnowski@nvidia.com
Cc: stable@dpdk.org
Signed-off-by: Bing Zhao <bingz@nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
---
drivers/net/mlx5/mlx5.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index d9bc5ee197..70f52df78a 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -1679,6 +1679,12 @@ mlx5_init_hws_flow_tags_registers(struct mlx5_dev_ctx_shared *sh)
reg->nat64_regs[0] = REG_C_6;
reg->nat64_regs[1] = reg->hw_avl_tags[j - 2];
reg->nat64_regs[2] = reg->hw_avl_tags[j - 1];
+ } else {
+ if (j >= MLX5_FLOW_NAT64_REGS_MAX) {
+ reg->nat64_regs[0] = reg->hw_avl_tags[j - 3];
+ reg->nat64_regs[1] = reg->hw_avl_tags[j - 2];
+ reg->nat64_regs[2] = reg->hw_avl_tags[j - 1];
+ }
}
}
--
2.34.1
next reply other threads:[~2026-03-25 9:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-25 9:58 Bing Zhao [this message]
2026-03-25 14:34 ` [PATCH] net/mlx5: fix NAT64 HW registers calculation 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=20260325095826.5459-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=rasland@nvidia.com \
--cc=stable@dpdk.org \
--cc=suanmingm@nvidia.com \
--cc=thomas@monjalon.net \
--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