STRUCT ETHTOOL_FEC_STATS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct ethtool_fec_stats(9) ✨

Okay bestie, welcome to the struct ethtool_fec_stats(9) page from the Kernel API Manual πŸ’… β€” this is the little struct that holds all your IEEE 802.3 FEC statistics, and honestly? It's giving organized. Let's get into it 🫢


🌸 NAME 🌸

struct ethtool_fec_stats β€” statistics for IEEE 802.3 FEC ✨


πŸŽ€ SYNOPSIS πŸŽ€

struct ethtool_fec_stats {
    struct ethtool_fec_stat {
      u64 total;
      u64 lanes[ETHTOOL_MAX_LANES];
    } corrected_blocks, uncorrectable_blocks, corrected_bits;
 };

Like, look at that nesting πŸ’– three fields, each one is an struct ethtool_fec_stat with a total and a lanes[] array. Neat and iconic.


πŸ’œ Members πŸ’œ

  • corrected_blocks β€” the number of received blocks that got corrected by FEC πŸ”₯. This one's reported to user space as ETHTOOL_A_FEC_STAT_CORRECTED.
  • uncorrectable_blocks β€” the number of received blocks that FEC was not able to correct 😭. Reported to user space as ETHTOOL_A_FEC_STAT_UNCORR.
  • corrected_bits β€” the number of bits corrected by FEC ⭐. It's similar to corrected_blocks but it counts individual bit changes, not whole FEC data blocks. Heads up: this is a non-standard statistic (iykyk). Reported to user space as ETHTOOL_A_FEC_STAT_CORR_BITS.

πŸ¦‹ Description πŸ¦‹

So corrected_blocks is equivalent to 30.5.1.1.17 aFECCorrectedBlocks from the standard πŸ‘‘

And uncorrectable_blocks is equivalent to 30.5.1.1.18 aFECUncorrectableBlocks from the standard πŸ’«

For each of the fields above, the two substructure members are:

  • lanes: per-lane/PCS-instance counts as defined by the standard 🌈
  • total: error counts for the entire port, for drivers that are incapable of reporting per-lane stats πŸ™ˆ
Drivers should fill in either only total or per-lane statistics β€” the core will take care of adding lane values up to produce the total. So don't go doing both, bestie, that's not the vibe πŸ’€

🌟 SEE ALSO 🌟

Kernel file ./include/linux/ethtool.h plus all of these cuties:

enum ethtool_phys_id_state(9), struct kernel_ethtool_ringparam(9), enum ethtool_supported_ring_param(9), ethtool_rxfh_indir_default(9), struct ethtool_rxfh_context(9), ethtool_link_ksettings_zero_link_mode(9), ethtool_link_ksettings_add_link_mode(9), ethtool_link_ksettings_del_link_mode(9), ethtool_link_ksettings_test_link_mode(9), ethtool_intersect_link_masks(9), struct ethtool_phy_stats(9), struct ethtool_pause_stats(9), struct ethtool_fec_hist_range(9), struct ethtool_rmon_hist_range(9), struct ethtool_rmon_stats(9), struct ethtool_ts_stats(9), struct ethtool_module_eeprom(9), struct ethtool_module_power_mode_params(9), struct ethtool_mm_state(9), struct ethtool_mm_cfg(9), struct ethtool_mm_stats(9), struct ethtool_mmsv_ops(9), struct ethtool_mmsv(9), struct ethtool_rxfh_param(9), struct ethtool_rxfh_fields(9), struct kernel_ethtool_ts_info(9), struct ethtool_ops(9), struct ethtool_netdev_state(9), struct ethtool_phy_ops(9), ethtool_set_ethtool_phy_ops(9), ethtool_params_from_link_mode(9), ethtool_get_phc_vclocks(9), ethtool_mm_frag_size_add_to_min(9), ethtool_mm_frag_size_min_to_add(9), ethtool_get_ts_info_by_layer(9), ethtool_sprintf(9), ethtool_puts(9), ethtool_cpy(9)


That's the whole page, bestie β€” slay πŸŽ€βœ¨ This one lives in ./include/linux, dated October 2026, and it's part of the Kernel API Manual. Go forth and count your corrected blocks πŸ’–πŸ¦‹

πŸ“¦ where this page comes from