patch 'net/mlx5: fix counter truncation in queue counter read' has been queued to stable release 25.11.1
Kevin Traynor
ktraynor at redhat.com
Thu Mar 19 11:02:29 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/23/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/5eac9f9e4415dd6e69e3b984ba2ecefd7b892249
Thanks.
Kevin
---
>From 5eac9f9e4415dd6e69e3b984ba2ecefd7b892249 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen at networkplumber.org>
Date: Tue, 17 Feb 2026 07:05:02 -0800
Subject: [PATCH] net/mlx5: fix counter truncation in queue counter read
[ upstream commit 614cae8a82c2e03091eaaf2cce4e3c93bf99c86c ]
mlx5_read_queue_counter() casts its uint64_t *stat argument to
uint32_t * before passing it to mlx5_devx_cmd_queue_counter_query().
The query function writes a single uint32_t, so:
- On little-endian (x86): only the low 32 bits of *stat are
written; the upper 32 bits retain whatever value they had
before the call (stack garbage or a stale value).
- On big-endian (PowerPC): the write hits the wrong half of the
64-bit word entirely.
Use a local uint32_t for the query and widen to uint64_t on
assignment.
Fixes: f0c0731b6d40 ("net/mlx5: add counters for hairpin drop")
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
Acked-by: Dariusz Sosnowski <dsosnowski at nvidia.com>
---
drivers/net/mlx5/mlx5.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 531d33af12..c6c639a800 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -3784,4 +3784,7 @@ mlx5_read_queue_counter(struct mlx5_devx_obj *q_counter, const char *ctr_name,
uint64_t *stat)
{
+ uint32_t val;
+ int ret;
+
if (rte_eal_process_type() == RTE_PROC_SECONDARY) {
DRV_LOG(WARNING,
@@ -3793,5 +3796,9 @@ mlx5_read_queue_counter(struct mlx5_devx_obj *q_counter, const char *ctr_name,
return -EINVAL;
- return mlx5_devx_cmd_queue_counter_query(q_counter, 0, (uint32_t *)stat);
+ ret = mlx5_devx_cmd_queue_counter_query(q_counter, 0, &val);
+ if (ret == 0)
+ *stat = val;
+
+ return ret;
}
--
2.53.0
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-03-19 10:01:08.041232018 +0000
+++ 0031-net-mlx5-fix-counter-truncation-in-queue-counter-rea.patch 2026-03-19 10:01:07.096331262 +0000
@@ -1 +1 @@
-From 614cae8a82c2e03091eaaf2cce4e3c93bf99c86c Mon Sep 17 00:00:00 2001
+From 5eac9f9e4415dd6e69e3b984ba2ecefd7b892249 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 614cae8a82c2e03091eaaf2cce4e3c93bf99c86c ]
+
@@ -20 +21,0 @@
-Cc: stable at dpdk.org
@@ -29 +30 @@
-index 71383f2ac7..4e0bc26754 100644
+index 531d33af12..c6c639a800 100644
More information about the stable
mailing list