aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYufeng Mo <moyufeng@huawei.com>2021-08-30 10:35:53 +0800
committerMichal Kubecek <mkubecek@suse.cz>2021-09-12 22:30:32 +0200
commitecfb7302cfe68354ce72762a5cd65e6497929949 (patch)
tree6641526ba09c6b5a3797e1f19eaabd841835caa3
parent7a15e1a0bdcc8d2a05729672c6beca27a1f3ea74 (diff)
downloadethtool-ecfb7302cfe68354ce72762a5cd65e6497929949.tar.gz
netlink: settings: add netlink support for coalesce cqe mode parameter
Add support for "ethtool -C <dev> cqe-mode-rx/cqe-mode-tx on/off" for setting coalesce cqe mode and show values in "ethtool -c <dev>" output. Signed-off-by: Yufeng Mo <moyufeng@huawei.com>
-rw-r--r--ethtool.8.in2
-rw-r--r--ethtool.c2
-rw-r--r--netlink/coalesce.c16
3 files changed, 20 insertions, 0 deletions
diff --git a/ethtool.8.in b/ethtool.8.in
index f83d6d1..c187c32 100644
--- a/ethtool.8.in
+++ b/ethtool.8.in
@@ -186,6 +186,8 @@ ethtool \- query or control network driver and hardware settings
.BN tx\-usecs\-high
.BN tx\-frames\-high
.BN sample\-interval
+.B2 cqe\-mode\-rx on off
+.B2 cqe\-mode\-tx on off
.HP
.B ethtool \-g|\-\-show\-ring
.I devname
diff --git a/ethtool.c b/ethtool.c
index 2486caa..a6826e9 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -5703,6 +5703,8 @@ static const struct option args[] = {
" [tx-usecs-high N]\n"
" [tx-frames-high N]\n"
" [sample-interval N]\n"
+ " [cqe-mode-rx on|off]\n"
+ " [cqe-mode-tx on|off]\n"
},
{
.opts = "-g|--show-ring",
diff --git a/netlink/coalesce.c b/netlink/coalesce.c
index 75922a9..15037c2 100644
--- a/netlink/coalesce.c
+++ b/netlink/coalesce.c
@@ -66,6 +66,10 @@ int coalesce_reply_cb(const struct nlmsghdr *nlhdr, void *data)
show_u32(tb[ETHTOOL_A_COALESCE_TX_USECS_HIGH], "tx-usecs-high: ");
show_u32(tb[ETHTOOL_A_COALESCE_TX_MAX_FRAMES_HIGH], "tx-frame-high: ");
putchar('\n');
+ show_bool("rx", "CQE mode RX: %s ",
+ tb[ETHTOOL_A_COALESCE_USE_CQE_MODE_RX]);
+ show_bool("tx", "TX: %s\n", tb[ETHTOOL_A_COALESCE_USE_CQE_MODE_TX]);
+ putchar('\n');
return MNL_CB_OK;
}
@@ -226,6 +230,18 @@ static const struct param_parser scoalesce_params[] = {
.handler = nl_parse_direct_u32,
.min_argc = 1,
},
+ {
+ .arg = "cqe-mode-rx",
+ .type = ETHTOOL_A_COALESCE_USE_CQE_MODE_RX,
+ .handler = nl_parse_u8bool,
+ .min_argc = 1,
+ },
+ {
+ .arg = "cqe-mode-tx",
+ .type = ETHTOOL_A_COALESCE_USE_CQE_MODE_TX,
+ .handler = nl_parse_u8bool,
+ .min_argc = 1,
+ },
{}
};