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
3030 ETHTOOL_MSG_PRIVFLAGS_SET,
3131 ETHTOOL_MSG_RINGS_GET,
3232 ETHTOOL_MSG_RINGS_SET,
33+ ETHTOOL_MSG_CHANNELS_GET,
3334
3435 /* add new constants above here */
3536 __ETHTOOL_MSG_USER_CNT,
@@ -56,6 +57,7 @@ enum { · 20 unmodified lines
5657 ETHTOOL_MSG_PRIVFLAGS_NTF,
5758 ETHTOOL_MSG_RINGS_GET_REPLY,
5859 ETHTOOL_MSG_RINGS_NTF,
60+ ETHTOOL_MSG_CHANNELS_GET_REPLY,
5961
6062 /* add new constants above here */
6163 __ETHTOOL_MSG_KERNEL_CNT,
@@ -287,6 +289,25 @@ enum { · 225 unmodified lines
287289 ETHTOOL_A_RINGS_MAX = (__ETHTOOL_A_RINGS_CNT - 1)
288290 };
289291
292+/* CHANNELS */
293+
294+enum {
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+
290311 /* generic netlink info */
291312 #define ETHTOOL_GENL_NAME "ethtool"
292313 #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