diff mbox series

[ethtool-next,2/2] ethtool: add support for get/set rx push in ringparams

Message ID 20230213203008.2321-3-shannon.nelson@amd.com (mailing list archive)
State Accepted
Delegated to: Michal Kubecek
Headers show
Series ethtool: add rx-push ringparam | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Nelson, Shannon Feb. 13, 2023, 8:30 p.m. UTC
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>
---
 ethtool.8.in           | 4 ++++
 ethtool.c              | 1 +
 netlink/desc-ethtool.c | 1 +
 netlink/rings.c        | 7 +++++++
 4 files changed, 13 insertions(+)
diff mbox series

Patch

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,
+	},
 	{}
 };