Skip to content

Commit b8056e8

Browse files
Michael Chandavem330
authored andcommitted
bnxt_en: Fix accumulation of bp->net_stats_prev.
We have logic to maintain network counters across resets by storing the counters in bp->net_stats_prev before reset. But not all resets will clear the counters. Certain resets that don't need to change the number of rings do not clear the counters. The current logic accumulates the counters before all resets, causing big jumps in the counters after some resets, such as ethtool -G. Fix it by only accumulating the counters during reset if the irq_re_init parameter is set. The parameter signifies that all rings and interrupts will be reset and that means that the counters will also be reset. Reported-by: Vijayendra Suman <[email protected]> Fixes: b8875ca ("bnxt_en: Save ring statistics before reset.") Signed-off-by: Michael Chan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 591612a commit b8056e8

File tree

1 file changed

+1
-1
lines changed
  • drivers/net/ethernet/broadcom/bnxt

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9310,7 +9310,7 @@ static void __bnxt_close_nic(struct bnxt *bp, bool irq_re_init,
93109310
bnxt_free_skbs(bp);
93119311

93129312
/* Save ring stats before shutdown */
9313-
if (bp->bnapi)
9313+
if (bp->bnapi && irq_re_init)
93149314
bnxt_get_ring_stats(bp, &bp->net_stats_prev);
93159315
if (irq_re_init) {
93169316
bnxt_free_irq(bp);

0 commit comments

Comments
 (0)