Skip to content

Commit d38c19b

Browse files
Michael Chankuba-moo
authored andcommitted
bnxt_en: Increment rx_resets counter in bnxt_disable_napi()
If we are doing a complete reset with irq_re_init set to true in bnxt_close_nic(), all the ring structures will be freed. New structures will be allocated in bnxt_open_nic(). The current code increments rx_resets counter in bnxt_enable_napi() if bnapi->in_reset is true. In a complete reset, bnapi->in_reset will never be true since the structure is just allocated. Increment the rx_resets counter in bnxt_disable_napi() instead. This will allow us to save all the ring error counters including the rx_resets counters in the next patch. Signed-off-by: Michael Chan <michael.chan@broadcom.com> Link: https://lore.kernel.org/r/20230817231911.165035-4-michael.chan@broadcom.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 578fcfd commit d38c19b

File tree

1 file changed

+7
-5
lines changed
  • drivers/net/ethernet/broadcom/bnxt

1 file changed

+7
-5
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9393,10 +9393,14 @@ static void bnxt_disable_napi(struct bnxt *bp)
93939393
return;
93949394

93959395
for (i = 0; i < bp->cp_nr_rings; i++) {
9396-
struct bnxt_cp_ring_info *cpr = &bp->bnapi[i]->cp_ring;
9396+
struct bnxt_napi *bnapi = bp->bnapi[i];
9397+
struct bnxt_cp_ring_info *cpr;
93979398

9398-
napi_disable(&bp->bnapi[i]->napi);
9399-
if (bp->bnapi[i]->rx_ring)
9399+
cpr = &bnapi->cp_ring;
9400+
if (bnapi->in_reset)
9401+
cpr->sw_stats.rx.rx_resets++;
9402+
napi_disable(&bnapi->napi);
9403+
if (bnapi->rx_ring)
94009404
cancel_work_sync(&cpr->dim.work);
94019405
}
94029406
}
@@ -9413,8 +9417,6 @@ static void bnxt_enable_napi(struct bnxt *bp)
94139417
bnapi->tx_fault = 0;
94149418

94159419
cpr = &bnapi->cp_ring;
9416-
if (bnapi->in_reset)
9417-
cpr->sw_stats.rx.rx_resets++;
94189420
bnapi->in_reset = false;
94199421

94209422
bnapi->tx_pkts = 0;

0 commit comments

Comments
 (0)