aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShannon Nelson <shannon.nelson@amd.com>2023-02-13 12:30:08 -0800
committerMichal Kubecek <mkubecek@suse.cz>2023-02-15 11:17:22 +0100
commitd29283211eb2f60a412c53dbde869a1f104196d3 (patch)
treedf3fccd955cbdb0a9fc3aeec9959b5976b26d5fd
parentaf509e84f7a68c25aba488fa73b3c3c72a2cfb8d (diff)
downloadethtool-d29283211eb2f60a412c53dbde869a1f104196d3.tar.gz
ethtool: add support for get/set rx push in ringparams
RX Push was recently added to the kernel's netlink messages along side tx push, and in use in the ionic NIC driver. Add support for "ethtool -G <dev> rx-push on|off" and "ethtool -g <dev>" to set/get rx push mode. Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
-rw-r--r--ethtool.8.in4
-rw-r--r--ethtool.c1
-rw-r--r--netlink/desc-ethtool.c1
-rw-r--r--netlink/rings.c7
4 files changed, 13 insertions, 0 deletions
diff --git a/ethtool.8.in b/ethtool.8.in
index 116f801..1708053 100644
--- a/ethtool.8.in
+++ b/ethtool.8.in
@@ -201,6 +201,7 @@ ethtool \- query or control network driver and hardware settings
.BN rx\-buf\-len
.BN cqe\-size
.BN tx\-push
+.BN rx\-push
.HP
.B ethtool \-i|\-\-driver
.I devname
@@ -621,6 +622,9 @@ Changes the size of completion queue event.
.TP
.BI tx\-push \ on|off
Specifies whether TX push should be enabled.
+.TP
+.BI rx\-push \ on|off
+Specifies whether RX push should be enabled.
.RE
.TP
.B \-i \-\-driver
diff --git a/ethtool.c b/ethtool.c
index c81c430..cdb9c2a 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -5750,6 +5750,7 @@ static const struct option args[] = {
" [ rx-buf-len N]\n"
" [ cqe-size N]\n"
" [ tx-push on|off]\n"
+ " [ rx-push on|off]\n"
},
{
.opts = "-k|--show-features|--show-offload",
diff --git a/netlink/desc-ethtool.c b/netlink/desc-ethtool.c
index d72974e..2d8aa39 100644
--- a/netlink/desc-ethtool.c
+++ b/netlink/desc-ethtool.c
@@ -158,6 +158,7 @@ static const struct pretty_nla_desc __rings_desc[] = {
NLATTR_DESC_U8_ENUM(ETHTOOL_A_RINGS_TCP_DATA_SPLIT, rings_tcp_data_split),
NLATTR_DESC_U32(ETHTOOL_A_RINGS_CQE_SIZE),
NLATTR_DESC_BOOL(ETHTOOL_A_RINGS_TX_PUSH),
+ NLATTR_DESC_BOOL(ETHTOOL_A_RINGS_RX_PUSH),
};
static const struct pretty_nla_desc __channels_desc[] = {
diff --git a/netlink/rings.c b/netlink/rings.c
index d51ef78..57bfb36 100644
--- a/netlink/rings.c
+++ b/netlink/rings.c
@@ -57,6 +57,7 @@ int rings_reply_cb(const struct nlmsghdr *nlhdr, void *data)
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";
tcp_hds_key = "tcp-data-split";
@@ -154,6 +155,12 @@ static const struct param_parser sring_params[] = {
.handler = nl_parse_u8bool,
.min_argc = 1,
},
+ {
+ .arg = "rx-push",
+ .type = ETHTOOL_A_RINGS_RX_PUSH,
+ .handler = nl_parse_u8bool,
+ .min_argc = 1,
+ },
{}
};