lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 13 Feb 2023 12:30:08 -0800
From:   Shannon Nelson <shannon.nelson@....com>
To:     <netdev@...r.kernel.org>, <mkubecek@...e.cz>,
        <davem@...emloft.net>, <kuba@...nel.org>
CC:     <drivers@...sando.io>, Shannon Nelson <shannon.nelson@....com>
Subject: [PATCH ethtool-next 2/2] 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@....com>
---
 ethtool.8.in           | 4 ++++
 ethtool.c              | 1 +
 netlink/desc-ethtool.c | 1 +
 netlink/rings.c        | 7 +++++++
 4 files changed, 13 insertions(+)

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ