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
669669 * @ETH_SS_TS_TX_TYPES: timestamping Tx types
670670 * @ETH_SS_TS_RX_FILTERS: timestamping Rx filters
671671 * @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
672674 *
673675 * @ETH_SS_COUNT: number of defined string sets
674676 */
@@ -689,6 +691,8 @@ enum ethtool_stringset { · 14 unmodified lines
689691 ETH_SS_TS_TX_TYPES,
690692 ETH_SS_TS_RX_FILTERS,
691693 ETH_SS_UDP_TUNNEL_TYPES,
694+ ETH_SS_STATS_STD,
695+ ETH_SS_STATS_ETH_PHY,
692696
693697 /* add new constants above here */
694698 ETH_SS_COUNT
include/uapi/linux/ethtool_netlink.h+47−0
@@ -45,6 +45,7 @@ enum { · 44 unmodified lines
4545 ETHTOOL_MSG_FEC_GET,
4646 ETHTOOL_MSG_FEC_SET,
4747 ETHTOOL_MSG_MODULE_EEPROM_GET,
48+ ETHTOOL_MSG_STATS_GET,
4849
4950 /* add new constants above here */
5051 __ETHTOOL_MSG_USER_CNT,
@@ -86,6 +87,7 @@ enum { · 35 unmodified lines
8687 ETHTOOL_MSG_FEC_GET_REPLY,
8788 ETHTOOL_MSG_FEC_NTF,
8889 ETHTOOL_MSG_MODULE_EEPROM_GET_REPLY,
90+ ETHTOOL_MSG_STATS_GET_REPLY,
8991
9092 /* add new constants above here */
9193 __ETHTOOL_MSG_KERNEL_CNT,
@@ -679,6 +681,51 @@ enum { · 587 unmodified lines
679681 ETHTOOL_A_MODULE_EEPROM_MAX = (__ETHTOOL_A_MODULE_EEPROM_CNT - 1)
680682 };
681683
684+/* STATS */
685+
686+enum {
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+
699+enum {
700+ ETHTOOL_STATS_ETH_PHY,
701+
702+ /* add new constants above here */
703+ __ETHTOOL_STATS_CNT
704+};
705+
706+enum {
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+
720+enum {
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+
682729 /* generic netlink info */
683730 #define ETHTOOL_GENL_NAME "ethtool"
684731 #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