patch 'net/bnxt: fix mutexes for multi-process' has been queued to stable release 24.11.7

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Jun 11 15:19:35 CEST 2026


Hi,

FYI, your patch has been queued to stable release 24.11.7

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/13/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/d1cd7c10daaaa76488c4a928fd29ad84997ac522

Thanks.

Luca Boccassi

---
>From d1cd7c10daaaa76488c4a928fd29ad84997ac522 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen at networkplumber.org>
Date: Wed, 29 Apr 2026 11:46:43 -0700
Subject: [PATCH] net/bnxt: fix mutexes for multi-process

[ upstream commit 5b209eb21a98ce8d396d9fc58ee4710ce94778be ]

The BNXT driver supports secondary processes. Several mutexes live in
structures allocated in shared memory (dev_private and rte_zmalloc'd
structures) and must be initialized with PTHREAD_PROCESS_SHARED:

  - flow_lock, def_cp_lock, health_check_lock, err_recovery_lock
    in struct bnxt
  - vfr_start_lock in rep_info
  - txq_lock in struct bnxt_tx_queue
  - bnxt_ulp_mutex in session state
  - flow_db_lock in cfg_data

Bugzilla ID: 662
Fixes: 1cb3d39a48f7 ("net/bnxt: synchronize between flow related functions")
Fixes: 5526c8025d4d ("net/bnxt: fix race between interrupt handler and dev config")
Fixes: b59e4be2b6a7 ("net/bnxt: fix VF representor port add")

Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
Acked-by: Konstantin Ananyev <konstantin.ananyev at huawei.com>
---
 drivers/net/bnxt/bnxt_ethdev.c         | 41 +++++---------------------
 drivers/net/bnxt/bnxt_txq.c            |  6 +---
 drivers/net/bnxt/tf_ulp/bnxt_ulp.c     |  8 +----
 drivers/net/bnxt/tf_ulp/bnxt_ulp_tf.c  |  6 +---
 drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c |  6 +---
 5 files changed, 12 insertions(+), 55 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index b1e789a0fd..89b6963559 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -5830,31 +5830,12 @@ try_again:
 static int
 bnxt_init_locks(struct bnxt *bp)
 {
-	int err;
+	rte_thread_mutex_init_shared(&bp->flow_lock);
+	rte_thread_mutex_init_shared(&bp->def_cp_lock);
+	rte_thread_mutex_init_shared(&bp->health_check_lock);
+	rte_thread_mutex_init_shared(&bp->err_recovery_lock);
 
-	err = pthread_mutex_init(&bp->flow_lock, NULL);
-	if (err) {
-		PMD_DRV_LOG_LINE(ERR, "Unable to initialize flow_lock");
-		return err;
-	}
-
-	err = pthread_mutex_init(&bp->def_cp_lock, NULL);
-	if (err) {
-		PMD_DRV_LOG_LINE(ERR, "Unable to initialize def_cp_lock");
-		return err;
-	}
-
-	err = pthread_mutex_init(&bp->health_check_lock, NULL);
-	if (err) {
-		PMD_DRV_LOG_LINE(ERR, "Unable to initialize health_check_lock");
-		return err;
-	}
-
-	err = pthread_mutex_init(&bp->err_recovery_lock, NULL);
-	if (err)
-		PMD_DRV_LOG_LINE(ERR, "Unable to initialize err_recovery_lock");
-
-	return err;
+	return 0;
 }
 
 /* This should be called after we have queried trusted VF cap */
@@ -6755,7 +6736,7 @@ static void bnxt_free_rep_info(struct bnxt *bp)
 
 static int bnxt_init_rep_info(struct bnxt *bp)
 {
-	int i = 0, rc;
+	int i = 0;
 
 	if (bp->rep_info)
 		return 0;
@@ -6779,14 +6760,8 @@ static int bnxt_init_rep_info(struct bnxt *bp)
 	for (i = 0; i < BNXT_MAX_CFA_CODE; i++)
 		bp->cfa_code_map[i] = BNXT_VF_IDX_INVALID;
 
-	rc = pthread_mutex_init(&bp->rep_info->vfr_start_lock, NULL);
-	if (rc) {
-		PMD_DRV_LOG_LINE(ERR, "Unable to initialize vfr_start_lock");
-		bnxt_free_rep_info(bp);
-		return rc;
-	}
-
-	return rc;
+	rte_thread_mutex_init_shared(&bp->rep_info->vfr_start_lock);
+	return 0;
 }
 
 static int bnxt_rep_port_probe(struct rte_pci_device *pci_dev,
diff --git a/drivers/net/bnxt/bnxt_txq.c b/drivers/net/bnxt/bnxt_txq.c
index c864935992..deb367dabc 100644
--- a/drivers/net/bnxt/bnxt_txq.c
+++ b/drivers/net/bnxt/bnxt_txq.c
@@ -198,11 +198,7 @@ int bnxt_tx_queue_setup_op(struct rte_eth_dev *eth_dev,
 		goto err;
 	}
 
-	rc = pthread_mutex_init(&txq->txq_lock, NULL);
-	if (rc != 0) {
-		PMD_DRV_LOG_LINE(ERR, "TxQ mutex init failed!");
-		goto err;
-	}
+	rte_thread_mutex_init_shared(&txq->txq_lock);
 	return 0;
 err:
 	bnxt_tx_queue_release_op(eth_dev, queue_idx);
diff --git a/drivers/net/bnxt/tf_ulp/bnxt_ulp.c b/drivers/net/bnxt/tf_ulp/bnxt_ulp.c
index 1bfc88cf79..c28cf4f2b5 100644
--- a/drivers/net/bnxt/tf_ulp/bnxt_ulp.c
+++ b/drivers/net/bnxt/tf_ulp/bnxt_ulp.c
@@ -188,7 +188,6 @@ ulp_session_init(struct bnxt *bp,
 	struct rte_pci_device		*pci_dev;
 	struct rte_pci_addr		*pci_addr;
 	struct bnxt_ulp_session_state	*session;
-	int rc = 0;
 
 	if (!bp)
 		return NULL;
@@ -215,12 +214,7 @@ ulp_session_init(struct bnxt *bp,
 			session->pci_info.domain = pci_addr->domain;
 			session->pci_info.bus = pci_addr->bus;
 			memcpy(session->dsn, bp->dsn, sizeof(session->dsn));
-			rc = pthread_mutex_init(&session->bnxt_ulp_mutex, NULL);
-			if (rc) {
-				BNXT_DRV_DBG(ERR, "mutex create failed\n");
-				pthread_mutex_unlock(&bnxt_ulp_global_mutex);
-				return NULL;
-			}
+			rte_thread_mutex_init_shared(&session->bnxt_ulp_mutex);
 			STAILQ_INSERT_TAIL(&bnxt_ulp_session_list,
 					   session, next);
 		}
diff --git a/drivers/net/bnxt/tf_ulp/bnxt_ulp_tf.c b/drivers/net/bnxt/tf_ulp/bnxt_ulp_tf.c
index 12d5dc530c..6a89cff29b 100644
--- a/drivers/net/bnxt/tf_ulp/bnxt_ulp_tf.c
+++ b/drivers/net/bnxt/tf_ulp/bnxt_ulp_tf.c
@@ -1472,11 +1472,7 @@ ulp_tf_init(struct bnxt *bp,
 		goto jump_to_error;
 	}
 
-	rc = pthread_mutex_init(&bp->ulp_ctx->cfg_data->flow_db_lock, NULL);
-	if (rc) {
-		BNXT_DRV_DBG(ERR, "Unable to initialize flow db lock\n");
-		goto jump_to_error;
-	}
+	rte_thread_mutex_init_shared(&bp->ulp_ctx->cfg_data->flow_db_lock);
 
 	/* Initialize ulp dparms with values devargs passed */
 	rc = ulp_tf_dparms_init(bp, bp->ulp_ctx);
diff --git a/drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c b/drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c
index 6d7ec0ffec..46e193ce1f 100644
--- a/drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c
+++ b/drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c
@@ -993,11 +993,7 @@ ulp_tfc_init(struct bnxt *bp,
 		goto jump_to_error;
 	}
 
-	rc = pthread_mutex_init(&bp->ulp_ctx->cfg_data->flow_db_lock, NULL);
-	if (rc) {
-		BNXT_DRV_DBG(ERR, "Unable to initialize flow db lock\n");
-		goto jump_to_error;
-	}
+	rte_thread_mutex_init_shared(&bp->ulp_ctx->cfg_data->flow_db_lock);
 
 	rc = ulp_tfc_dparms_init(bp, bp->ulp_ctx, ulp_dev_id);
 	if (rc) {
-- 
2.47.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-06-11 14:20:02.385804959 +0100
+++ 0026-net-bnxt-fix-mutexes-for-multi-process.patch	2026-06-11 14:20:01.194745497 +0100
@@ -1 +1 @@
-From 5b209eb21a98ce8d396d9fc58ee4710ce94778be Mon Sep 17 00:00:00 2001
+From d1cd7c10daaaa76488c4a928fd29ad84997ac522 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 5b209eb21a98ce8d396d9fc58ee4710ce94778be ]
+
@@ -21 +22,0 @@
-Cc: stable at dpdk.org
@@ -26,6 +27,6 @@
- drivers/net/bnxt/bnxt_ethdev.c         | 11 ++++++-----
- drivers/net/bnxt/bnxt_txq.c            |  3 ++-
- drivers/net/bnxt/tf_ulp/bnxt_ulp.c     |  2 +-
- drivers/net/bnxt/tf_ulp/bnxt_ulp_tf.c  |  2 +-
- drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c |  2 +-
- 5 files changed, 11 insertions(+), 9 deletions(-)
+ drivers/net/bnxt/bnxt_ethdev.c         | 41 +++++---------------------
+ drivers/net/bnxt/bnxt_txq.c            |  6 +---
+ drivers/net/bnxt/tf_ulp/bnxt_ulp.c     |  8 +----
+ drivers/net/bnxt/tf_ulp/bnxt_ulp_tf.c  |  6 +---
+ drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c |  6 +---
+ 5 files changed, 12 insertions(+), 55 deletions(-)
@@ -34 +35 @@
-index b677f9491d..4c5c042ed8 100644
+index b1e789a0fd..89b6963559 100644
@@ -37 +38 @@
-@@ -5899,10 +5899,10 @@ try_again:
+@@ -5830,31 +5830,12 @@ try_again:
@@ -41,4 +42 @@
--	pthread_mutex_init(&bp->flow_lock, NULL);
--	pthread_mutex_init(&bp->def_cp_lock, NULL);
--	pthread_mutex_init(&bp->health_check_lock, NULL);
--	pthread_mutex_init(&bp->err_recovery_lock, NULL);
+-	int err;
@@ -50 +48,24 @@
- 	return 0;
+-	err = pthread_mutex_init(&bp->flow_lock, NULL);
+-	if (err) {
+-		PMD_DRV_LOG_LINE(ERR, "Unable to initialize flow_lock");
+-		return err;
+-	}
+-
+-	err = pthread_mutex_init(&bp->def_cp_lock, NULL);
+-	if (err) {
+-		PMD_DRV_LOG_LINE(ERR, "Unable to initialize def_cp_lock");
+-		return err;
+-	}
+-
+-	err = pthread_mutex_init(&bp->health_check_lock, NULL);
+-	if (err) {
+-		PMD_DRV_LOG_LINE(ERR, "Unable to initialize health_check_lock");
+-		return err;
+-	}
+-
+-	err = pthread_mutex_init(&bp->err_recovery_lock, NULL);
+-	if (err)
+-		PMD_DRV_LOG_LINE(ERR, "Unable to initialize err_recovery_lock");
+-
+-	return err;
++	return 0;
@@ -52 +73,12 @@
-@@ -6920,7 +6920,8 @@ static int bnxt_init_rep_info(struct bnxt *bp)
+ 
+ /* This should be called after we have queried trusted VF cap */
+@@ -6755,7 +6736,7 @@ static void bnxt_free_rep_info(struct bnxt *bp)
+ 
+ static int bnxt_init_rep_info(struct bnxt *bp)
+ {
+-	int i = 0, rc;
++	int i = 0;
+ 
+ 	if (bp->rep_info)
+ 		return 0;
+@@ -6779,14 +6760,8 @@ static int bnxt_init_rep_info(struct bnxt *bp)
@@ -56 +88,8 @@
--	return pthread_mutex_init(&bp->rep_info->vfr_start_lock, NULL);
+-	rc = pthread_mutex_init(&bp->rep_info->vfr_start_lock, NULL);
+-	if (rc) {
+-		PMD_DRV_LOG_LINE(ERR, "Unable to initialize vfr_start_lock");
+-		bnxt_free_rep_info(bp);
+-		return rc;
+-	}
+-
+-	return rc;
@@ -63 +102 @@
-index 7752f06eb7..03407c556a 100644
+index c864935992..deb367dabc 100644
@@ -66 +105 @@
-@@ -204,7 +204,8 @@ int bnxt_tx_queue_setup_op(struct rte_eth_dev *eth_dev,
+@@ -198,11 +198,7 @@ int bnxt_tx_queue_setup_op(struct rte_eth_dev *eth_dev,
@@ -70 +109,5 @@
--	return pthread_mutex_init(&txq->txq_lock, NULL);
+-	rc = pthread_mutex_init(&txq->txq_lock, NULL);
+-	if (rc != 0) {
+-		PMD_DRV_LOG_LINE(ERR, "TxQ mutex init failed!");
+-		goto err;
+-	}
@@ -72 +115 @@
-+	return 0;
+ 	return 0;
@@ -75 +117,0 @@
- 	return rc;
@@ -77 +119 @@
-index 0c03ae7a83..c28cf4f2b5 100644
+index 1bfc88cf79..c28cf4f2b5 100644
@@ -80 +122,9 @@
-@@ -214,7 +214,7 @@ ulp_session_init(struct bnxt *bp,
+@@ -188,7 +188,6 @@ ulp_session_init(struct bnxt *bp,
+ 	struct rte_pci_device		*pci_dev;
+ 	struct rte_pci_addr		*pci_addr;
+ 	struct bnxt_ulp_session_state	*session;
+-	int rc = 0;
+ 
+ 	if (!bp)
+ 		return NULL;
+@@ -215,12 +214,7 @@ ulp_session_init(struct bnxt *bp,
@@ -84 +134,6 @@
--			pthread_mutex_init(&session->bnxt_ulp_mutex, NULL);
+-			rc = pthread_mutex_init(&session->bnxt_ulp_mutex, NULL);
+-			if (rc) {
+-				BNXT_DRV_DBG(ERR, "mutex create failed\n");
+-				pthread_mutex_unlock(&bnxt_ulp_global_mutex);
+-				return NULL;
+-			}
@@ -90 +145 @@
-index bc347de202..6ca9d3309b 100644
+index 12d5dc530c..6a89cff29b 100644
@@ -93 +148 @@
-@@ -1469,7 +1469,7 @@ ulp_tf_init(struct bnxt *bp,
+@@ -1472,11 +1472,7 @@ ulp_tf_init(struct bnxt *bp,
@@ -97 +152,5 @@
--	pthread_mutex_init(&bp->ulp_ctx->cfg_data->flow_db_lock, NULL);
+-	rc = pthread_mutex_init(&bp->ulp_ctx->cfg_data->flow_db_lock, NULL);
+-	if (rc) {
+-		BNXT_DRV_DBG(ERR, "Unable to initialize flow db lock\n");
+-		goto jump_to_error;
+-	}
@@ -103 +162 @@
-index ad44ec93ca..fa98b2bca9 100644
+index 6d7ec0ffec..46e193ce1f 100644
@@ -106 +165 @@
-@@ -1038,7 +1038,7 @@ ulp_tfc_init(struct bnxt *bp,
+@@ -993,11 +993,7 @@ ulp_tfc_init(struct bnxt *bp,
@@ -110 +169,5 @@
--	pthread_mutex_init(&bp->ulp_ctx->cfg_data->flow_db_lock, NULL);
+-	rc = pthread_mutex_init(&bp->ulp_ctx->cfg_data->flow_db_lock, NULL);
+-	if (rc) {
+-		BNXT_DRV_DBG(ERR, "Unable to initialize flow db lock\n");
+-		goto jump_to_error;
+-	}


More information about the stable mailing list