summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/broadcom/bnxt
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2022-11-30 04:31:08 +0300
committerJakub Kicinski <kuba@kernel.org>2022-12-02 03:34:52 +0300
commita802073d1c9ca2ffd757ab8df5afa9d73ba7e6b1 (patch)
tree24860d6bd872273b48024ac9e07d15aae34eabed /drivers/net/ethernet/broadcom/bnxt
parent5620768a97594b703fab454c69b7df00f6fca945 (diff)
downloadlinux-a802073d1c9ca2ffd757ab8df5afa9d73ba7e6b1.tar.xz
bnxt: report FEC block stats via standard interface
I must have missed that these stats are only exposed via the unstructured ethtool -S when they got merged. Plumb in the structured form. Reviewed-by: Michael Chan <michael.chan@broadcom.com> Link: https://lore.kernel.org/r/20221130013108.90062-1-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnxt')
-rw-r--r--drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
index c2f663770a7f..cbf17fcfb7ab 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
@@ -2007,6 +2007,14 @@ static void bnxt_get_fec_stats(struct net_device *dev,
rx = bp->rx_port_stats_ext.sw_stats;
fec_stats->corrected_bits.total =
*(rx + BNXT_RX_STATS_EXT_OFFSET(rx_corrected_bits));
+
+ if (bp->fw_rx_stats_ext_size <= BNXT_RX_STATS_EXT_NUM_LEGACY)
+ return;
+
+ fec_stats->corrected_blocks.total =
+ *(rx + BNXT_RX_STATS_EXT_OFFSET(rx_fec_corrected_blocks));
+ fec_stats->uncorrectable_blocks.total =
+ *(rx + BNXT_RX_STATS_EXT_OFFSET(rx_fec_uncorrectable_blocks));
}
static u32 bnxt_ethtool_forced_fec_to_fw(struct bnxt_link_info *link_info,