diff mbox series

[RFC,ethtool-next] ethtool: Add support for configuring hds-thresh

Message ID 20250331113944.594152-1-ap420073@gmail.com (mailing list archive)
State RFC
Delegated to: Michal Kubecek
Headers show
Series [RFC,ethtool-next] ethtool: Add support for configuring hds-thresh | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Taehee Yoo March 31, 2025, 11:39 a.m. UTC
HDS(Header Data Split) threshold value is used by header-data-split.
If received packet's length is larger than hds-thresh value,
header/data of packet will be splited.

ethtool -g|--get-ring <interface name> hds-thresh
ethtool -G|--set-ring <interface name> hds-thresh <0 - MAX>

The minimum value is 0, which indicates header/data will be splited
for all receive packets.
The maximum value is up to hardware limitation.

Signed-off-by: Taehee Yoo <ap420073@gmail.com>
---

This is an RFC due to merge-window.

 ethtool.8.in           |  4 ++++
 ethtool.c              |  1 +
 netlink/desc-ethtool.c |  2 ++
 netlink/rings.c        | 10 ++++++++++
 4 files changed, 17 insertions(+)
diff mbox series

Patch

diff --git a/ethtool.8.in b/ethtool.8.in
index 76a67c8..c910035 100644
--- a/ethtool.8.in
+++ b/ethtool.8.in
@@ -210,6 +210,7 @@  ethtool \- query or control network driver and hardware settings
 .BN tx
 .BN rx\-buf\-len
 .B3 tcp\-data\-split auto on off
+.BN hds\-thresh
 .BN cqe\-size
 .BN tx\-push
 .BN rx\-push
@@ -692,6 +693,9 @@  Changes the size of a buffer in the Rx ring.
 .BI tcp\-data\-split \ auto|on|off
 Specifies the state of TCP data split.
 .TP
+.BI hds\-thresh \ N
+Specifies the threshold value 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 c4b49c9..6817baf 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -5874,6 +5874,7 @@  static const struct option args[] = {
 			  "		[ tx-push on|off ]\n"
 			  "		[ rx-push on|off ]\n"
 			  "		[ tx-push-buf-len N]\n"
+			  "		[ hds-thresh N ]\n"
 	},
 	{
 		.opts	= "-k|--show-features|--show-offload",
diff --git a/netlink/desc-ethtool.c b/netlink/desc-ethtool.c
index 32a9eb3..e4529d5 100644
--- a/netlink/desc-ethtool.c
+++ b/netlink/desc-ethtool.c
@@ -161,6 +161,8 @@  static const struct pretty_nla_desc __rings_desc[] = {
 	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),
+	NLATTR_DESC_U32(ETHTOOL_A_RINGS_HDS_THRESH),
+	NLATTR_DESC_U32(ETHTOOL_A_RINGS_HDS_THRESH_MAX),
 };
 
 static const struct pretty_nla_desc __channels_desc[] = {
diff --git a/netlink/rings.c b/netlink/rings.c
index f9eb67a..5c695ab 100644
--- a/netlink/rings.c
+++ b/netlink/rings.c
@@ -51,6 +51,8 @@  int rings_reply_cb(const struct nlmsghdr *nlhdr, void *data)
 	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]);
+	show_u32("hds-thresh-max", "HDS thresh:\t\t",
+		 tb[ETHTOOL_A_RINGS_HDS_THRESH_MAX]);
 	print_string(PRINT_FP, NULL, "Current hardware settings:\n", NULL);
 	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]);
@@ -83,6 +85,8 @@  int rings_reply_cb(const struct nlmsghdr *nlhdr, void *data)
 		print_string(PRINT_ANY, tcp_hds_key, tcp_hds_fmt, tcp_hds_buf);
 		break;
 	}
+	show_u32("hds-thresh", "HDS thresh:\t\t",
+		 tb[ETHTOOL_A_RINGS_HDS_THRESH]);
 
 	close_json_object();
 
@@ -194,6 +198,12 @@  static const struct param_parser sring_params[] = {
 		.handler        = nl_parse_u8bool,
 		.min_argc       = 1,
 	},
+	{
+		.arg		= "hds-thresh",
+		.type		= ETHTOOL_A_RINGS_HDS_THRESH,
+		.handler	= nl_parse_direct_u32,
+		.min_argc	= 0,
+	},
 	{}
 };