patch 'net/mlx5/hws: fix stack alignment for ASan compatibility' has been queued to stable release 24.11.5

luca.boccassi at gmail.com luca.boccassi at gmail.com
Fri Feb 20 15:56:33 CET 2026


Hi,

FYI, your patch has been queued to stable release 24.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 02/22/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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/7d0a63a606e4a2594d404c2b8fcb1d1ae6358dad

Thanks.

Luca Boccassi

---
>From 7d0a63a606e4a2594d404c2b8fcb1d1ae6358dad Mon Sep 17 00:00:00 2001
From: Shani Peretz <shperetz at nvidia.com>
Date: Wed, 21 Jan 2026 10:14:47 +0200
Subject: [PATCH] net/mlx5/hws: fix stack alignment for ASan compatibility

[ upstream commit 4c3d83867c1fe17d8bbc803064f62a96fbb25d98 ]

When compiling with optimizations, the compiler uses AVX-512
instructions (vmovdqa64) to efficiently zero large structures.
This instruction requires 64-byte aligned memory addresses.

When compiling with ASAN, the stack layout is modified for
instrumentation, which can break the 64-byte alignment of
local structures. This causes a segfault when the misaligned
vmovdqa64 instruction executes.

Fix by adding MLX5DR_ASAN_ALIGN macro to ensure 64-byte alignment
when building with ASan.

Fixes: 338aaf911665 ("net/mlx5/hws: add send FW match STE using gen WQE")
Fixes: 12802ab2c8e2 ("net/mlx5/hws: support GTA WQE write using FW command")
Fixes: 405242c52dd5 ("net/mlx5/hws: add rule object")

Signed-off-by: Shani Peretz <shperetz at nvidia.com>
Acked-by: Bing Zhao <bingz at nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_cmd.c      | 4 ++--
 drivers/net/mlx5/hws/mlx5dr_internal.h | 6 ++++++
 drivers/net/mlx5/hws/mlx5dr_rule.c     | 2 +-
 drivers/net/mlx5/hws/mlx5dr_send.c     | 4 ++--
 4 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/net/mlx5/hws/mlx5dr_cmd.c b/drivers/net/mlx5/hws/mlx5dr_cmd.c
index a4f778a8a4..fc79a945c7 100644
--- a/drivers/net/mlx5/hws/mlx5dr_cmd.c
+++ b/drivers/net/mlx5/hws/mlx5dr_cmd.c
@@ -1008,8 +1008,8 @@ int mlx5dr_cmd_generate_wqe(struct ibv_context *ctx,
 			    struct mlx5dr_cmd_generate_wqe_attr *attr,
 			    struct mlx5_cqe64 *ret_cqe)
 {
-	uint32_t out[MLX5_ST_SZ_DW(generate_wqe_out)] = {0};
-	uint32_t in[MLX5_ST_SZ_DW(generate_wqe_in)] = {0};
+	MLX5DR_ASAN_ALIGN uint32_t out[MLX5_ST_SZ_DW(generate_wqe_out)] = {0};
+	MLX5DR_ASAN_ALIGN uint32_t in[MLX5_ST_SZ_DW(generate_wqe_in)] = {0};
 	uint8_t status;
 	void *ptr;
 	int ret;
diff --git a/drivers/net/mlx5/hws/mlx5dr_internal.h b/drivers/net/mlx5/hws/mlx5dr_internal.h
index 2abc516b5e..6a4aafbe88 100644
--- a/drivers/net/mlx5/hws/mlx5dr_internal.h
+++ b/drivers/net/mlx5/hws/mlx5dr_internal.h
@@ -53,6 +53,12 @@
 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
 #endif
 
+#ifdef RTE_MALLOC_ASAN
+#define MLX5DR_ASAN_ALIGN alignas(64)
+#else
+#define MLX5DR_ASAN_ALIGN
+#endif
+
 #ifdef RTE_LIBRTE_MLX5_DEBUG
 /* Prevent double function name print when debug is set */
 #define DR_LOG DRV_LOG
diff --git a/drivers/net/mlx5/hws/mlx5dr_rule.c b/drivers/net/mlx5/hws/mlx5dr_rule.c
index 099f4f7947..b7517c7d77 100644
--- a/drivers/net/mlx5/hws/mlx5dr_rule.c
+++ b/drivers/net/mlx5/hws/mlx5dr_rule.c
@@ -470,7 +470,7 @@ static int mlx5dr_rule_create_hws(struct mlx5dr_rule *rule,
 	bool is_jumbo = mlx5dr_matcher_mt_is_jumbo(mt);
 	struct mlx5dr_matcher *matcher = rule->matcher;
 	struct mlx5dr_context *ctx = matcher->tbl->ctx;
-	struct mlx5dr_send_ste_attr ste_attr = {0};
+	MLX5DR_ASAN_ALIGN struct mlx5dr_send_ste_attr ste_attr = {0};
 	struct mlx5dr_send_ring_dep_wqe *dep_wqe;
 	struct mlx5dr_actions_wqe_setter *setter;
 	struct mlx5dr_actions_apply_data apply;
diff --git a/drivers/net/mlx5/hws/mlx5dr_send.c b/drivers/net/mlx5/hws/mlx5dr_send.c
index d01fc7ef2c..85f613ed39 100644
--- a/drivers/net/mlx5/hws/mlx5dr_send.c
+++ b/drivers/net/mlx5/hws/mlx5dr_send.c
@@ -250,8 +250,8 @@ int mlx5dr_send_wqe_fw(struct ibv_context *ibv_ctx,
 {
 	bool has_range = send_wqe_range_data || send_wqe_range_tag;
 	bool has_match = send_wqe_match_data || send_wqe_match_tag;
-	struct mlx5dr_wqe_gta_data_seg_ste gta_wqe_data0 = {0};
-	struct mlx5dr_wqe_gta_data_seg_ste gta_wqe_data1 = {0};
+	MLX5DR_ASAN_ALIGN struct mlx5dr_wqe_gta_data_seg_ste gta_wqe_data0 = {0};
+	MLX5DR_ASAN_ALIGN struct mlx5dr_wqe_gta_data_seg_ste gta_wqe_data1 = {0};
 	struct mlx5dr_wqe_gta_ctrl_seg gta_wqe_ctrl = {0};
 	struct mlx5dr_cmd_generate_wqe_attr attr = {0};
 	struct mlx5dr_wqe_ctrl_seg wqe_ctrl = {0};
-- 
2.47.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-02-20 14:55:46.719707863 +0000
+++ 0091-net-mlx5-hws-fix-stack-alignment-for-ASan-compatibil.patch	2026-02-20 14:55:43.332193244 +0000
@@ -1 +1 @@
-From 4c3d83867c1fe17d8bbc803064f62a96fbb25d98 Mon Sep 17 00:00:00 2001
+From 7d0a63a606e4a2594d404c2b8fcb1d1ae6358dad Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 4c3d83867c1fe17d8bbc803064f62a96fbb25d98 ]
+
@@ -21 +22,0 @@
-Cc: stable at dpdk.org
@@ -33 +34 @@
-index d6bf015d57..47e6a1fd49 100644
+index a4f778a8a4..fc79a945c7 100644
@@ -36 +37 @@
-@@ -1013,8 +1013,8 @@ int mlx5dr_cmd_generate_wqe(struct ibv_context *ctx,
+@@ -1008,8 +1008,8 @@ int mlx5dr_cmd_generate_wqe(struct ibv_context *ctx,
@@ -65 +66 @@
-index 895ac858ec..eb06996c90 100644
+index 099f4f7947..b7517c7d77 100644
@@ -68 +69 @@
-@@ -483,7 +483,7 @@ static int mlx5dr_rule_create_hws(struct mlx5dr_rule *rule,
+@@ -470,7 +470,7 @@ static int mlx5dr_rule_create_hws(struct mlx5dr_rule *rule,


More information about the stable mailing list