All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH ethtool-next 0/2] add some supports for netlink
@ 2021-12-20  8:31 Guangbin Huang
  2021-12-20  8:31 ` [PATCH ethtool-next 1/2] ethtool: netlink: add support to set/get rx buf len Guangbin Huang
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Guangbin Huang @ 2021-12-20  8:31 UTC (permalink / raw)
  To: mkubecek, davem, kuba; +Cc: netdev, lipeng321, huangguangbin2, chenhao288

Add support for "ethtool -G/g <dev>" to set/get rx buf len
and support for "ethtool --set/get-tunable <dev>" to
set/get tx copybreak buf size.

Hao Chen (2):
  ethtool: netlink: add support to set/get rx buf len
  ethtool: netlink: add support to get/set tx copybreak buf size

 ethtool.c       | 9 +++++++++
 netlink/rings.c | 7 +++++++
 2 files changed, 16 insertions(+)

-- 
2.33.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH ethtool-next 1/2] ethtool: netlink: add support to set/get rx buf len
  2021-12-20  8:31 [PATCH ethtool-next 0/2] add some supports for netlink Guangbin Huang
@ 2021-12-20  8:31 ` Guangbin Huang
  2021-12-20  8:31 ` [PATCH ethtool-next 2/2] ethtool: netlink: add support to get/set tx copybreak buf size Guangbin Huang
  2022-01-05  8:45 ` [PATCH ethtool-next 0/2] add some supports for netlink Michal Kubecek
  2 siblings, 0 replies; 4+ messages in thread
From: Guangbin Huang @ 2021-12-20  8:31 UTC (permalink / raw)
  To: mkubecek, davem, kuba; +Cc: netdev, lipeng321, huangguangbin2, chenhao288

From: Hao Chen <chenhao288@hisilicon.com>

Add support for "ethtool -G <dev> rx-buf-len xxx" and "ethtool -g <dev>"
to set/get rx-buf-len.

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 55dac51..0dc3559 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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH ethtool-next 2/2] ethtool: netlink: add support to get/set tx copybreak buf size
  2021-12-20  8:31 [PATCH ethtool-next 0/2] add some supports for netlink Guangbin Huang
  2021-12-20  8:31 ` [PATCH ethtool-next 1/2] ethtool: netlink: add support to set/get rx buf len Guangbin Huang
@ 2021-12-20  8:31 ` Guangbin Huang
  2022-01-05  8:45 ` [PATCH ethtool-next 0/2] add some supports for netlink Michal Kubecek
  2 siblings, 0 replies; 4+ messages in thread
From: Guangbin Huang @ 2021-12-20  8:31 UTC (permalink / raw)
  To: mkubecek, davem, kuba; +Cc: netdev, lipeng321, huangguangbin2, chenhao288

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 --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"
 	},
 	{
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH ethtool-next 0/2] add some supports for netlink
  2021-12-20  8:31 [PATCH ethtool-next 0/2] add some supports for netlink Guangbin Huang
  2021-12-20  8:31 ` [PATCH ethtool-next 1/2] ethtool: netlink: add support to set/get rx buf len Guangbin Huang
  2021-12-20  8:31 ` [PATCH ethtool-next 2/2] ethtool: netlink: add support to get/set tx copybreak buf size Guangbin Huang
@ 2022-01-05  8:45 ` Michal Kubecek
  2 siblings, 0 replies; 4+ messages in thread
From: Michal Kubecek @ 2022-01-05  8:45 UTC (permalink / raw)
  To: Guangbin Huang; +Cc: davem, kuba, netdev, lipeng321, chenhao288

[-- Attachment #1: Type: text/plain, Size: 697 bytes --]

On Mon, Dec 20, 2021 at 04:31:53PM +0800, Guangbin Huang wrote:
> Add support for "ethtool -G/g <dev>" to set/get rx buf len
> and support for "ethtool --set/get-tunable <dev>" to
> set/get tx copybreak buf size.

Applied both patches to next branch (with minor subject adjustment so
that the bot may not recognize). Next time, please do not forget to
update also the man page (ethtool.8.in file).

Michal

> 
> Hao Chen (2):
>   ethtool: netlink: add support to set/get rx buf len
>   ethtool: netlink: add support to get/set tx copybreak buf size
> 
>  ethtool.c       | 9 +++++++++
>  netlink/rings.c | 7 +++++++
>  2 files changed, 16 insertions(+)
> 
> -- 
> 2.33.0
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-01-05  8:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-20  8:31 [PATCH ethtool-next 0/2] add some supports for netlink Guangbin Huang
2021-12-20  8:31 ` [PATCH ethtool-next 1/2] ethtool: netlink: add support to set/get rx buf len Guangbin Huang
2021-12-20  8:31 ` [PATCH ethtool-next 2/2] ethtool: netlink: add support to get/set tx copybreak buf size Guangbin Huang
2022-01-05  8:45 ` [PATCH ethtool-next 0/2] add some supports for netlink Michal Kubecek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.