History

ethtool: provide channel counts with CHANNELS_GET request

Implement CHANNELS_GET request to get channel counts of a network device. These are traditionally available via ETHTOOL_GCHANNELS ioctl request. Omit attributes for channel types which are not supported by driver or device (zero reported for maximum). v2: (all suggested by Jakub Kicinski) - minor cleanup in channels_prepare_data() - more descriptive channels_reply_size() - omit attributes with zero max count

Michal Kubecek committed 6 years ago

Commit 0c849791 parent bc9d1c96 files · +169 −2Browse files

Showing the changes to include/uapi/linux (1 of 6 files). Show all

Unified · Split

include/uapi/linux/ethtool_netlink.h+21−0
@@ -30,6 +30,7 @@ enum { · 29 unmodified lines
30 ETHTOOL_MSG_PRIVFLAGS_SET,30 ETHTOOL_MSG_PRIVFLAGS_SET,
31 ETHTOOL_MSG_RINGS_GET,31 ETHTOOL_MSG_RINGS_GET,
32 ETHTOOL_MSG_RINGS_SET,32 ETHTOOL_MSG_RINGS_SET,
33 ETHTOOL_MSG_CHANNELS_GET,
33 34
34 /* add new constants above here */35 /* add new constants above here */
35 __ETHTOOL_MSG_USER_CNT,36 __ETHTOOL_MSG_USER_CNT,
@@ -56,6 +57,7 @@ enum { · 20 unmodified lines
56 ETHTOOL_MSG_PRIVFLAGS_NTF,57 ETHTOOL_MSG_PRIVFLAGS_NTF,
57 ETHTOOL_MSG_RINGS_GET_REPLY,58 ETHTOOL_MSG_RINGS_GET_REPLY,
58 ETHTOOL_MSG_RINGS_NTF,59 ETHTOOL_MSG_RINGS_NTF,
60 ETHTOOL_MSG_CHANNELS_GET_REPLY,
59 61
60 /* add new constants above here */62 /* add new constants above here */
61 __ETHTOOL_MSG_KERNEL_CNT,63 __ETHTOOL_MSG_KERNEL_CNT,
@@ -287,6 +289,25 @@ enum { · 225 unmodified lines
287 ETHTOOL_A_RINGS_MAX = (__ETHTOOL_A_RINGS_CNT - 1)289 ETHTOOL_A_RINGS_MAX = (__ETHTOOL_A_RINGS_CNT - 1)
288};290};
289 291
292/* CHANNELS */
293
294enum {
295 ETHTOOL_A_CHANNELS_UNSPEC,
296 ETHTOOL_A_CHANNELS_HEADER, /* nest - _A_HEADER_* */
297 ETHTOOL_A_CHANNELS_RX_MAX, /* u32 */
298 ETHTOOL_A_CHANNELS_TX_MAX, /* u32 */
299 ETHTOOL_A_CHANNELS_OTHER_MAX, /* u32 */
300 ETHTOOL_A_CHANNELS_COMBINED_MAX, /* u32 */
301 ETHTOOL_A_CHANNELS_RX_COUNT, /* u32 */
302 ETHTOOL_A_CHANNELS_TX_COUNT, /* u32 */
303 ETHTOOL_A_CHANNELS_OTHER_COUNT, /* u32 */
304 ETHTOOL_A_CHANNELS_COMBINED_COUNT, /* u32 */
305
306 /* add new constants above here */
307 __ETHTOOL_A_CHANNELS_CNT,
308 ETHTOOL_A_CHANNELS_MAX = (__ETHTOOL_A_CHANNELS_CNT - 1)
309};
310
290/* generic netlink info */311/* generic netlink info */
291#define ETHTOOL_GENL_NAME "ethtool"312#define ETHTOOL_GENL_NAME "ethtool"
292#define ETHTOOL_GENL_VERSION 1313#define ETHTOOL_GENL_VERSION 1

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t