History

ethtool: provide string sets with STRSET_GET request

Requests a contents of one or more string sets, i.e. indexed arrays of strings; this information is provided by ETHTOOL_GSSET_INFO and ETHTOOL_GSTRINGS commands of ioctl interface. Unlike ioctl interface, all information can be retrieved with one request and mulitple string sets can be requested at once. There are three types of requests: - no NLM_F_DUMP, no device: get "global" stringsets - no NLM_F_DUMP, with device: get string sets related to the device - NLM_F_DUMP, no device: get device related string sets for all devices Client can request either all string sets of given type (global or device related) or only specific sets. With ETHTOOL_A_STRSET_COUNTS flag set, only set sizes (numbers of strings) are returned.

Michal Kubecek committed 6 years ago

Commit 71921691 parent 728480f7 files · +570 −3Browse files

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

Unified · Split

2 files
  1. include/uapi/linux/ethtool.h +3 −0
  2. include/uapi/linux/ethtool_netlink.h +56 −0
include/uapi/linux/ethtool.h+3−0
@@ -606,6 +606,9 @@ enum ethtool_stringset { · 605 unmodified lines
606606 ETH_SS_PHY_STATS,
607607 ETH_SS_PHY_TUNABLES,
608608 ETH_SS_LINK_MODES,
609+
610+ /* add new constants above here */
611+ ETH_SS_COUNT
609612 };
610613
611614 /**
include/uapi/linux/ethtool_netlink.h+56−0
@@ -14,6 +14,7 @@ · 13 unmodified lines
1414 /* message types - userspace to kernel */
1515 enum {
1616 ETHTOOL_MSG_USER_NONE,
17+ ETHTOOL_MSG_STRSET_GET,
1718
1819 /* add new constants above here */
1920 __ETHTOOL_MSG_USER_CNT,
@@ -23,6 +24,7 @@ enum { · 3 unmodified lines
2324 /* message types - kernel to userspace */
2425 enum {
2526 ETHTOOL_MSG_KERNEL_NONE,
27+ ETHTOOL_MSG_STRSET_GET_REPLY,
2628
2729 /* add new constants above here */
2830 __ETHTOOL_MSG_KERNEL_CNT,
@@ -85,6 +87,60 @@ enum { · 56 unmodified lines
8587 ETHTOOL_A_BITSET_MAX = __ETHTOOL_A_BITSET_CNT - 1
8688 };
8789
90+/* string sets */
91+
92+enum {
93+ ETHTOOL_A_STRING_UNSPEC,
94+ ETHTOOL_A_STRING_INDEX, /* u32 */
95+ ETHTOOL_A_STRING_VALUE, /* string */
96+
97+ /* add new constants above here */
98+ __ETHTOOL_A_STRING_CNT,
99+ ETHTOOL_A_STRING_MAX = __ETHTOOL_A_STRING_CNT - 1
100+};
101+
102+enum {
103+ ETHTOOL_A_STRINGS_UNSPEC,
104+ ETHTOOL_A_STRINGS_STRING, /* nest - _A_STRINGS_* */
105+
106+ /* add new constants above here */
107+ __ETHTOOL_A_STRINGS_CNT,
108+ ETHTOOL_A_STRINGS_MAX = __ETHTOOL_A_STRINGS_CNT - 1
109+};
110+
111+enum {
112+ ETHTOOL_A_STRINGSET_UNSPEC,
113+ ETHTOOL_A_STRINGSET_ID, /* u32 */
114+ ETHTOOL_A_STRINGSET_COUNT, /* u32 */
115+ ETHTOOL_A_STRINGSET_STRINGS, /* nest - _A_STRINGS_* */
116+
117+ /* add new constants above here */
118+ __ETHTOOL_A_STRINGSET_CNT,
119+ ETHTOOL_A_STRINGSET_MAX = __ETHTOOL_A_STRINGSET_CNT - 1
120+};
121+
122+enum {
123+ ETHTOOL_A_STRINGSETS_UNSPEC,
124+ ETHTOOL_A_STRINGSETS_STRINGSET, /* nest - _A_STRINGSET_* */
125+
126+ /* add new constants above here */
127+ __ETHTOOL_A_STRINGSETS_CNT,
128+ ETHTOOL_A_STRINGSETS_MAX = __ETHTOOL_A_STRINGSETS_CNT - 1
129+};
130+
131+/* STRSET */
132+
133+enum {
134+ ETHTOOL_A_STRSET_UNSPEC,
135+ ETHTOOL_A_STRSET_HEADER, /* nest - _A_HEADER_* */
136+ ETHTOOL_A_STRSET_STRINGSETS, /* nest - _A_STRINGSETS_* */
137+ ETHTOOL_A_STRSET_COUNTS_ONLY, /* flag */
138+
139+ /* add new constants above here */
140+ __ETHTOOL_A_STRSET_CNT,
141+ ETHTOOL_A_STRSET_MAX = __ETHTOOL_A_STRSET_CNT - 1
142+};
143+
88144 /* generic netlink info */
89145 #define ETHTOOL_GENL_NAME "ethtool"
90146 #define ETHTOOL_GENL_VERSION 1