aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/sfc/ef10.c
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2021-04-15 15:53:17 -0700
committerDavid S. Miller <davem@davemloft.net>2021-04-15 17:08:29 -0700
commitcab351be53c263c857563eb56b2bbfe67e8a12a0 (patch)
treece1c94176e160a35440b562442e277c0f7f44624 /drivers/net/ethernet/sfc/ef10.c
parentbnxt: implement ethtool::get_fec_stats (diff)
downloadlinux-cab351be53c263c857563eb56b2bbfe67e8a12a0.tar.xz
linux-cab351be53c263c857563eb56b2bbfe67e8a12a0.zip
sfc: ef10: implement ethtool::get_fec_stats
Report what appears to be the standard block counts: - 30.5.1.1.17 aFECCorrectedBlocks - 30.5.1.1.18 aFECUncorrectableBlocks Don't report the per-lane symbol counts, if those really count symbols they are not what the standard calls for (even if symbols seem like the most useful thing to count.) Fingers crossed that fec_corrected_errors is not in symbols. Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/sfc/ef10.c')
-rw-r--r--drivers/net/ethernet/sfc/ef10.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c
index da6886dcac37..c873f961d5a5 100644
--- a/drivers/net/ethernet/sfc/ef10.c
+++ b/drivers/net/ethernet/sfc/ef10.c
@@ -1747,6 +1747,22 @@ static size_t efx_ef10_describe_stats(struct efx_nic *efx, u8 *names)
mask, names);
}
+static void efx_ef10_get_fec_stats(struct efx_nic *efx,
+ struct ethtool_fec_stats *fec_stats)
+{
+ DECLARE_BITMAP(mask, EF10_STAT_COUNT);
+ struct efx_ef10_nic_data *nic_data = efx->nic_data;
+ u64 *stats = nic_data->stats;
+
+ efx_ef10_get_stat_mask(efx, mask);
+ if (test_bit(EF10_STAT_fec_corrected_errors, mask))
+ fec_stats->corrected_blocks.total =
+ stats[EF10_STAT_fec_corrected_errors];
+ if (test_bit(EF10_STAT_fec_uncorrected_errors, mask))
+ fec_stats->uncorrectable_blocks.total =
+ stats[EF10_STAT_fec_uncorrected_errors];
+}
+
static size_t efx_ef10_update_stats_common(struct efx_nic *efx, u64 *full_stats,
struct rtnl_link_stats64 *core_stats)
{
@@ -4122,6 +4138,7 @@ const struct efx_nic_type efx_hunt_a0_nic_type = {
.get_wol = efx_ef10_get_wol,
.set_wol = efx_ef10_set_wol,
.resume_wol = efx_port_dummy_op_void,
+ .get_fec_stats = efx_ef10_get_fec_stats,
.test_chip = efx_ef10_test_chip,
.test_nvram = efx_mcdi_nvram_test_all,
.mcdi_request = efx_ef10_mcdi_request,