Skip to contentSkip to conversation

net/bnxt: fix to release lock in error path of stop and close op

PATCH New Somnath Kotur 3 participants 4 messages Jan 13, 2021 – Jan 21, 2021 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/bnxt: fix to release lock in error path of stop and close op

err_recovery_lock needs to be released before returning in stop and close_op if FW_RESET flag is set.

Fixes 647ca0b35830 ("net/bnxt: check chip reset in dev stop and close")
---
 drivers/net/bnxt/bnxt_ethdev.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/bnxt/bnxt_ethdev.c +2 -0
index 74b0f3d1dc..4d6c0a15cd 100644
@@ -1374,6 +1374,7 @@ static int bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)
 	if (bp->flags & BNXT_FLAG_FW_RESET) {
 		PMD_DRV_LOG(ERR,
 			    "Adapter recovering from error..Please retry\n");
+		pthread_mutex_unlock(&bp->err_recovery_lock);
 		return -EAGAIN;
 	}
 	pthread_mutex_unlock(&bp->err_recovery_lock);
@@ -1476,6 +1477,7 @@ static int bnxt_dev_close_op(struct rte_eth_dev *eth_dev)
 	if (bp->flags & BNXT_FLAG_FW_RESET) {
 		PMD_DRV_LOG(ERR,
 			    "Adapter recovering from error...Please retry\n");
+		pthread_mutex_unlock(&bp->err_recovery_lock);
 		return -EAGAIN;
 	}
 	pthread_mutex_unlock(&bp->err_recovery_lock);
Signature · 1 line
2.28.0.497.g54e85e7
#1 lore raw

PATCH v2 1/1 net/bnxt: fix lock handling in stop and close

From: Somnath Kotur <[email protected]>

err_recovery_lock needs to be released before returning in stop and close_op if FW_RESET flag is set.

Fixes dd3613560573 ("net/bnxt: check chip reset in dev stop and close")

---
v1->v2: rebased to latest dpdk-next-net and updated commit log.

---
 drivers/net/bnxt/bnxt_ethdev.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/bnxt/bnxt_ethdev.c +2 -0
index f439aeee4..89e42ef14 100644
@@ -1374,6 +1374,7 @@ static int bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)
 	if (bp->flags & BNXT_FLAG_FW_RESET) {
 		PMD_DRV_LOG(ERR,
 			    "Adapter recovering from error..Please retry\n");
+		pthread_mutex_unlock(&bp->err_recovery_lock);
 		return -EAGAIN;
 	}
 	pthread_mutex_unlock(&bp->err_recovery_lock);
@@ -1497,6 +1498,7 @@ static int bnxt_dev_close_op(struct rte_eth_dev *eth_dev)
 	if (bp->flags & BNXT_FLAG_FW_RESET) {
 		PMD_DRV_LOG(ERR,
 			    "Adapter recovering from error...Please retry\n");
+		pthread_mutex_unlock(&bp->err_recovery_lock);
 		return -EAGAIN;
 	}
 	pthread_mutex_unlock(&bp->err_recovery_lock);
Signature · 1 line
2.21.1 (Apple Git-122.3)
#2 lore raw

PATCH v3 1/1 net/bnxt: fix lock handling in stop and close

From: Somnath Kotur <[email protected]>

err_recovery_lock needs to be released before returning in stop and close_op if FW_RESET flag is set.

Fixes dd3613560573 ("net/bnxt: check chip reset in dev stop and close")

---
v1->v2: rebased to latest dpdk-next-net and updated commit log. v2->v3: rebased to latest dpdk-next-net.

---
 drivers/net/bnxt/bnxt_ethdev.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/bnxt/bnxt_ethdev.c +2 -0
index f439aeee4..89e42ef14 100644
@@ -1374,6 +1374,7 @@ static int bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)
 	if (bp->flags & BNXT_FLAG_FW_RESET) {
 		PMD_DRV_LOG(ERR,
 			    "Adapter recovering from error..Please retry\n");
+		pthread_mutex_unlock(&bp->err_recovery_lock);
 		return -EAGAIN;
 	}
 	pthread_mutex_unlock(&bp->err_recovery_lock);
@@ -1497,6 +1498,7 @@ static int bnxt_dev_close_op(struct rte_eth_dev *eth_dev)
 	if (bp->flags & BNXT_FLAG_FW_RESET) {
 		PMD_DRV_LOG(ERR,
 			    "Adapter recovering from error...Please retry\n");
+		pthread_mutex_unlock(&bp->err_recovery_lock);
 		return -EAGAIN;
 	}
 	pthread_mutex_unlock(&bp->err_recovery_lock);
Signature · 1 line
2.21.1 (Apple Git-122.3)
#3 lore raw

Re: [dpdk-dev] [PATCH v3] net/bnxt: fix lock handling in stop and close

Quoted 9 lines · Ajit Khaparde

From: Somnath Kotur <[email protected]>

err_recovery_lock needs to be released before returning in stop and close_op if FW_RESET flag is set.

Fixes dd3613560573 ("net/bnxt: check chip reset in dev stop and close")

Patch applied to dpdk-next-net-brcm.

Quoted 30 lines

---
v1->v2: rebased to latest dpdk-next-net and updated commit log. v2->v3: rebased to latest dpdk-next-net.

---
 drivers/net/bnxt/bnxt_ethdev.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/bnxt/bnxt_ethdev.c +2 -1
index f439aeee4..89e42ef14 100644
@@ -1374,6 +1374,7 @@ static int bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)
        if (bp->flags & BNXT_FLAG_FW_RESET) {
                PMD_DRV_LOG(ERR,
                            "Adapter recovering from error..Please retry\n");
+               pthread_mutex_unlock(&bp->err_recovery_lock);
                return -EAGAIN;
        }
        pthread_mutex_unlock(&bp->err_recovery_lock);
@@ -1497,6 +1498,7 @@ static int bnxt_dev_close_op(struct rte_eth_dev *eth_dev)
        if (bp->flags & BNXT_FLAG_FW_RESET) {
                PMD_DRV_LOG(ERR,
                            "Adapter recovering from error...Please retry\n");
+               pthread_mutex_unlock(&bp->err_recovery_lock);
                return -EAGAIN;
        }
        pthread_mutex_unlock(&bp->err_recovery_lock);
--

2.21.1 (Apple Git-122.3)