]> git.baikalelectronics.ru Git - kernel.git/commit
bnxt_en: Fix accumulation of bp->net_stats_prev.
authorMichael Chan <michael.chan@broadcom.com>
Mon, 25 May 2020 21:41:17 +0000 (17:41 -0400)
committerDavid S. Miller <davem@davemloft.net>
Wed, 27 May 2020 03:30:47 +0000 (20:30 -0700)
commit64dd282af4cc7751d34eca2868be793a7b2f2bae
treea4521f1f9dec8adcd94c68a840a7218389351326
parent9cae00f7a89fc7ddbe51017b13c79e95cdc8fb0d
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 <vijayendra.suman@oracle.com>
Fixes: a17a49596f68 ("bnxt_en: Save ring statistics before reset.")
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