summaryrefslogtreecommitdiffstats
path: root/net/ethtool/netlink.h
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2021-04-16 12:27:39 -0700
committerDavid S. Miller <davem@davemloft.net>2021-04-16 16:59:20 -0700
commitf09ea6fb12723d6726293d68de00b6307368bd76 (patch)
treeb135481e6127588c4580f149a75d995964005db5 /net/ethtool/netlink.h
parentddc78b3621242dd691ef4c234a80e316422c2876 (diff)
downloadlinux-f09ea6fb12723d6726293d68de00b6307368bd76.tar.gz
linux-f09ea6fb12723d6726293d68de00b6307368bd76.tar.bz2
linux-f09ea6fb12723d6726293d68de00b6307368bd76.zip
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/netlink.h')
-rw-r--r--net/ethtool/netlink.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/ethtool/netlink.h b/net/ethtool/netlink.h
index 4305ac971bb0..9d88983b6597 100644
--- a/net/ethtool/netlink.h
+++ b/net/ethtool/netlink.h
@@ -346,6 +346,7 @@ extern const struct ethnl_request_ops ethnl_eee_request_ops;
extern const struct ethnl_request_ops ethnl_tsinfo_request_ops;
extern const struct ethnl_request_ops ethnl_fec_request_ops;
extern const struct ethnl_request_ops ethnl_module_eeprom_request_ops;
+extern const struct ethnl_request_ops ethnl_stats_request_ops;
extern const struct nla_policy ethnl_header_policy[ETHTOOL_A_HEADER_FLAGS + 1];
extern const struct nla_policy ethnl_header_policy_stats[ETHTOOL_A_HEADER_FLAGS + 1];
@@ -380,6 +381,7 @@ extern const struct nla_policy ethnl_tunnel_info_get_policy[ETHTOOL_A_TUNNEL_INF
extern const struct nla_policy ethnl_fec_get_policy[ETHTOOL_A_FEC_HEADER + 1];
extern const struct nla_policy ethnl_fec_set_policy[ETHTOOL_A_FEC_AUTO + 1];
extern const struct nla_policy ethnl_module_eeprom_get_policy[ETHTOOL_A_MODULE_EEPROM_DATA + 1];
+extern const struct nla_policy ethnl_stats_get_policy[ETHTOOL_A_STATS_GROUPS + 1];
int ethnl_set_linkinfo(struct sk_buff *skb, struct genl_info *info);
int ethnl_set_linkmodes(struct sk_buff *skb, struct genl_info *info);
@@ -399,4 +401,7 @@ int ethnl_tunnel_info_start(struct netlink_callback *cb);
int ethnl_tunnel_info_dumpit(struct sk_buff *skb, struct netlink_callback *cb);
int ethnl_set_fec(struct sk_buff *skb, struct genl_info *info);
+extern const char stats_std_names[__ETHTOOL_STATS_CNT][ETH_GSTRING_LEN];
+extern const char stats_eth_phy_names[__ETHTOOL_A_STATS_ETH_PHY_CNT][ETH_GSTRING_LEN];
+
#endif /* _NET_ETHTOOL_NETLINK_H */