ethtool/0001-rings-add-support-to-set-get-rx-buf-len.patch
Jiantao Xiao f2c66b07c9 add support to set or get rx buf len and add support to set or get tx push by ethtool -G
Signed-off-by: Jiantao Xiao <xiaojiantao1@h-partners.com>
2022-09-22 16:19:02 +08:00

59 lines
1.7 KiB
Diff

From 327b1f6ced24f63f16472c666b48e0af9e7b0039 Mon Sep 17 00:00:00 2001
From: Hao Chen <chenhao288@hisilicon.com>
Date: Mon, 20 Dec 2021 16:31:54 +0800
Subject: rings: add support to set/get rx buf len
Add support for "ethtool -G <dev> rx-buf-len xxx" and "ethtool -g <dev>"
to set/get rx-buf-len.
commit: a081c2a
Reference: https://git.kernel.org/pub/scm/network/ethtool/ethtool.git/commit/?h=v5.19&id=a081c2a5216a
Signed-off-by: Hao Chen <chenhao288@hisilicon.com>
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
---
ethtool.c | 1 +
netlink/rings.c | 7 +++++++
2 files changed, 8 insertions(+)
diff --git a/ethtool.c b/ethtool.c
index 46887c7..43f266e 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -5724,6 +5724,7 @@ static const struct option args[] = {
" [ rx-mini N ]\n"
" [ rx-jumbo N ]\n"
" [ tx N ]\n"
+ " [ rx-buf-len N]\n"
},
{
.opts = "-k|--show-features|--show-offload",
diff --git a/netlink/rings.c b/netlink/rings.c
index b8c458f..119178e 100644
--- a/netlink/rings.c
+++ b/netlink/rings.c
@@ -46,6 +46,7 @@ int rings_reply_cb(const struct nlmsghdr *nlhdr, void *data)
show_u32(tb[ETHTOOL_A_RINGS_RX_MINI], "RX Mini:\t");
show_u32(tb[ETHTOOL_A_RINGS_RX_JUMBO], "RX Jumbo:\t");
show_u32(tb[ETHTOOL_A_RINGS_TX], "TX:\t\t");
+ show_u32(tb[ETHTOOL_A_RINGS_RX_BUF_LEN], "RX Buf Len:\t\t");
return MNL_CB_OK;
}
@@ -98,6 +99,12 @@ static const struct param_parser sring_params[] = {
.handler = nl_parse_direct_u32,
.min_argc = 1,
},
+ {
+ .arg = "rx-buf-len",
+ .type = ETHTOOL_A_RINGS_RX_BUF_LEN,
+ .handler = nl_parse_direct_u32,
+ .min_argc = 1,
+ },
{}
};
--
2.33.0