aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniele Palmas <dnlplm@gmail.com>2023-03-13 10:51:07 +0100
committerMichal Kubecek <mkubecek@suse.cz>2023-04-19 00:15:22 +0200
commitec573f209dfdfe7fd36928bbf55f4a4fcc20e0b1 (patch)
treef37583d0de32a642b18366a68498746b343ec573
parent5cea67304a3c13e7757a0946aa1a0bff4989b899 (diff)
downloadethtool-ec573f209dfdfe7fd36928bbf55f4a4fcc20e0b1.tar.gz
netlink: settings: add netlink support for coalesce tx aggr params
Add support for getting/setting coalesce tx aggregation parameters (max bytes, max frames, max time). Signed-off-by: Daniele Palmas <dnlplm@gmail.com>
-rw-r--r--ethtool.8.in3
-rw-r--r--ethtool.c3
-rw-r--r--netlink/coalesce.c25
-rw-r--r--netlink/desc-ethtool.c3
-rw-r--r--shell-completion/bash/ethtool3
5 files changed, 37 insertions, 0 deletions
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