ethtool: add interface to read standard MAC Ctrl stats

Number of devices maintains the standard-based MAC control
counters for control frames. Add a API for those.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Jakub Kicinski
2021-04-16 12:27:41 -07:00
committed by David S. Miller
parent ca2244547e
commit bfad2b979d
6 changed files with 67 additions and 0 deletions

View File

@@ -672,6 +672,7 @@ enum ethtool_link_ext_substate_cable_issue {
* @ETH_SS_STATS_STD: standardized stats
* @ETH_SS_STATS_ETH_PHY: names of IEEE 802.3 PHY statistics
* @ETH_SS_STATS_ETH_MAC: names of IEEE 802.3 MAC statistics
* @ETH_SS_STATS_ETH_CTRL: names of IEEE 802.3 MAC Control statistics
*
* @ETH_SS_COUNT: number of defined string sets
*/
@@ -695,6 +696,7 @@ enum ethtool_stringset {
ETH_SS_STATS_STD,
ETH_SS_STATS_ETH_PHY,
ETH_SS_STATS_ETH_MAC,
ETH_SS_STATS_ETH_CTRL,
/* add new constants above here */
ETH_SS_COUNT

View File

@@ -699,6 +699,7 @@ enum {
enum {
ETHTOOL_STATS_ETH_PHY,
ETHTOOL_STATS_ETH_MAC,
ETHTOOL_STATS_ETH_CTRL,
/* add new constants above here */
__ETHTOOL_STATS_CNT
@@ -779,6 +780,19 @@ enum {
ETHTOOL_A_STATS_ETH_MAC_MAX = (__ETHTOOL_A_STATS_ETH_MAC_CNT - 1)
};
enum {
/* 30.3.3.3 aMACControlFramesTransmitted */
ETHTOOL_A_STATS_ETH_CTRL_3_TX,
/* 30.3.3.4 aMACControlFramesReceived */
ETHTOOL_A_STATS_ETH_CTRL_4_RX,
/* 30.3.3.5 aUnsupportedOpcodesReceived */
ETHTOOL_A_STATS_ETH_CTRL_5_RX_UNSUP,
/* add new constants above here */
__ETHTOOL_A_STATS_ETH_CTRL_CNT,
ETHTOOL_A_STATS_ETH_CTRL_MAX = (__ETHTOOL_A_STATS_ETH_CTRL_CNT - 1)
};
/* generic netlink info */
#define ETHTOOL_GENL_NAME "ethtool"
#define ETHTOOL_GENL_VERSION 1