summaryrefslogtreecommitdiff
path: root/net/ethtool/strset.c
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2021-04-16 22:27:39 +0300
committerDavid S. Miller <davem@davemloft.net>2021-04-17 02:59:20 +0300
commitf09ea6fb12723d6726293d68de00b6307368bd76 (patch)
treeb135481e6127588c4580f149a75d995964005db5 /net/ethtool/strset.c
parentddc78b3621242dd691ef4c234a80e316422c2876 (diff)
downloadlinux-f09ea6fb12723d6726293d68de00b6307368bd76.tar.xz
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 Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ethtool/strset.c')
-rw-r--r--net/ethtool/strset.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/net/ethtool/strset.c b/net/ethtool/strset.c
index c3a5489964cd..5f3c73587ff4 100644
--- a/net/ethtool/strset.c
+++ b/net/ethtool/strset.c
@@ -80,6 +80,16 @@ static const struct strset_info info_template[] = {
.count = __ETHTOOL_UDP_TUNNEL_TYPE_CNT,
.strings = udp_tunnel_type_names,
},
+ [ETH_SS_STATS_STD] = {
+ .per_dev = false,
+ .count = __ETHTOOL_STATS_CNT,
+ .strings = stats_std_names,
+ },
+ [ETH_SS_STATS_ETH_PHY] = {
+ .per_dev = false,
+ .count = __ETHTOOL_A_STATS_ETH_PHY_CNT,
+ .strings = stats_eth_phy_names,
+ },
};
struct strset_req_info {