net/bnxt: prevent device access in error state
authorKalesh AP <kalesh-anakkur.purayil@broadcom.com>
Mon, 3 May 2021 05:21:50 +0000 (10:51 +0530)
committerAjit Khaparde <ajit.khaparde@broadcom.com>
Tue, 4 May 2021 03:56:14 +0000 (05:56 +0200)
Driver should prevent any DMA with the device when it
detects an error. When firmware is in fatal state,
stop tx/rx by assigning them to dummy functions.

Fixes: be14720def9c ("net/bnxt: support FW reset")
Fixes: 9d0cbaecc91a ("net/bnxt: support periodic FW health monitoring")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
drivers/net/bnxt/bnxt_ethdev.c

index 719eb68..822853a 100644 (file)
@@ -4275,6 +4275,8 @@ reset:
        bp->flags |= BNXT_FLAG_FATAL_ERROR;
        bp->flags |= BNXT_FLAG_FW_RESET;
 
+       bnxt_stop_rxtx(bp);
+
        PMD_DRV_LOG(ERR, "Detected FW dead condition\n");
 
        if (bnxt_is_master_func(bp))