ethtool: Add support for configuring tx-push-buf-len
Subsystems (2)
PATCH 1/1 ethtool: Add support for configuring tx-push-buf-len
This attribute, which is part of ethtool's ring param configuration allows the user to specify the maximum number of the packet's payload that can be written directly to the device.
Example usage:
# ethtool -G [interface] tx-push-buf-len [number of bytes]
Signed-off-by Shay Agroskin <[email protected]>
--- ethtool.c | 1 + netlink/desc-ethtool.c | 2 ++ netlink/rings.c | 38 +++++++++++++++++++++++------------- uapi/linux/ethtool_netlink.h | 2 ++ 4 files changed, 29 insertions(+), 14 deletions(-)
ethtool.c +1 -0
@@ -5751,6 +5751,7 @@ static const struct option args[] = {" [ cqe-size N ]\n" " [ tx-push on|off ]\n" " [ rx-push on|off ]\n" +" [ tx-push-buf-len N]\n" }, { .opts = "-k|--show-features|--show-offload",
netlink/desc-ethtool.c +2 -0
@@ -159,6 +159,8 @@ static const struct pretty_nla_desc __rings_desc[] = {NLATTR_DESC_U32 (ETHTOOL_A_RINGS_CQE_SIZE ),NLATTR_DESC_BOOL (ETHTOOL_A_RINGS_TX_PUSH ),NLATTR_DESC_BOOL (ETHTOOL_A_RINGS_RX_PUSH ), +NLATTR_DESC_U32 (ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN ), + NLATTR_DESC_U32(ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN_MAX), };static const struct pretty_nla_desc __channels_desc[] = {
netlink/rings.c +24 -14
@@ -44,22 +44,26 @@ int rings_reply_cb(const struct nlmsghdr *nlhdr, void *data)print_string (PRINT_ANY ,"ifname" ,"Ring parameters for %s:\n" , nlctx->devname);print_string (PRINT_FP ,NULL ,"Pre-set maximums:\n" ,NULL ); -show_u32 ("rx-max" ,"RX:\t\t" , tb[ETHTOOL_A_RINGS_RX_MAX ]); -show_u32 ("rx-mini-max" ,"RX Mini:\t" , tb[ETHTOOL_A_RINGS_RX_MINI_MAX ]); -show_u32 ("rx-jumbo-max" ,"RX Jumbo:\t" , +show_u32 ("rx-max" ,"RX:\t\t\t" , tb[ETHTOOL_A_RINGS_RX_MAX ]); +show_u32 ("rx-mini-max" ,"RX Mini:\t\t" , tb[ETHTOOL_A_RINGS_RX_MINI_MAX ]); +show_u32 ("rx-jumbo-max" ,"RX Jumbo:\t\t" , tb[ETHTOOL_A_RINGS_RX_JUMBO_MAX ]); -show_u32 ("tx-max" ,"TX:\t\t" , tb[ETHTOOL_A_RINGS_TX_MAX ]); +show_u32 ("tx-max" ,"TX:\t\t\t" , tb[ETHTOOL_A_RINGS_TX_MAX ]); +show_u32 ("tx-push-buff-max-len" ,"TX push buff len:\t" , + tb[ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN_MAX ]);print_string (PRINT_FP ,NULL ,"Current hardware settings:\n" ,NULL ); -show_u32 ("rx" ,"RX:\t\t" , tb[ETHTOOL_A_RINGS_RX ]); -show_u32 ("rx-mini" ,"RX Mini:\t" , tb[ETHTOOL_A_RINGS_RX_MINI ]); -show_u32 ("rx-jumbo" ,"RX Jumbo:\t" , tb[ETHTOOL_A_RINGS_RX_JUMBO ]); -show_u32 ("tx" ,"TX:\t\t" , tb[ETHTOOL_A_RINGS_TX ]); -show_u32 ("rx-buf-len" ,"RX Buf Len:\t" , tb[ETHTOOL_A_RINGS_RX_BUF_LEN ]); -show_u32 ("cqe-size" ,"CQE Size:\t" , tb[ETHTOOL_A_RINGS_CQE_SIZE ]); -show_bool ("tx-push" ,"TX Push:\t%s\n" , tb[ETHTOOL_A_RINGS_TX_PUSH ]); -show_bool ("rx-push" ,"RX Push:\t%s\n" , tb[ETHTOOL_A_RINGS_RX_PUSH ]); - - tcp_hds_fmt ="TCP data split:\t%s\n" ; +show_u32 ("rx" ,"RX:\t\t\t" , tb[ETHTOOL_A_RINGS_RX ]); +show_u32 ("rx-mini" ,"RX Mini:\t\t" , tb[ETHTOOL_A_RINGS_RX_MINI ]); +show_u32 ("rx-jumbo" ,"RX Jumbo:\t\t" , tb[ETHTOOL_A_RINGS_RX_JUMBO ]); +show_u32 ("tx" ,"TX:\t\t\t" , tb[ETHTOOL_A_RINGS_TX ]); +show_u32 ("rx-buf-len" ,"RX Buf Len:\t\t" , tb[ETHTOOL_A_RINGS_RX_BUF_LEN ]); +show_u32 ("cqe-size" ,"CQE Size:\t\t" , tb[ETHTOOL_A_RINGS_CQE_SIZE ]); +show_bool ("tx-push" ,"TX Push:\t\t%s\n" , tb[ETHTOOL_A_RINGS_TX_PUSH ]); +show_bool ("rx-push" ,"RX Push:\t\t%s\n" , tb[ETHTOOL_A_RINGS_RX_PUSH ]); +show_u32 ("tx-push-buf-len" ,"TX push buff len:\t" , + tb[ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN ]); + + tcp_hds_fmt ="TCP data split:\t\t%s\n" ; tcp_hds_key ="tcp-data-split" ; tcp_hds = tb[ETHTOOL_A_RINGS_TCP_DATA_SPLIT ] ?mnl_attr_get_u8 (tb[ETHTOOL_A_RINGS_TCP_DATA_SPLIT ]) :0 ;
@@ -137,6 +141,12 @@ static const struct param_parser sring_params[] = { .handler = nl_parse_direct_u32, .min_argc = 1, }, + { + .arg = "tx-push-buf-len", + .type = ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN, + .handler = nl_parse_direct_u32, + .min_argc = 1, + }, { .arg = "rx-buf-len", .type = ETHTOOL_A_RINGS_RX_BUF_LEN,
uapi/linux/ethtool_netlink.h +2 -0
@@ -357,6 +357,8 @@ enum {ETHTOOL_A_RINGS_CQE_SIZE ,/* u32 */ ETHTOOL_A_RINGS_TX_PUSH ,/* u8 */ ETHTOOL_A_RINGS_RX_PUSH ,/* u8 */ +ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN ,/* u32 */ +ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN_MAX ,/* u32 */ /* add new constants above here */ __ETHTOOL_A_RINGS_CNT,
Signature · 1 line
2.25.1
Quoted 8 lines · Shay Agroskin
This attribute, which is part of ethtool's ring param configuration allows the user to specify the maximum number of the packet's payload that can be written directly to the device.
Example usage:
# ethtool -G [interface] tx-push-buf-len [number of bytes]Signed-off-by Shay Agroskin <[email protected]>
Looks good to me, except for two minor issues:
1. Please update the uapi header copies in a separate commit as described in https://www.kernel.org/pub/software/network/ethtool/devel.html
2. Please update also the man page (file ethtool.8.in).
Thank you,
Michal