|
|
Log in / Subscribe / Register

eth: bnxt: maintain basic pkt/byte counters in SW

From:  Jakub Kicinski <kuba-AT-kernel.org>
To:  davem-AT-davemloft.net
Subject:  [PATCH net-next 0/9] eth: bnxt: maintain basic pkt/byte counters in SW
Date:  Wed, 26 Feb 2025 13:09:54 -0800
Message-ID:  <20250226211003.2790916-1-kuba@kernel.org>
Cc:  netdev-AT-vger.kernel.org, edumazet-AT-google.com, pabeni-AT-redhat.com, andrew+netdev-AT-lunn.ch, horms-AT-kernel.org, michael.chan-AT-broadcom.com, pavan.chebbi-AT-broadcom.com, Jakub Kicinski <kuba-AT-kernel.org>
Archive-link:  Article

Some workloads want to be able to track bandwidth utilization on
the scale of 10s of msecs. bnxt uses HW stats and async stats
updates, with update frequency controlled via ethtool -C.
Updating all HW stats more often than 100 msec is both hard for
the device and consumes PCIe bandwidth. Switch to maintaining
basic Rx / Tx packet and byte counters in SW.

Tested with drivers/net/stats.py:
  # Totals: pass:7 fail:0 xfail:0 xpass:0 skip:0 error:0

Manually tested by comparing the ethtool -S stats (which continues
to show HW stats) with qstats, and total interface stats.
With and without HW-GRO, and with XDP on / off.
Stopping and starting the interface also doesn't corrupt the values. 

Jakub Kicinski (9):
  eth: bnxt: use napi_consume_skb()
  eth: bnxt: don't run xdp programs on fallback traffic
  eth: bnxt: rename ring_err_stats -> ring_drv_stats
  eth: bnxt: snapshot driver stats
  eth: bnxt: don't use ifdef to check for CONFIG_INET in GRO
  eth: bnxt: consolidate the GRO-but-not-really paths in bnxt_gro_skb()
  eth: bnxt: maintain rx pkt/byte stats in SW
  eth: bnxt: maintain tx pkt/byte stats in SW
  eth: bnxt: count xdp xmit packets

 drivers/net/ethernet/broadcom/bnxt/bnxt.h     |  31 ++-
 drivers/net/ethernet/broadcom/bnxt/bnxt.c     | 240 ++++++++++++------
 .../net/ethernet/broadcom/bnxt/bnxt_ethtool.c |  14 +-
 drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c |  15 ++
 4 files changed, 208 insertions(+), 92 deletions(-)

-- 
2.48.1




Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds