All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 ethtool-next 0/2] Add tx push buf len param to ethtool
@ 2023-04-23 14:49 Shay Agroskin
  2023-04-23 14:49 ` [PATCH v2 ethtool-next 1/2] update UAPI header copies Shay Agroskin
  2023-04-23 14:49 ` [PATCH v2 ethtool-next 2/2] ethtool: Add support for configuring tx-push-buf-len Shay Agroskin
  0 siblings, 2 replies; 3+ messages in thread
From: Shay Agroskin @ 2023-04-23 14:49 UTC (permalink / raw)
  To: Michal Kubecek, David Miller, Jakub Kicinski, netdev
  Cc: Shay Agroskin, Woodhouse, David, Machulsky, Zorik, Matushevsky,
	Alexander, Saeed Bshara, Wilson, Matt, Liguori, Anthony, Bshara,
	Nafea, Belgazal, Netanel, Saidi, Ali, Herrenschmidt, Benjamin,
	Kiyanovski, Arthur, Dagan, Noam, Arinzon, David, Itzko, Shahar,
	Abboud, Osama, Eric Dumazet, Paolo Abeni, Vladimir Oltean,
	Andrew Lunn, Johannes Berg, Edward Cree, Florian Westphal

This patchset adds a new sub-configuration to ethtool get/set queue
params (ethtool -g) called 'tx-push-buf-len'.

This configuration specifies the maximum number of bytes of a
transmitted packet a driver can push directly to the underlying
device ('push' mode). The motivation for pushing some of the bytes to
the device has the advantages of

- Allowing a smart device to take fast actions based on the packet's
  header
- Reducing latency for small packets that can be copied completely into
  the device

This new param is practically similar to tx-copybreak value that can be
set using ethtool's tunable but conceptually serves a different purpose.
While tx-copybreak is used to reduce the overhead of DMA mapping and
makes no sense to use if less than the whole segment gets copied,
tx-push-buf-len allows to improve performance by analyzing the packet's
data (usually headers) before performing the DMA operation.

The configuration can be queried and set using the commands:

    $ ethtool -g [interface]

    # ethtool -G [interface] tx-push-buf-len [number of bytes]

Shay Agroskin (2):
  update UAPI header copies
  ethtool: Add support for configuring tx-push-buf-len

 ethtool.8.in                 |  5 +++++
 ethtool.c                    |  1 +
 netlink/desc-ethtool.c       |  2 ++
 netlink/rings.c              | 38 +++++++++++++++++++++++-------------
 uapi/linux/ethtool_netlink.h |  2 ++
 uapi/linux/rtnetlink.h       |  1 +
 6 files changed, 35 insertions(+), 14 deletions(-)

-- 
2.25.1


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

* [PATCH v2 ethtool-next 1/2] update UAPI header copies
  2023-04-23 14:49 [PATCH v2 ethtool-next 0/2] Add tx push buf len param to ethtool Shay Agroskin
@ 2023-04-23 14:49 ` Shay Agroskin
  2023-04-23 14:49 ` [PATCH v2 ethtool-next 2/2] ethtool: Add support for configuring tx-push-buf-len Shay Agroskin
  1 sibling, 0 replies; 3+ messages in thread
From: Shay Agroskin @ 2023-04-23 14:49 UTC (permalink / raw)
  To: Michal Kubecek, David Miller, Jakub Kicinski, netdev
  Cc: Shay Agroskin, Woodhouse, David, Machulsky, Zorik, Matushevsky,
	Alexander, Saeed Bshara, Wilson, Matt, Liguori, Anthony, Bshara,
	Nafea, Belgazal, Netanel, Saidi, Ali, Herrenschmidt, Benjamin,
	Kiyanovski, Arthur, Dagan, Noam, Arinzon, David, Itzko, Shahar,
	Abboud, Osama, Eric Dumazet, Paolo Abeni, Vladimir Oltean,
	Andrew Lunn, Johannes Berg, Edward Cree, Florian Westphal

Update to kernel commit 233eb4e786b5.

Signed-off-by: Shay Agroskin <shayagr@amazon.com>
---
 uapi/linux/ethtool_netlink.h | 2 ++
 uapi/linux/rtnetlink.h       | 1 +
 2 files changed, 3 insertions(+)

diff --git a/uapi/linux/ethtool_netlink.h b/uapi/linux/ethtool_netlink.h
index 13493c9..cd85de1 100644
--- a/uapi/linux/ethtool_netlink.h
+++ b/uapi/linux/ethtool_netlink.h
@@ -357,6 +357,8 @@ enum {
 	ETHTOOL_A_RINGS_CQE_SIZE,			/* u32 */
 	ETHTOOL_A_RINGS_TX_PUSH,			/* u8 */
 	ETHTOOL_A_RINGS_RX_PUSH,			/* u8 */
+	ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN,		/* u32 */
+	ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN_MAX,		/* u32 */
 
 	/* add new constants above here */
 	__ETHTOOL_A_RINGS_CNT,
diff --git a/uapi/linux/rtnetlink.h b/uapi/linux/rtnetlink.h
index 217b25b..2132e94 100644
--- a/uapi/linux/rtnetlink.h
+++ b/uapi/linux/rtnetlink.h
@@ -787,6 +787,7 @@ enum {
 	TCA_ROOT_FLAGS,
 	TCA_ROOT_COUNT,
 	TCA_ROOT_TIME_DELTA, /* in msecs */
+	TCA_ROOT_EXT_WARN_MSG,
 	__TCA_ROOT_MAX,
 #define	TCA_ROOT_MAX (__TCA_ROOT_MAX - 1)
 };
-- 
2.25.1


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

* [PATCH v2 ethtool-next 2/2] ethtool: Add support for configuring tx-push-buf-len
  2023-04-23 14:49 [PATCH v2 ethtool-next 0/2] Add tx push buf len param to ethtool Shay Agroskin
  2023-04-23 14:49 ` [PATCH v2 ethtool-next 1/2] update UAPI header copies Shay Agroskin
@ 2023-04-23 14:49 ` Shay Agroskin
  1 sibling, 0 replies; 3+ messages in thread
From: Shay Agroskin @ 2023-04-23 14:49 UTC (permalink / raw)
  To: Michal Kubecek, David Miller, Jakub Kicinski, netdev
  Cc: Shay Agroskin, Woodhouse, David, Machulsky, Zorik, Matushevsky,
	Alexander, Saeed Bshara, Wilson, Matt, Liguori, Anthony, Bshara,
	Nafea, Belgazal, Netanel, Saidi, Ali, Herrenschmidt, Benjamin,
	Kiyanovski, Arthur, Dagan, Noam, Arinzon, David, Itzko, Shahar,
	Abboud, Osama, Eric Dumazet, Paolo Abeni, Vladimir Oltean,
	Andrew Lunn, Johannes Berg, Edward Cree, Florian Westphal

This attribute, which is part of ethtool's ring param configuration
allows the user to specify the maximum number of the packet's payload
that can be written directly to the device.

Example usage:
    # ethtool -G [interface] tx-push-buf-len [number of bytes]

Signed-off-by: Shay Agroskin <shayagr@amazon.com>
---
 ethtool.8.in           |  5 +++++
 ethtool.c              |  1 +
 netlink/desc-ethtool.c |  2 ++
 netlink/rings.c        | 38 ++++++++++++++++++++++++--------------
 4 files changed, 32 insertions(+), 14 deletions(-)

diff --git a/ethtool.8.in b/ethtool.8.in
index 3672e44..f068258 100644
--- a/ethtool.8.in
+++ b/ethtool.8.in
@@ -202,6 +202,7 @@ ethtool \- query or control network driver and hardware settings
 .BN cqe\-size
 .BN tx\-push
 .BN rx\-push
+.BN tx\-push\-buf\-len
 .HP
 .B ethtool \-i|\-\-driver
 .I devname
@@ -625,6 +626,10 @@ Specifies whether TX push should be enabled.
 .TP
 .BI rx\-push \ on|off
 Specifies whether RX push should be enabled.
+.TP
+.BI tx\-push\-buf\-len \ N
+Specifies the maximum number of bytes of a transmitted packet a driver can push
+directly to the underlying device
 .RE
 .TP
 .B \-i \-\-driver
diff --git a/ethtool.c b/ethtool.c
index 6022a6e..ea79529 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -5751,6 +5751,7 @@ static const struct option args[] = {
 			  "		[ cqe-size N ]\n"
 			  "		[ tx-push on|off ]\n"
 			  "		[ rx-push on|off ]\n"
+			  "		[ tx-push-buf-len N]\n"
 	},
 	{
 		.opts	= "-k|--show-features|--show-offload",
diff --git a/netlink/desc-ethtool.c b/netlink/desc-ethtool.c
index 2d8aa39..c79ba3a 100644
--- a/netlink/desc-ethtool.c
+++ b/netlink/desc-ethtool.c
@@ -159,6 +159,8 @@ static const struct pretty_nla_desc __rings_desc[] = {
 	NLATTR_DESC_U32(ETHTOOL_A_RINGS_CQE_SIZE),
 	NLATTR_DESC_BOOL(ETHTOOL_A_RINGS_TX_PUSH),
 	NLATTR_DESC_BOOL(ETHTOOL_A_RINGS_RX_PUSH),
+	NLATTR_DESC_U32(ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN),
+	NLATTR_DESC_U32(ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN_MAX),
 };
 
 static const struct pretty_nla_desc __channels_desc[] = {
diff --git a/netlink/rings.c b/netlink/rings.c
index 57bfb36..51d28c2 100644
--- a/netlink/rings.c
+++ b/netlink/rings.c
@@ -44,22 +44,26 @@ int rings_reply_cb(const struct nlmsghdr *nlhdr, void *data)
 	print_string(PRINT_ANY, "ifname", "Ring parameters for %s:\n",
 		     nlctx->devname);
 	print_string(PRINT_FP, NULL, "Pre-set maximums:\n", NULL);
-	show_u32("rx-max", "RX:\t\t", tb[ETHTOOL_A_RINGS_RX_MAX]);
-	show_u32("rx-mini-max", "RX Mini:\t", tb[ETHTOOL_A_RINGS_RX_MINI_MAX]);
-	show_u32("rx-jumbo-max", "RX Jumbo:\t",
+	show_u32("rx-max", "RX:\t\t\t", tb[ETHTOOL_A_RINGS_RX_MAX]);
+	show_u32("rx-mini-max", "RX Mini:\t\t", tb[ETHTOOL_A_RINGS_RX_MINI_MAX]);
+	show_u32("rx-jumbo-max", "RX Jumbo:\t\t",
 		 tb[ETHTOOL_A_RINGS_RX_JUMBO_MAX]);
-	show_u32("tx-max", "TX:\t\t", tb[ETHTOOL_A_RINGS_TX_MAX]);
+	show_u32("tx-max", "TX:\t\t\t", tb[ETHTOOL_A_RINGS_TX_MAX]);
+	show_u32("tx-push-buff-max-len", "TX push buff len:\t",
+		 tb[ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN_MAX]);
 	print_string(PRINT_FP, NULL, "Current hardware settings:\n", NULL);
-	show_u32("rx", "RX:\t\t", tb[ETHTOOL_A_RINGS_RX]);
-	show_u32("rx-mini", "RX Mini:\t", tb[ETHTOOL_A_RINGS_RX_MINI]);
-	show_u32("rx-jumbo", "RX Jumbo:\t", tb[ETHTOOL_A_RINGS_RX_JUMBO]);
-	show_u32("tx", "TX:\t\t", tb[ETHTOOL_A_RINGS_TX]);
-	show_u32("rx-buf-len", "RX Buf Len:\t", tb[ETHTOOL_A_RINGS_RX_BUF_LEN]);
-	show_u32("cqe-size", "CQE Size:\t", tb[ETHTOOL_A_RINGS_CQE_SIZE]);
-	show_bool("tx-push", "TX Push:\t%s\n", tb[ETHTOOL_A_RINGS_TX_PUSH]);
-	show_bool("rx-push", "RX Push:\t%s\n", tb[ETHTOOL_A_RINGS_RX_PUSH]);
-
-	tcp_hds_fmt = "TCP data split:\t%s\n";
+	show_u32("rx", "RX:\t\t\t", tb[ETHTOOL_A_RINGS_RX]);
+	show_u32("rx-mini", "RX Mini:\t\t", tb[ETHTOOL_A_RINGS_RX_MINI]);
+	show_u32("rx-jumbo", "RX Jumbo:\t\t", tb[ETHTOOL_A_RINGS_RX_JUMBO]);
+	show_u32("tx", "TX:\t\t\t", tb[ETHTOOL_A_RINGS_TX]);
+	show_u32("rx-buf-len", "RX Buf Len:\t\t", tb[ETHTOOL_A_RINGS_RX_BUF_LEN]);
+	show_u32("cqe-size", "CQE Size:\t\t", tb[ETHTOOL_A_RINGS_CQE_SIZE]);
+	show_bool("tx-push", "TX Push:\t\t%s\n", tb[ETHTOOL_A_RINGS_TX_PUSH]);
+	show_bool("rx-push", "RX Push:\t\t%s\n", tb[ETHTOOL_A_RINGS_RX_PUSH]);
+	show_u32("tx-push-buf-len", "TX push buff len:\t",
+		 tb[ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN]);
+
+	tcp_hds_fmt = "TCP data split:\t\t%s\n";
 	tcp_hds_key = "tcp-data-split";
 	tcp_hds = tb[ETHTOOL_A_RINGS_TCP_DATA_SPLIT] ?
 		mnl_attr_get_u8(tb[ETHTOOL_A_RINGS_TCP_DATA_SPLIT]) : 0;
@@ -137,6 +141,12 @@ static const struct param_parser sring_params[] = {
 		.handler	= nl_parse_direct_u32,
 		.min_argc	= 1,
 	},
+	{
+		.arg		= "tx-push-buf-len",
+		.type		= ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN,
+		.handler	= nl_parse_direct_u32,
+		.min_argc	= 1,
+	},
 	{
 		.arg            = "rx-buf-len",
 		.type           = ETHTOOL_A_RINGS_RX_BUF_LEN,
-- 
2.25.1


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

end of thread, other threads:[~2023-04-23 14:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-23 14:49 [PATCH v2 ethtool-next 0/2] Add tx push buf len param to ethtool Shay Agroskin
2023-04-23 14:49 ` [PATCH v2 ethtool-next 1/2] update UAPI header copies Shay Agroskin
2023-04-23 14:49 ` [PATCH v2 ethtool-next 2/2] ethtool: Add support for configuring tx-push-buf-len Shay Agroskin

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.