Skip to contentSkip to conversation

ethtool: add rx-push ringparam

PATCH In review Shannon Nelson 2 participants 5 messages Feb 13, 2023 – Feb 15, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover ethtool: add rx-push ringparam

Add the rx-push ringparam attribute to the ethtool utility.

The first is a uapi patch that could be dropped in favor of a larger uapi update patch, depending on timing of tree maintenance.

Shannon Nelson (2):
ethtool: uapi update for RX_PUSH ringparam attribute
ethtool: add support for get/set rx push in ringparams

 ethtool.8.in                 | 4 ++++
 ethtool.c                    | 1 +
 netlink/desc-ethtool.c       | 1 +
 netlink/rings.c              | 7 +++++++
 uapi/linux/ethtool_netlink.h | 1 +
 5 files changed, 14 insertions(+)
Signature · 1 line
2.31.1
#1 lore raw

PATCH 1/2 ethtool: uapi update for RX_PUSH ringparam attribute

Adds the new uapi ETHTOOL_A_RINGS_RX_PUSH attribute as found in the next-next commit
5b4e9a7a71ab ("net: ethtool: extend ringparam set/get APIs for rx_push")

---
 uapi/linux/ethtool_netlink.h | 1 +
 1 file changed, 1 insertion(+)
uapi/linux/ethtool_netlink.h +1 -0
index 4cf91e5..13493c9 100644
@@ -356,6 +356,7 @@ enum {
 	ETHTOOL_A_RINGS_TCP_DATA_SPLIT,			/* u8 */
 	ETHTOOL_A_RINGS_CQE_SIZE,			/* u32 */
 	ETHTOOL_A_RINGS_TX_PUSH,			/* u8 */
+	ETHTOOL_A_RINGS_RX_PUSH,			/* u8 */
 
 	/* add new constants above here */
 	__ETHTOOL_A_RINGS_CNT,
Signature · 1 line
2.31.1
#2 lore raw

Re: [PATCH ethtool-next 1/2] ethtool: uapi update for RX_PUSH ringparam attribute

Quoted 14 lines · Shannon Nelson

Adds the new uapi ETHTOOL_A_RINGS_RX_PUSH attribute as found in the next-next commit
5b4e9a7a71ab ("net: ethtool: extend ringparam set/get APIs for rx_push")

---
 uapi/linux/ethtool_netlink.h | 1 +
 1 file changed, 1 insertion(+)
uapi/linux/ethtool_netlink.h +0 -0
index 4cf91e5..13493c9 100644

uapi/linux/ethtool_netlink.h enum { · line 362

Quoted 7 lines
uapi/linux/ethtool_netlink.h +1 -0
@@ -356,6 +356,7 @@ enum {
 	ETHTOOL_A_RINGS_TCP_DATA_SPLIT,			/* u8 */
 	ETHTOOL_A_RINGS_CQE_SIZE,			/* u32 */
 	ETHTOOL_A_RINGS_TX_PUSH,			/* u8 */
+	ETHTOOL_A_RINGS_RX_PUSH,			/* u8 */
 
 	/* add new constants above here */
 	__ETHTOOL_A_RINGS_CNT,

I replaced this patch with a full update from current net-next head (kernel commit 1ed32ad4a3cb), next time please follow the guidelines at

https://mirrors.edge.kernel.org/pub/software/network/ethtool/devel.html

(third paragraph in section "Submitting patches").

Michal

#3 lore raw

Re: [PATCH ethtool-next 1/2] ethtool: uapi update for RX_PUSH ringparam attribute

Quoted 26 lines · Michal Kubecek
Quoted 14 lines · Shannon Nelson

Adds the new uapi ETHTOOL_A_RINGS_RX_PUSH attribute as found in the next-next commit
5b4e9a7a71ab ("net: ethtool: extend ringparam set/get APIs for rx_push")

---
 uapi/linux/ethtool_netlink.h | 1 +
 1 file changed, 1 insertion(+)
uapi/linux/ethtool_netlink.h +0 -0
index 4cf91e5..13493c9 100644

uapi/linux/ethtool_netlink.h enum { · line 362

Quoted 7 lines
uapi/linux/ethtool_netlink.h +1 -0
@@ -356,6 +356,7 @@ enum {
 	ETHTOOL_A_RINGS_TCP_DATA_SPLIT,			/* u8 */
 	ETHTOOL_A_RINGS_CQE_SIZE,			/* u32 */
 	ETHTOOL_A_RINGS_TX_PUSH,			/* u8 */
+	ETHTOOL_A_RINGS_RX_PUSH,			/* u8 */
 
 	/* add new constants above here */
 	__ETHTOOL_A_RINGS_CNT,

I replaced this patch with a full update from current net-next head (kernel commit 1ed32ad4a3cb), next time please follow the guidelines at

Quoted 5 lines

https://mirrors.edge.kernel.org/pub/software/network/ethtool/devel.html

(third paragraph in section "Submitting patches").

Michal

Thanks - somehow I didn't stumble across that page so wasn't sure of the process. I'll check it next time.

Cheers,
sln

#4 lore raw

PATCH 2/2 ethtool: add support for get/set rx push in ringparams

In reply to Shannon Nelson

RX Push was recently added to the kernel's netlink messages along side tx push, and in use in the ionic NIC driver. Add support for "ethtool -G <dev> rx-push on|off" and "ethtool -g <dev>" to set/get rx push mode.

---
 ethtool.8.in           | 4 ++++
 ethtool.c              | 1 +
 netlink/desc-ethtool.c | 1 +
 netlink/rings.c        | 7 +++++++
 4 files changed, 13 insertions(+)
ethtool.8.in +4 -0
index 116f801..1708053 100644
@@ -201,6 +201,7 @@ ethtool \- query or control network driver and hardware settings
 .BN rx\-buf\-len
 .BN cqe\-size
 .BN tx\-push
+.BN rx\-push
 .HP
 .B ethtool \-i|\-\-driver
 .I devname
@@ -621,6 +622,9 @@ Changes the size of completion queue event.
 .TP
 .BI tx\-push \ on|off
 Specifies whether TX push should be enabled.
+.TP
+.BI rx\-push \ on|off
+Specifies whether RX push should be enabled.
 .RE
 .TP
 .B \-i \-\-driver
ethtool.c +1 -0
index c81c430..cdb9c2a 100644
@@ -5750,6 +5750,7 @@ static const struct option args[] = {
 			  "		[ rx-buf-len N]\n"
 			  "		[ cqe-size N]\n"
 			  "		[ tx-push on|off]\n"
+			  "		[ rx-push on|off]\n"
 	},
 	{
 		.opts	= "-k|--show-features|--show-offload",
netlink/desc-ethtool.c +1 -0
index d72974e..2d8aa39 100644
@@ -158,6 +158,7 @@ static const struct pretty_nla_desc __rings_desc[] = {
 	NLATTR_DESC_U8_ENUM(ETHTOOL_A_RINGS_TCP_DATA_SPLIT, rings_tcp_data_split),
 	NLATTR_DESC_U32(ETHTOOL_A_RINGS_CQE_SIZE),
 	NLATTR_DESC_BOOL(ETHTOOL_A_RINGS_TX_PUSH),
+	NLATTR_DESC_BOOL(ETHTOOL_A_RINGS_RX_PUSH),
 };
 
 static const struct pretty_nla_desc __channels_desc[] = {
netlink/rings.c +7 -0
index d51ef78..57bfb36 100644
@@ -57,6 +57,7 @@ int rings_reply_cb(const struct nlmsghdr *nlhdr, void *data)
 	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";
 	tcp_hds_key = "tcp-data-split";
@@ -154,6 +155,12 @@ static const struct param_parser sring_params[] = {
 		.handler        = nl_parse_u8bool,
 		.min_argc       = 1,
 	},
+	{
+		.arg            = "rx-push",
+		.type           = ETHTOOL_A_RINGS_RX_PUSH,
+		.handler        = nl_parse_u8bool,
+		.min_argc       = 1,
+	},
 	{}
 };
 
Signature · 1 line
2.31.1