]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
eth: bnxt: improve the timing of stats
authorJakub Kicinski <kuba@kernel.org>
Fri, 19 Jun 2026 19:15:38 +0000 (12:15 -0700)
committerJakub Kicinski <kuba@kernel.org>
Tue, 23 Jun 2026 01:23:56 +0000 (18:23 -0700)
commit40529e58629baa9ce72143cb46cf1b3d2ca0d465
tree54251f38d6847600f51e9fd6f29be6ef49c832e9
parent46c3b8191aad3d032776bf3bebf03efdf5f4b905
eth: bnxt: improve the timing of stats

Kernel selftests wait 1.25x of the promised stats refresh time
(as read from ethtool -c). bnxt reports 1sec by default, but
the stats update process has two steps. First device DMAs the
new values, then the service task performs update in full-width
SW counters. So the worst case delay is actually 2x.

Note that the behavior is different for ring stats and port stats.
Port stats are fetched synchronously by the service worker, so
there's no risk of doubling up the delay there.

The problem of stale stats impacts not only tests but real workloads
which monitor egress bandwidth of a NIC. The inaccuracy causes double
counting in the next cycle and spurious overload alarms.

Try to read from the DMA buffer more aggressively, to mitigate
timing issues between DMA and service task. The SW update should
be cheap.

Fixes: 51f307856b60 ("bnxt_en: Allow statistics DMA to be configurable using ethtool -C.")
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Link: https://patch.msgid.link/20260619191538.104165-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/broadcom/bnxt/bnxt.h
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c