diff mbox series

[v3] net/bnxt: fix lock handling in stop and close

Message ID 20210121071656.32879-1-ajit.khaparde@broadcom.com (mailing list archive)
State Accepted, archived
Delegated to: Ajit Khaparde
Headers show
Series [v3] net/bnxt: fix lock handling in stop and close | expand

Checks

Context Check Description
ci/iol-testing warning Testing issues
ci/iol-testing warning Testing issues
ci/iol-mellanox-Functional success Functional Testing PASS
ci/iol-mellanox-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Ajit Khaparde Jan. 21, 2021, 7:16 a.m. UTC
From: Somnath Kotur <somnath.kotur@broadcom.com>

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")
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
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(+)

Comments

Ajit Khaparde Jan. 21, 2021, 4:02 p.m. UTC | #1
On Wed, Jan 20, 2021 at 11:17 PM Ajit Khaparde <ajitkhaparde@gmail.com> wrote:
>
> From: Somnath Kotur <somnath.kotur@broadcom.com>
>
> 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")
> Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Patch applied to dpdk-next-net-brcm.

> ---
> 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(+)
>
> diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
> index f439aeee4..89e42ef14 100644
> --- a/drivers/net/bnxt/bnxt_ethdev.c
> +++ b/drivers/net/bnxt/bnxt_ethdev.c
> @@ -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)
>
diff mbox series

Patch

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index f439aeee4..89e42ef14 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -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);