History

ethtool: add FEC statistics

Similarly to pause statistics add stats for FEC. The IEEE standard mandates two sets of counters: - 30.5.1.1.17 aFECCorrectedBlocks - 30.5.1.1.18 aFECUncorrectableBlocks where block is a block of bits FEC operates on. Each of these counters is defined per lane (PCS instance). Multiple vendors provide number of corrected _bits_ rather than/as well as blocks. This set adds the 2 standard-based block counters and a extra one for corrected bits. Counters are exposed to user space via netlink in new attributes. Each attribute carries an array of u64s, first element is the total count, and the following ones are a per-lane break down. Much like with pause stats the operation will not fail when driver does not implement the get_fec_stats callback (nor can the driver fail the operation by returning an error). If stats can't be reported the relevant attributes will be empty.

Jakub Kicinski committed 5 years ago

Commit be85dbf1 parent 3d7cc105 files · +149 −1Browse files

Showing the changes to include/uapi (1 of 5 files). Show all

Unified · Split

include/uapi/linux/ethtool_netlink.h+14−0
@@ -643,11 +643,25 @@ enum { · 642 unmodified lines
643 ETHTOOL_A_FEC_MODES, /* bitset */643 ETHTOOL_A_FEC_MODES, /* bitset */
644 ETHTOOL_A_FEC_AUTO, /* u8 */644 ETHTOOL_A_FEC_AUTO, /* u8 */
645 ETHTOOL_A_FEC_ACTIVE, /* u32 */645 ETHTOOL_A_FEC_ACTIVE, /* u32 */
646 ETHTOOL_A_FEC_STATS, /* nest - _A_FEC_STAT */
646 647
647 __ETHTOOL_A_FEC_CNT,648 __ETHTOOL_A_FEC_CNT,
648 ETHTOOL_A_FEC_MAX = (__ETHTOOL_A_FEC_CNT - 1)649 ETHTOOL_A_FEC_MAX = (__ETHTOOL_A_FEC_CNT - 1)
649};650};
650 651
652enum {
653 ETHTOOL_A_FEC_STAT_UNSPEC,
654 ETHTOOL_A_FEC_STAT_PAD,
655
656 ETHTOOL_A_FEC_STAT_CORRECTED, /* array, u64 */
657 ETHTOOL_A_FEC_STAT_UNCORR, /* array, u64 */
658 ETHTOOL_A_FEC_STAT_CORR_BITS, /* array, u64 */
659
660 /* add new constants above here */
661 __ETHTOOL_A_FEC_STAT_CNT,
662 ETHTOOL_A_FEC_STAT_MAX = (__ETHTOOL_A_FEC_STAT_CNT - 1)
663};
664
651/* MODULE EEPROM */665/* MODULE EEPROM */
652 666
653enum {667enum {