History

ethtool: provide coalescing parameters with COALESCE_GET request

Implement COALESCE_GET request to get coalescing parameters of a network device. These are traditionally available via ETHTOOL_GCOALESCE ioctl request. This commit adds only support for device coalescing parameters, not per queue coalescing parameters. Omit attributes with zero values unless they are declared as supported (i.e. the corresponding bit in ethtool_ops::supported_coalesce_params is set).

Michal Kubecek committed 6 years ago

Commit 21727541 parent b51fb776 files · +306 −2Browse files

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

Unified · Split

include/uapi/linux/ethtool_netlink.h+35−0
@@ -32,6 +32,7 @@ enum { · 31 unmodified lines
3232 ETHTOOL_MSG_RINGS_SET,
3333 ETHTOOL_MSG_CHANNELS_GET,
3434 ETHTOOL_MSG_CHANNELS_SET,
35+ ETHTOOL_MSG_COALESCE_GET,
3536
3637 /* add new constants above here */
3738 __ETHTOOL_MSG_USER_CNT,
@@ -60,6 +61,7 @@ enum { · 22 unmodified lines
6061 ETHTOOL_MSG_RINGS_NTF,
6162 ETHTOOL_MSG_CHANNELS_GET_REPLY,
6263 ETHTOOL_MSG_CHANNELS_NTF,
64+ ETHTOOL_MSG_COALESCE_GET_REPLY,
6365
6466 /* add new constants above here */
6567 __ETHTOOL_MSG_KERNEL_CNT,
@@ -310,6 +312,39 @@ enum { · 244 unmodified lines
310312 ETHTOOL_A_CHANNELS_MAX = (__ETHTOOL_A_CHANNELS_CNT - 1)
311313 };
312314
315+/* COALESCE */
316+
317+enum {
318+ ETHTOOL_A_COALESCE_UNSPEC,
319+ ETHTOOL_A_COALESCE_HEADER, /* nest - _A_HEADER_* */
320+ ETHTOOL_A_COALESCE_RX_USECS, /* u32 */
321+ ETHTOOL_A_COALESCE_RX_MAX_FRAMES, /* u32 */
322+ ETHTOOL_A_COALESCE_RX_USECS_IRQ, /* u32 */
323+ ETHTOOL_A_COALESCE_RX_MAX_FRAMES_IRQ, /* u32 */
324+ ETHTOOL_A_COALESCE_TX_USECS, /* u32 */
325+ ETHTOOL_A_COALESCE_TX_MAX_FRAMES, /* u32 */
326+ ETHTOOL_A_COALESCE_TX_USECS_IRQ, /* u32 */
327+ ETHTOOL_A_COALESCE_TX_MAX_FRAMES_IRQ, /* u32 */
328+ ETHTOOL_A_COALESCE_STATS_BLOCK_USECS, /* u32 */
329+ ETHTOOL_A_COALESCE_USE_ADAPTIVE_RX, /* u8 */
330+ ETHTOOL_A_COALESCE_USE_ADAPTIVE_TX, /* u8 */
331+ ETHTOOL_A_COALESCE_PKT_RATE_LOW, /* u32 */
332+ ETHTOOL_A_COALESCE_RX_USECS_LOW, /* u32 */
333+ ETHTOOL_A_COALESCE_RX_MAX_FRAMES_LOW, /* u32 */
334+ ETHTOOL_A_COALESCE_TX_USECS_LOW, /* u32 */
335+ ETHTOOL_A_COALESCE_TX_MAX_FRAMES_LOW, /* u32 */
336+ ETHTOOL_A_COALESCE_PKT_RATE_HIGH, /* u32 */
337+ ETHTOOL_A_COALESCE_RX_USECS_HIGH, /* u32 */
338+ ETHTOOL_A_COALESCE_RX_MAX_FRAMES_HIGH, /* u32 */
339+ ETHTOOL_A_COALESCE_TX_USECS_HIGH, /* u32 */
340+ ETHTOOL_A_COALESCE_TX_MAX_FRAMES_HIGH, /* u32 */
341+ ETHTOOL_A_COALESCE_RATE_SAMPLE_INTERVAL, /* u32 */
342+
343+ /* add new constants above here */
344+ __ETHTOOL_A_COALESCE_CNT,
345+ ETHTOOL_A_COALESCE_MAX = (__ETHTOOL_A_COALESCE_CNT - 1)
346+};
347+
313348 /* generic netlink info */
314349 #define ETHTOOL_GENL_NAME "ethtool"
315350 #define ETHTOOL_GENL_VERSION 1