[dpdk-stable] patch 'net/bnxt: fix lock init and destroy' has been queued to stable release 20.11.1

luca.boccassi at gmail.com luca.boccassi at gmail.com
Fri Feb 5 12:16:32 CET 2021


Hi,

FYI, your patch has been queued to stable release 20.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 02/07/21. 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/56c042f48df51cfd8c0524b3b1fccc18bf17c8d0

Thanks.

Luca Boccassi

---
>From 56c042f48df51cfd8c0524b3b1fccc18bf17c8d0 Mon Sep 17 00:00:00 2001
From: Somnath Kotur <somnath.kotur at broadcom.com>
Date: Thu, 24 Dec 2020 15:07:32 +0530
Subject: [PATCH] net/bnxt: fix lock init and destroy

[ upstream commit c9ffd6f88653163d51c497bb56c62ec3276caf3d ]

Invoking init/uninit locks in init_resources and uninit_resources
would end up initializing and destroying locks on every port start
stop which is not desired.
Move the 2 routines to dev_init and dev_close respectively as
locks need to be initialized and destroyed only once during the
lifetime of the driver.

Fixes: 1cb3d39a48f7 ("net/bnxt: synchronize between flow related functions")

Signed-off-by: Somnath Kotur <somnath.kotur at broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index b2e3683eeb..ff34d54964 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -1434,6 +1434,18 @@ static int bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)
 	return 0;
 }
 
+static void
+bnxt_uninit_locks(struct bnxt *bp)
+{
+	pthread_mutex_destroy(&bp->flow_lock);
+	pthread_mutex_destroy(&bp->def_cp_lock);
+	pthread_mutex_destroy(&bp->health_check_lock);
+	if (bp->rep_info) {
+		pthread_mutex_destroy(&bp->rep_info->vfr_lock);
+		pthread_mutex_destroy(&bp->rep_info->vfr_start_lock);
+	}
+}
+
 static int bnxt_dev_close_op(struct rte_eth_dev *eth_dev)
 {
 	struct bnxt *bp = eth_dev->data->dev_private;
@@ -1459,6 +1471,7 @@ static int bnxt_dev_close_op(struct rte_eth_dev *eth_dev)
 	bnxt_free_link_info(bp);
 	bnxt_free_pf_info(bp);
 	bnxt_free_parent_info(bp);
+	bnxt_uninit_locks(bp);
 
 	rte_memzone_free((const struct rte_memzone *)bp->tx_mem_zone);
 	bp->tx_mem_zone = NULL;
@@ -4804,10 +4817,6 @@ static int bnxt_init_resources(struct bnxt *bp, bool reconfig_dev)
 		return rc;
 	}
 
-	rc = bnxt_init_locks(bp);
-	if (rc)
-		return rc;
-
 	return 0;
 }
 
@@ -5294,6 +5303,10 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev, void *params __rte_unused)
 	if (rc)
 		goto error_free;
 
+	rc = bnxt_init_locks(bp);
+	if (rc)
+		goto error_free;
+
 	rc = bnxt_init_resources(bp, false);
 	if (rc)
 		goto error_free;
@@ -5385,18 +5398,6 @@ bnxt_free_error_recovery_info(struct bnxt *bp)
 	bp->fw_cap &= ~BNXT_FW_CAP_ERROR_RECOVERY;
 }
 
-static void
-bnxt_uninit_locks(struct bnxt *bp)
-{
-	pthread_mutex_destroy(&bp->flow_lock);
-	pthread_mutex_destroy(&bp->def_cp_lock);
-	pthread_mutex_destroy(&bp->health_check_lock);
-	if (bp->rep_info) {
-		pthread_mutex_destroy(&bp->rep_info->vfr_lock);
-		pthread_mutex_destroy(&bp->rep_info->vfr_start_lock);
-	}
-}
-
 static int
 bnxt_uninit_resources(struct bnxt *bp, bool reconfig_dev)
 {
@@ -5418,7 +5419,6 @@ bnxt_uninit_resources(struct bnxt *bp, bool reconfig_dev)
 
 	bnxt_uninit_ctx_mem(bp);
 
-	bnxt_uninit_locks(bp);
 	bnxt_free_flow_stats_info(bp);
 	bnxt_free_rep_info(bp);
 	rte_free(bp->ptp_cfg);
-- 
2.29.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-02-05 11:18:33.989890192 +0000
+++ 0106-net-bnxt-fix-lock-init-and-destroy.patch	2021-02-05 11:18:28.962694082 +0000
@@ -1 +1 @@
-From c9ffd6f88653163d51c497bb56c62ec3276caf3d Mon Sep 17 00:00:00 2001
+From 56c042f48df51cfd8c0524b3b1fccc18bf17c8d0 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit c9ffd6f88653163d51c497bb56c62ec3276caf3d ]
+
@@ -14 +15,0 @@
-Cc: stable at dpdk.org
@@ -23 +24 @@
-index ef6b611beb..bd7bcbdfdf 100644
+index b2e3683eeb..ff34d54964 100644
@@ -26 +27 @@
-@@ -1440,6 +1440,18 @@ static int bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)
+@@ -1434,6 +1434,18 @@ static int bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)
@@ -45 +46 @@
-@@ -1465,6 +1477,7 @@ static int bnxt_dev_close_op(struct rte_eth_dev *eth_dev)
+@@ -1459,6 +1471,7 @@ static int bnxt_dev_close_op(struct rte_eth_dev *eth_dev)
@@ -53 +54 @@
-@@ -4832,10 +4845,6 @@ static int bnxt_init_resources(struct bnxt *bp, bool reconfig_dev)
+@@ -4804,10 +4817,6 @@ static int bnxt_init_resources(struct bnxt *bp, bool reconfig_dev)
@@ -64 +65 @@
-@@ -5322,6 +5331,10 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev, void *params __rte_unused)
+@@ -5294,6 +5303,10 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev, void *params __rte_unused)
@@ -75 +76 @@
-@@ -5413,18 +5426,6 @@ bnxt_free_error_recovery_info(struct bnxt *bp)
+@@ -5385,18 +5398,6 @@ bnxt_free_error_recovery_info(struct bnxt *bp)
@@ -94 +95 @@
-@@ -5446,7 +5447,6 @@ bnxt_uninit_resources(struct bnxt *bp, bool reconfig_dev)
+@@ -5418,7 +5419,6 @@ bnxt_uninit_resources(struct bnxt *bp, bool reconfig_dev)


More information about the stable mailing list