History

ethtool: add a new command for reading standard stats

Add an interface for reading standard stats, including stats which don't have a corresponding control interface. Start with IEEE 802.3 PHY stats. There seems to be only one stat to expose there. Define API to not require user space changes when new stats or groups are added. Groups are based on bitset, stats have a string set associated. v1: wrap stats in a nest

Jakub Kicinski committed 5 years ago

Commit f09ea6f1 parent ddc78b38 files · +287 −1Browse files

Showing the changes to include/uapi (2 of 8 files). Show all

Unified · Split

2 files
  1. include/uapi/linux/ethtool.h +4 −0
  2. include/uapi/linux/ethtool_netlink.h +47 −0
include/uapi/linux/ethtool.h+4−0
@@ -669,6 +669,8 @@ enum ethtool_link_ext_substate_cable_issue { · 668 unmodified lines
669 * @ETH_SS_TS_TX_TYPES: timestamping Tx types669 * @ETH_SS_TS_TX_TYPES: timestamping Tx types
670 * @ETH_SS_TS_RX_FILTERS: timestamping Rx filters670 * @ETH_SS_TS_RX_FILTERS: timestamping Rx filters
671 * @ETH_SS_UDP_TUNNEL_TYPES: UDP tunnel types671 * @ETH_SS_UDP_TUNNEL_TYPES: UDP tunnel types
672 * @ETH_SS_STATS_STD: standardized stats
673 * @ETH_SS_STATS_ETH_PHY: names of IEEE 802.3 PHY statistics
672 *674 *
673 * @ETH_SS_COUNT: number of defined string sets675 * @ETH_SS_COUNT: number of defined string sets
674 */676 */
@@ -689,6 +691,8 @@ enum ethtool_stringset { · 14 unmodified lines
689 ETH_SS_TS_TX_TYPES,691 ETH_SS_TS_TX_TYPES,
690 ETH_SS_TS_RX_FILTERS,692 ETH_SS_TS_RX_FILTERS,
691 ETH_SS_UDP_TUNNEL_TYPES,693 ETH_SS_UDP_TUNNEL_TYPES,
694 ETH_SS_STATS_STD,
695 ETH_SS_STATS_ETH_PHY,
692 696
693 /* add new constants above here */697 /* add new constants above here */
694 ETH_SS_COUNT698 ETH_SS_COUNT
include/uapi/linux/ethtool_netlink.h+47−0
@@ -45,6 +45,7 @@ enum { · 44 unmodified lines
45 ETHTOOL_MSG_FEC_GET,45 ETHTOOL_MSG_FEC_GET,
46 ETHTOOL_MSG_FEC_SET,46 ETHTOOL_MSG_FEC_SET,
47 ETHTOOL_MSG_MODULE_EEPROM_GET,47 ETHTOOL_MSG_MODULE_EEPROM_GET,
48 ETHTOOL_MSG_STATS_GET,
48 49
49 /* add new constants above here */50 /* add new constants above here */
50 __ETHTOOL_MSG_USER_CNT,51 __ETHTOOL_MSG_USER_CNT,
@@ -86,6 +87,7 @@ enum { · 35 unmodified lines
86 ETHTOOL_MSG_FEC_GET_REPLY,87 ETHTOOL_MSG_FEC_GET_REPLY,
87 ETHTOOL_MSG_FEC_NTF,88 ETHTOOL_MSG_FEC_NTF,
88 ETHTOOL_MSG_MODULE_EEPROM_GET_REPLY,89 ETHTOOL_MSG_MODULE_EEPROM_GET_REPLY,
90 ETHTOOL_MSG_STATS_GET_REPLY,
89 91
90 /* add new constants above here */92 /* add new constants above here */
91 __ETHTOOL_MSG_KERNEL_CNT,93 __ETHTOOL_MSG_KERNEL_CNT,
@@ -679,6 +681,51 @@ enum { · 587 unmodified lines
679 ETHTOOL_A_MODULE_EEPROM_MAX = (__ETHTOOL_A_MODULE_EEPROM_CNT - 1)681 ETHTOOL_A_MODULE_EEPROM_MAX = (__ETHTOOL_A_MODULE_EEPROM_CNT - 1)
680};682};
681 683
684/* STATS */
685
686enum {
687 ETHTOOL_A_STATS_UNSPEC,
688 ETHTOOL_A_STATS_PAD,
689 ETHTOOL_A_STATS_HEADER, /* nest - _A_HEADER_* */
690 ETHTOOL_A_STATS_GROUPS, /* bitset */
691
692 ETHTOOL_A_STATS_GRP, /* nest - _A_STATS_GRP_* */
693
694 /* add new constants above here */
695 __ETHTOOL_A_STATS_CNT,
696 ETHTOOL_A_STATS_MAX = (__ETHTOOL_A_STATS_CNT - 1)
697};
698
699enum {
700 ETHTOOL_STATS_ETH_PHY,
701
702 /* add new constants above here */
703 __ETHTOOL_STATS_CNT
704};
705
706enum {
707 ETHTOOL_A_STATS_GRP_UNSPEC,
708 ETHTOOL_A_STATS_GRP_PAD,
709
710 ETHTOOL_A_STATS_GRP_ID, /* u32 */
711 ETHTOOL_A_STATS_GRP_SS_ID, /* u32 */
712
713 ETHTOOL_A_STATS_GRP_STAT, /* nest */
714
715 /* add new constants above here */
716 __ETHTOOL_A_STATS_GRP_CNT,
717 ETHTOOL_A_STATS_GRP_MAX = (__ETHTOOL_A_STATS_CNT - 1)
718};
719
720enum {
721 /* 30.3.2.1.5 aSymbolErrorDuringCarrier */
722 ETHTOOL_A_STATS_ETH_PHY_5_SYM_ERR,
723
724 /* add new constants above here */
725 __ETHTOOL_A_STATS_ETH_PHY_CNT,
726 ETHTOOL_A_STATS_ETH_PHY_MAX = (__ETHTOOL_A_STATS_ETH_PHY_CNT - 1)
727};
728
682/* generic netlink info */729/* generic netlink info */
683#define ETHTOOL_GENL_NAME "ethtool"730#define ETHTOOL_GENL_NAME "ethtool"
684#define ETHTOOL_GENL_VERSION 1731#define ETHTOOL_GENL_VERSION 1

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t