diff mbox series

[ethtool-next,2/2] ethtool: netlink: add support to get/set tx copybreak buf size

Message ID 20211220083155.39882-3-huangguangbin2@huawei.com (mailing list archive)
State Accepted
Delegated to: Michal Kubecek
Headers show
Series add some supports for netlink | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Guangbin Huang Dec. 20, 2021, 8:31 a.m. UTC
From: Hao Chen <chenhao288@hisilicon.com>

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.

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 mbox series

Patch

diff --git a/ethtool.c b/ethtool.c
index 0dc3559..5d718a2 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"
 	},
 	{