patch 'net/bnxt/tf_ulp: fix meter stats race with cache thread' has been queued to stable release 25.11.5

Kevin Traynor ktraynor at redhat.com
Thu Dec 3 14:02:13 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/f32988a05cb98da4e09719a710158f3e7dafa753

Thanks.

Kevin

---
>From f32988a05cb98da4e09719a710158f3e7dafa753 Mon Sep 17 00:00:00 2001
From: Jay Ding <jay.ding at broadcom.com>
Date: Mon, 5 Oct 2026 15:25:44 -0500
Subject: [PATCH] net/bnxt/tf_ulp: fix meter stats race with cache thread

[ upstream commit 4d4b53f3e1488538aca037cb723361e120d04750 ]

The background stats cache thread and the show-port-meter-stats
path both issue MPC TABLE_READ commands targeting the same ingress
(RE_CFA) completion ring. The stats cache holds fdb_lock for the
entire batch send+collect window, but the meter stats path called
tfc_act_get() with no lock, creating a race between the two threads.

Fix by acquiring fdb_lock in ulp_fc_tfc_mtr_stat_get before the
MPC call, matching the same serialization pattern used by the stats
cache thread. The flow-stat path (ulp_fc_tfc_flow_stat_get) is
not changed because its callers in ulp_fc_mgr.c already hold the
lock. Also initialize count to zero to fix a pre-existing case
where count.reserved (marked "must be zero" in rte_flow.h) was left
uninitialized; count.reset is already explicitly set on both branches
above and was never the affected field.

Fixes: 3ed6fb5edc8e ("net/bnxt/tf_ulp: add meter stats support for Thor2")

Signed-off-by: Jay Ding <jay.ding at broadcom.com>
Signed-off-by: Manish Kurup <manish.kurup at broadcom.com>
---
 drivers/net/bnxt/tf_ulp/ulp_fc_mgr_tfc.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bnxt/tf_ulp/ulp_fc_mgr_tfc.c b/drivers/net/bnxt/tf_ulp/ulp_fc_mgr_tfc.c
index 8e61c71f97..d25e4ac27c 100644
--- a/drivers/net/bnxt/tf_ulp/ulp_fc_mgr_tfc.c
+++ b/drivers/net/bnxt/tf_ulp/ulp_fc_mgr_tfc.c
@@ -161,5 +161,6 @@ ulp_fc_tfc_mtr_stat_get(struct bnxt_ulp_context *ctxt,
 			struct rte_mtr_stats *mtr_count)
 {
-	struct rte_flow_query_count count;
+	struct rte_flow_query_count count = { 0 };
+	int32_t rc;
 
 	if (clear)
@@ -168,5 +169,17 @@ ulp_fc_tfc_mtr_stat_get(struct bnxt_ulp_context *ctxt,
 		count.reset = 0;
 
-	return ulp_fc_tfc_stat_get(ctxt, direction, session_type, handle, &count, mtr_count);
+	/*
+	 * Acquire fdb_lock to serialize this non-batch MPC read against the
+	 * background stats cache thread, which holds the same lock for the
+	 * duration of its batch send+collect window. Without this, both paths
+	 * race on the shared RE_CFA/TE_CFA MPC completion ring, leading to
+	 * out-of-order completions and firmware ring-state corruption.
+	 */
+	if (bnxt_ulp_cntxt_acquire_fdb_lock(ctxt))
+		return -EIO;
+
+	rc = ulp_fc_tfc_stat_get(ctxt, direction, session_type, handle, &count, mtr_count);
+	bnxt_ulp_cntxt_release_fdb_lock(ctxt);
+	return rc;
 }
 
-- 
2.56.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-12-03 12:52:45.152228857 +0000
+++ 0207-net-bnxt-tf_ulp-fix-meter-stats-race-with-cache-thre.patch	2026-12-03 12:52:39.183586766 +0000
@@ -1 +1 @@
-From 4d4b53f3e1488538aca037cb723361e120d04750 Mon Sep 17 00:00:00 2001
+From f32988a05cb98da4e09719a710158f3e7dafa753 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 4d4b53f3e1488538aca037cb723361e120d04750 ]
+
@@ -22 +23,0 @@
-Cc: stable at dpdk.org



More information about the stable mailing list