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-next>] [day] [month] [year] [list]
Message-ID: <20240109155530.9661-1-aleksander.lobakin@intel.com>
Date: Tue,  9 Jan 2024 16:55:30 +0100
From: Alexander Lobakin <aleksander.lobakin@...el.com>
To: Michal Kubecek <mkubecek@...e.cz>
Cc: Alexander Lobakin <aleksander.lobakin@...el.com>,
	"David S. Miller" <davem@...emloft.net>,
	Jakub Kicinski <kuba@...nel.org>,
	netdev@...r.kernel.org
Subject: [PATCH ethtool-next] ethtool: add support for setting TCP data split

Add support for controlling header split (aka TCP data split) feature,
backed by kernel commit 50d73710715d ("ethtool: add SET for
TCP_DATA_SPLIT ringparam"). Command format:

ethtool -G|--set-ring devname tcp-data-split [ auto|on|off ]

"auto" is defined solely by device's driver.

Signed-off-by: Alexander Lobakin <aleksander.lobakin@...el.com>
---
 ethtool.8.in    |  4 ++++
 ethtool.c       |  1 +
 netlink/rings.c | 23 +++++++++++++++++++++++
 3 files changed, 28 insertions(+)

diff --git a/ethtool.8.in b/ethtool.8.in
index ef0c4bcabf37..dc7d4df4fcc1 100644
--- a/ethtool.8.in
+++ b/ethtool.8.in
@@ -202,6 +202,7 @@ ethtool \- query or control network driver and hardware settings
 .BN rx\-jumbo
 .BN tx
 .BN rx\-buf\-len
+.B3 tcp\-data\-split auto on off
 .BN cqe\-size
 .BN tx\-push
 .BN rx\-push
@@ -629,6 +630,9 @@ Changes the number of ring entries for the Tx ring.
 .BI rx\-buf\-len \ N
 Changes the size of a buffer in the Rx ring.
 .TP
+.BI tcp\-data\-split \ auto|on|off
+Specifies the state of TCP data split.
+.TP
 .BI cqe\-size \ N
 Changes the size of completion queue event.
 .TP
diff --git a/ethtool.c b/ethtool.c
index af51220b63cc..3ac15a7e54f6 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -5748,6 +5748,7 @@ static const struct option args[] = {
 			  "		[ rx-jumbo N ]\n"
 			  "		[ tx N ]\n"
 			  "		[ rx-buf-len N ]\n"
+			  "		[ tcp-data-split auto|on|off ]\n"
 			  "		[ cqe-size N ]\n"
 			  "		[ tx-push on|off ]\n"
 			  "		[ rx-push on|off ]\n"
diff --git a/netlink/rings.c b/netlink/rings.c
index 51d28c2ab055..f9eb67a4bc28 100644
--- a/netlink/rings.c
+++ b/netlink/rings.c
@@ -116,6 +116,22 @@ int nl_gring(struct cmd_context *ctx)
 
 /* RINGS_SET */
 
+static const struct lookup_entry_u8 tcp_data_split_values[] = {
+	{
+		.arg		= "auto",
+		.val		= ETHTOOL_TCP_DATA_SPLIT_UNKNOWN,
+	},
+	{
+		.arg		= "off",
+		.val		= ETHTOOL_TCP_DATA_SPLIT_DISABLED,
+	},
+	{
+		.arg		= "on",
+		.val		= ETHTOOL_TCP_DATA_SPLIT_ENABLED,
+	},
+	{}
+};
+
 static const struct param_parser sring_params[] = {
 	{
 		.arg		= "rx",
@@ -153,6 +169,13 @@ static const struct param_parser sring_params[] = {
 		.handler        = nl_parse_direct_u32,
 		.min_argc       = 1,
 	},
+	{
+		.arg		= "tcp-data-split",
+		.type		= ETHTOOL_A_RINGS_TCP_DATA_SPLIT,
+		.handler	= nl_parse_lookup_u8,
+		.handler_data	= tcp_data_split_values,
+		.min_argc	= 1,
+	},
 	{
 		.arg            = "cqe-size",
 		.type           = ETHTOOL_A_RINGS_CQE_SIZE,
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ