bnxt_en: share NQ ring sw_stats memory with subrings
authorEdwin Peer <edwin.peer@broadcom.com>
Wed, 1 May 2024 00:30:51 +0000 (17:30 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 2 May 2024 14:27:20 +0000 (07:27 -0700)
commita75fbb3aa47a62d76d8b07b49db9e2f0e08fbba7
treece483ea19cbf40e8e8f9214a2c3f30e39588cf17
parentfc1fa5a07104a7caf151ace62ed59b617b811184
bnxt_en: share NQ ring sw_stats memory with subrings

On P5_PLUS chips and later, the NQ rings have subrings for RX and TX
completions respectively. These subrings are passed to the poll
function instead of the base NQ, but each ring carries its own
copy of the software ring statistics.

For stats to be conveniently accessible in __bnxt_poll_work(), the
statistics memory should either be shared between the NQ and its
subrings or the subrings need to be included in the ethtool stats
aggregation logic. This patch opts for the former, because it's more
efficient and less confusing having the software statistics for a
ring exist in a single place.

Before this patch, the counter will not be displayed if the "wrong"
cpr->sw_stats was used to increment a counter.

Link: https://lore.kernel.org/netdev/CACKFLikEhVAJA+osD7UjQNotdGte+fth7zOy7yDdLkTyFk9Pyw@mail.gmail.com/
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20240501003056.100607-2-michael.chan@broadcom.com
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