]> git.baikalelectronics.ru Git - kernel.git/commit
bnxt_en: Fix statistics counters issue during ifdown with older firmware.
authorMichael Chan <michael.chan@broadcom.com>
Tue, 23 Jun 2020 23:01:37 +0000 (19:01 -0400)
committerDavid S. Miller <davem@davemloft.net>
Wed, 24 Jun 2020 03:13:58 +0000 (20:13 -0700)
commitfa80e69f577505bc647236fadbb8f9fd8bfc5b9a
treea502af2c8ae3c3b794479c8086034d0696d12bf9
parenta1b71992bff067bc4e9deea75fb8b0e09ddfea93
bnxt_en: Fix statistics counters issue during ifdown with older firmware.

On older firmware, the hardware statistics are not cleared when the
driver frees the hardware stats contexts during ifdown.  The driver
expects these stats to be cleared and saves a copy before freeing
the stats contexts.  During the next ifup, the driver will likely
allocate the same hardware stats contexts and this will cause a big
increase in the counters as the old counters are added back to the
saved counters.

We fix it by making an additional firmware call to clear the counters
before freeing the hw stats contexts when the firmware is the older
20.x firmware.

Fixes: e5ffc589dda5 ("bnxt_en: Save ring statistics before reset.")
Reported-by: Jakub Kicinski <kicinski@fb.com>
Reviewed-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Tested-by: Jakub Kicinski <kicinski@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt.c