ethtool/0002-tunables-add-support-to-get-set-tx-copybreak-buf-siz.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

62 lines
1.8 KiB
Diff

From 53375183f19f8a6e6b6a3fc5776013aaf1bed23a Mon Sep 17 00:00:00 2001
From: Hao Chen <chenhao288@hisilicon.com>
Date: Mon, 20 Dec 2021 16:31:55 +0800
Subject: tunables: add support to get/set tx copybreak buf size
Add support for "ethtool --set-tunable <dev> tx-buf-size xxx"
and "ethtool --get-tunable <dev> tx-buf-size" to set/get
tx copybreak buf size.
commit: 51a9312
Reference: https://git.kernel.org/pub/scm/network/ethtool/ethtool.git/commit/?id=51a9312cc250
Signed-off-by: Hao Chen <chenhao288@hisilicon.com>
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
---
ethtool.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/ethtool.c b/ethtool.c
index 43f266e..040e911 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -5009,6 +5009,7 @@ tunable_strings[__ETHTOOL_TUNABLE_COUNT][ETH_GSTRING_LEN] = {
[ETHTOOL_ID_UNSPEC] = "Unspec",
[ETHTOOL_RX_COPYBREAK] = "rx-copybreak",
[ETHTOOL_TX_COPYBREAK] = "tx-copybreak",
+ [ETHTOOL_TX_COPYBREAK_BUF_SIZE] = "tx-buf-size",
[ETHTOOL_PFC_PREVENTION_TOUT] = "pfc-prevention-tout",
};
@@ -5048,6 +5049,11 @@ static struct ethtool_tunable_info tunables_info[] = {
.size = sizeof(u16),
.type = CMDL_U16,
},
+ { .t_id = ETHTOOL_TX_COPYBREAK_BUF_SIZE,
+ .t_type_id = ETHTOOL_TUNABLE_U32,
+ .size = sizeof(u32),
+ .type = CMDL_U32,
+ },
};
#define TUNABLES_INFO_SIZE ARRAY_SIZE(tunables_info)
@@ -5961,6 +5967,7 @@ static const struct option args[] = {
.help = "Get tunable",
.xhelp = " [ rx-copybreak ]\n"
" [ tx-copybreak ]\n"
+ " [ tx-buf-size ]\n"
" [ pfc-precention-tout ]\n"
},
{
@@ -5969,6 +5976,7 @@ static const struct option args[] = {
.help = "Set tunable",
.xhelp = " [ rx-copybreak N]\n"
" [ tx-copybreak N]\n"
+ " [ tx-buf-size N]\n"
" [ pfc-precention-tout N]\n"
},
{
--
2.33.0