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
606 ETH_SS_PHY_STATS,606 ETH_SS_PHY_STATS,
607 ETH_SS_PHY_TUNABLES,607 ETH_SS_PHY_TUNABLES,
608 ETH_SS_LINK_MODES,608 ETH_SS_LINK_MODES,
609
610 /* add new constants above here */
611 ETH_SS_COUNT
609};612};
610 613
611/**614/**
include/uapi/linux/ethtool_netlink.h+56−0
@@ -14,6 +14,7 @@ · 13 unmodified lines
14/* message types - userspace to kernel */14/* message types - userspace to kernel */
15enum {15enum {
16 ETHTOOL_MSG_USER_NONE,16 ETHTOOL_MSG_USER_NONE,
17 ETHTOOL_MSG_STRSET_GET,
17 18
18 /* add new constants above here */19 /* add new constants above here */
19 __ETHTOOL_MSG_USER_CNT,20 __ETHTOOL_MSG_USER_CNT,
@@ -23,6 +24,7 @@ enum { · 3 unmodified lines
23/* message types - kernel to userspace */24/* message types - kernel to userspace */
24enum {25enum {
25 ETHTOOL_MSG_KERNEL_NONE,26 ETHTOOL_MSG_KERNEL_NONE,
27 ETHTOOL_MSG_STRSET_GET_REPLY,
26 28
27 /* add new constants above here */29 /* add new constants above here */
28 __ETHTOOL_MSG_KERNEL_CNT,30 __ETHTOOL_MSG_KERNEL_CNT,
@@ -85,6 +87,60 @@ enum { · 56 unmodified lines
85 ETHTOOL_A_BITSET_MAX = __ETHTOOL_A_BITSET_CNT - 187 ETHTOOL_A_BITSET_MAX = __ETHTOOL_A_BITSET_CNT - 1
86};88};
87 89
90/* string sets */
91
92enum {
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
102enum {
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
111enum {
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
122enum {
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
133enum {
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
88/* generic netlink info */144/* generic netlink info */
89#define ETHTOOL_GENL_NAME "ethtool"145#define ETHTOOL_GENL_NAME "ethtool"
90#define ETHTOOL_GENL_VERSION 1146#define ETHTOOL_GENL_VERSION 1