bnxt_en: Accumulate all counters.
authorMichael Chan <michael.chan@broadcom.com>
Mon, 27 Jul 2020 09:40:43 +0000 (05:40 -0400)
committerDavid S. Miller <davem@davemloft.net>
Mon, 27 Jul 2020 18:47:33 +0000 (11:47 -0700)
commitfea6b3335527f41bc729466fb2a95e48a98827ac
tree7ee6ad280d84c2de94c56cdf96386c06b6dc3fb6
parent531d1d269c1d432d691026c82d04b7bb5f1ae318
bnxt_en: Accumulate all counters.

Now that we have the infrastructure in place, add the new function
bnxt_accumulate_all_stats() to periodically accumulate and check for
counter rollover of all ring stats and port stats.

A chip bug was also discovered that could cause some ring counters to
become 0 during DMA.  Workaround by ignoring zeros on the affected
chips.

Some older frimware will reset port counters during ifdown.  We need
to check for that and free the accumulated port counters during ifdown
to prevent bogus counter overflow detection during ifup.

Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/broadcom/bnxt/bnxt.h