Commit e340a5c4 authored by Michael Chan's avatar Michael Chan Committed by Jakub Kicinski

bnxt_en: Add a new BNXT_STATE_NAPI_DISABLED flag to keep track of NAPI state.

Up until now, we don't need to keep track of this state because NAPI
is always enabled once and disabled once during bring up and shutdown.
For better error recovery in subsequent patches, we want to quiesce
the device earlier during fatal error conditions.  The normal shutdown
sequence will disable NAPI again and the flag will prevent disabling
NAPI twice.
Reviewed-by: default avatarPavan Chebbi <pavan.chebbi@broadcom.com>
Reviewed-by: default avatarAndy Gospodarek <gospo@broadcom.com>
Reviewed-by: default avatarEdwin Peer <edwin.peer@broadcom.com>
Reviewed-by: default avatarVasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
Acked-by: default avatarWillem de Bruijn <willemb@google.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 339eeb4b
...@@ -8836,7 +8836,8 @@ static void bnxt_disable_napi(struct bnxt *bp) ...@@ -8836,7 +8836,8 @@ static void bnxt_disable_napi(struct bnxt *bp)
{ {
int i; int i;
if (!bp->bnapi) if (!bp->bnapi ||
test_and_set_bit(BNXT_STATE_NAPI_DISABLED, &bp->state))
return; return;
for (i = 0; i < bp->cp_nr_rings; i++) { for (i = 0; i < bp->cp_nr_rings; i++) {
...@@ -8853,6 +8854,7 @@ static void bnxt_enable_napi(struct bnxt *bp) ...@@ -8853,6 +8854,7 @@ static void bnxt_enable_napi(struct bnxt *bp)
{ {
int i; int i;
clear_bit(BNXT_STATE_NAPI_DISABLED, &bp->state);
for (i = 0; i < bp->cp_nr_rings; i++) { for (i = 0; i < bp->cp_nr_rings; i++) {
struct bnxt_napi *bnapi = bp->bnapi[i]; struct bnxt_napi *bnapi = bp->bnapi[i];
struct bnxt_cp_ring_info *cpr; struct bnxt_cp_ring_info *cpr;
......
...@@ -1809,6 +1809,7 @@ struct bnxt { ...@@ -1809,6 +1809,7 @@ struct bnxt {
#define BNXT_STATE_FW_FATAL_COND 6 #define BNXT_STATE_FW_FATAL_COND 6
#define BNXT_STATE_DRV_REGISTERED 7 #define BNXT_STATE_DRV_REGISTERED 7
#define BNXT_STATE_PCI_CHANNEL_IO_FROZEN 8 #define BNXT_STATE_PCI_CHANNEL_IO_FROZEN 8
#define BNXT_STATE_NAPI_DISABLED 9
#define BNXT_NO_FW_ACCESS(bp) \ #define BNXT_NO_FW_ACCESS(bp) \
(test_bit(BNXT_STATE_FW_FATAL_COND, &(bp)->state) || \ (test_bit(BNXT_STATE_FW_FATAL_COND, &(bp)->state) || \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment