All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniele Palmas <dnlplm@gmail.com>
To: Michal Kubecek <mkubecek@suse.cz>
Cc: netdev@vger.kernel.org, Daniele Palmas <dnlplm@gmail.com>
Subject: [PATCH ethtool-next 1/1] netlink: settings: add netlink support for coalesce tx aggr params
Date: Mon, 13 Mar 2023 10:51:07 +0100	[thread overview]
Message-ID: <20230313095107.2319823-1-dnlplm@gmail.com> (raw)

Add support for getting/setting coalesce tx aggregation parameters
(max bytes, max frames, max time).

Signed-off-by: Daniele Palmas <dnlplm@gmail.com>
---
 ethtool.8.in                  |  3 +++
 ethtool.c                     |  3 +++
 netlink/coalesce.c            | 25 +++++++++++++++++++++++++
 netlink/desc-ethtool.c        |  3 +++
 shell-completion/bash/ethtool |  3 +++
 5 files changed, 37 insertions(+)

diff --git a/ethtool.8.in b/ethtool.8.in
index 3672e44..d171972 100644
--- a/ethtool.8.in
+++ b/ethtool.8.in
@@ -188,6 +188,9 @@ ethtool \- query or control network driver and hardware settings
 .BN sample\-interval
 .B2 cqe\-mode\-rx on off
 .B2 cqe\-mode\-tx on off
+.BN tx\-aggr\-max\-bytes
+.BN tx\-aggr\-max\-frames
+.BN tx\-aggr\-time\-usecs
 .HP
 .B ethtool \-g|\-\-show\-ring
 .I devname
diff --git a/ethtool.c b/ethtool.c
index 6022a6e..9e99831 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -5730,6 +5730,9 @@ static const struct option args[] = {
 			  "		[sample-interval N]\n"
 			  "		[cqe-mode-rx on|off]\n"
 			  "		[cqe-mode-tx on|off]\n"
+			  "		[tx-aggr-max-bytes N]\n"
+			  "		[tx-aggr-max-frames N]\n"
+			  "		[tx-aggr-time-usecs N]\n"
 	},
 	{
 		.opts	= "-g|--show-ring",
diff --git a/netlink/coalesce.c b/netlink/coalesce.c
index 17a814b..bc34d3d 100644
--- a/netlink/coalesce.c
+++ b/netlink/coalesce.c
@@ -89,6 +89,13 @@ int coalesce_reply_cb(const struct nlmsghdr *nlhdr, void *data)
 		  tb[ETHTOOL_A_COALESCE_USE_CQE_MODE_RX]);
 	show_bool("tx", "TX: %s\n", tb[ETHTOOL_A_COALESCE_USE_CQE_MODE_TX]);
 	show_cr();
+	show_u32("tx-aggr-max-bytes", "tx-aggr-max-bytes:\t",
+		 tb[ETHTOOL_A_COALESCE_TX_AGGR_MAX_BYTES]);
+	show_u32("tx-aggr-max-frames", "tx-aggr-max-frames:\t",
+		 tb[ETHTOOL_A_COALESCE_TX_AGGR_MAX_FRAMES]);
+	show_u32("tx-aggr-time-usecs", "tx-aggr-time-usecs\t",
+		 tb[ETHTOOL_A_COALESCE_TX_AGGR_TIME_USECS]);
+	show_cr();
 
 	close_json_object();
 
@@ -267,6 +274,24 @@ static const struct param_parser scoalesce_params[] = {
 		.handler	= nl_parse_u8bool,
 		.min_argc	= 1,
 	},
+	{
+		.arg		= "tx-aggr-max-bytes",
+		.type		= ETHTOOL_A_COALESCE_TX_AGGR_MAX_BYTES,
+		.handler	= nl_parse_direct_u32,
+		.min_argc	= 1,
+	},
+	{
+		.arg		= "tx-aggr-max-frames",
+		.type		= ETHTOOL_A_COALESCE_TX_AGGR_MAX_FRAMES,
+		.handler	= nl_parse_direct_u32,
+		.min_argc	= 1,
+	},
+	{
+		.arg		= "tx-aggr-time-usecs",
+		.type		= ETHTOOL_A_COALESCE_TX_AGGR_TIME_USECS,
+		.handler	= nl_parse_direct_u32,
+		.min_argc	= 1,
+	},
 	{}
 };
 
diff --git a/netlink/desc-ethtool.c b/netlink/desc-ethtool.c
index 2d8aa39..7b77f88 100644
--- a/netlink/desc-ethtool.c
+++ b/netlink/desc-ethtool.c
@@ -201,6 +201,9 @@ static const struct pretty_nla_desc __coalesce_desc[] = {
 	NLATTR_DESC_U32(ETHTOOL_A_COALESCE_RATE_SAMPLE_INTERVAL),
 	NLATTR_DESC_BOOL(ETHTOOL_A_COALESCE_USE_CQE_MODE_TX),
 	NLATTR_DESC_BOOL(ETHTOOL_A_COALESCE_USE_CQE_MODE_RX),
+	NLATTR_DESC_U32(ETHTOOL_A_COALESCE_TX_AGGR_MAX_BYTES),
+	NLATTR_DESC_U32(ETHTOOL_A_COALESCE_TX_AGGR_MAX_FRAMES),
+	NLATTR_DESC_U32(ETHTOOL_A_COALESCE_TX_AGGR_TIME_USECS),
 };
 
 static const struct pretty_nla_desc __pause_stats_desc[] = {
diff --git a/shell-completion/bash/ethtool b/shell-completion/bash/ethtool
index 46334b5..99c5f6f 100644
--- a/shell-completion/bash/ethtool
+++ b/shell-completion/bash/ethtool
@@ -254,6 +254,9 @@ _ethtool_coalesce()
 		[tx-usecs-high]=1
 		[tx-usecs-irq]=1
 		[tx-usecs-low]=1
+		[tx-aggr-max-bytes]=1
+		[tx-aggr-max-frames]=1
+		[tx-aggr-time-usecs]=1
 	)
 
 	case "$prev" in
-- 
2.37.1


                 reply	other threads:[~2023-03-13 10:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230313095107.2319823-1-dnlplm@gmail.com \
    --to=dnlplm@gmail.com \
    --cc=mkubecek@suse.cz \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.