Skip to contentSkip to conversation

wifi: rtw89: usb: Rx aggregation for RTL8832CU/RTL8851BU

PATCH In review Ping-Ke Shih 1 participant 2 messages Mar 12 – Mar 19 Realtek wireless driver (rtw89)

lore
Share & tools
lore

Ping-Ke Shih

author maintainer
#0 lore raw

PATCH v2 1/1 wifi: rtw89: usb: Rx aggregation for RTL8832CU/RTL8851BU

From: Shin-Yi Lin <[email protected]>

USB RX Aggregation is a performance optimization technique used in USB network devices to increase throughput.

Instead of sending every received network packet to the host computer individually, the device hardware groups multiple smaller packets into a single, large USB Bulk Transfer.

* toAP/toNB use iperf3 respectively.

With Cisco BE6000 - iperf3 tcp 10 pair (to another NB)

[6G 160Mhz]:

RTL8832CU-USB3.0

       before   after
 TX    941      941
 RX    847      919

RTL8832CU-USB2.0

       before   after
 TX    293      286
 RX    342      356

[5G 80Mhz]:

RTL8832CU-USB3.0

       before   after
 TX    864      877
 RX    864      902

RTL8832CU-USB2.0

       before   after
 TX    279      271
 RX    327      349

RTL8851BU

       before   after
 TX    115      114
 RX    295      306

---
v2: address Bitterblue's comments
- correct throughput value in commit message
- add rtw89_ prefix to missed functions
- add unit '1K' in macro naming

Note:
This one is to add USB RX aggregation to improve performance. The other one is TX aggregation, which we are working on.

---
 .../net/wireless/realtek/rtw89/rtw8851bu.c    |  1 +
 .../net/wireless/realtek/rtw89/rtw8852au.c    |  1 +
 .../net/wireless/realtek/rtw89/rtw8852bu.c    |  1 +
 .../net/wireless/realtek/rtw89/rtw8852cu.c    |  1 +
 drivers/net/wireless/realtek/rtw89/usb.c      | 84 ++++++++++++++++---
 drivers/net/wireless/realtek/rtw89/usb.h      | 12 +++
 6 files changed, 87 insertions(+), 13 deletions(-)
drivers/net/wireless/realtek/rtw89/rtw8851bu.c +1 -0
index 959d62aefdd8..6a8d31544314 100644
@@ -15,6 +15,7 @@ static const struct rtw89_usb_info rtw8851b_usb_info = {
 	.usb3_mac_npi_config_intf_0	= R_AX_USB3_MAC_NPI_CONFIG_INTF_0,
 	.usb_endpoint_0			= R_AX_USB_ENDPOINT_0,
 	.usb_endpoint_2			= R_AX_USB_ENDPOINT_2,
+	.rx_agg_alignment		= 8,
 	.bulkout_id = {
 		[RTW89_DMA_ACH0] = 3,
 		[RTW89_DMA_ACH1] = 4,
drivers/net/wireless/realtek/rtw89/rtw8852au.c +1 -0
index ccdbcc178c2a..4cced4619b7d 100644
@@ -15,6 +15,7 @@ static const struct rtw89_usb_info rtw8852a_usb_info = {
 	.usb3_mac_npi_config_intf_0	= R_AX_USB3_MAC_NPI_CONFIG_INTF_0,
 	.usb_endpoint_0			= R_AX_USB_ENDPOINT_0,
 	.usb_endpoint_2			= R_AX_USB_ENDPOINT_2,
+	.rx_agg_alignment		= 8,
 	.bulkout_id = {
 		[RTW89_DMA_ACH0] = 3,
 		[RTW89_DMA_ACH2] = 5,
drivers/net/wireless/realtek/rtw89/rtw8852bu.c +1 -0
index 84cd3ec971f9..37111fed276f 100644
@@ -15,6 +15,7 @@ static const struct rtw89_usb_info rtw8852b_usb_info = {
 	.usb3_mac_npi_config_intf_0	= R_AX_USB3_MAC_NPI_CONFIG_INTF_0,
 	.usb_endpoint_0			= R_AX_USB_ENDPOINT_0,
 	.usb_endpoint_2			= R_AX_USB_ENDPOINT_2,
+	.rx_agg_alignment		= 8,
 	.bulkout_id = {
 		[RTW89_DMA_ACH0] = 3,
 		[RTW89_DMA_ACH1] = 4,
drivers/net/wireless/realtek/rtw89/rtw8852cu.c +1 -0
index 3b9825c92a0d..0c5aebaed873 100644
@@ -15,6 +15,7 @@ static const struct rtw89_usb_info rtw8852c_usb_info = {
 	.usb3_mac_npi_config_intf_0	= R_AX_USB3_MAC_NPI_CONFIG_INTF_0_V1,
 	.usb_endpoint_0			= R_AX_USB_ENDPOINT_0_V1,
 	.usb_endpoint_2			= R_AX_USB_ENDPOINT_2_V1,
+	.rx_agg_alignment		= 8,
 	.bulkout_id = {
 		[RTW89_DMA_ACH0] = 3,
 		[RTW89_DMA_ACH2] = 5,
drivers/net/wireless/realtek/rtw89/usb.c +71 -13

117 lines not on this page · raw message

drivers/net/wireless/realtek/rtw89/usb.h +12 -0
index 203ec8e993e9..3d17e514e346 100644
@@ -20,6 +20,17 @@
 #define RTW89_MAX_ENDPOINT_NUM		9
 #define RTW89_MAX_BULKOUT_NUM		7
 
+#define R_AX_RXAGG_0_V1			0x6000
+#define B_AX_RXAGG_0_EN			BIT(31)
+#define B_AX_RXAGG_0_NUM_TH		GENMASK(23, 16)
+#define B_AX_RXAGG_0_TIME_32US_TH	GENMASK(15, 8)
+#define B_AX_RXAGG_0_BUF_SZ_1K		GENMASK(7, 0)
+
+#define R_AX_RXAGG_1_V1			0x6004
+
+#define R_AX_RXAGG_0			0x8900
+#define B_AX_RXAGG_0_BUF_SZ_4K		GENMASK(7, 0)
+
 struct rtw89_usb_info {
 	u32 usb_host_request_2;
 	u32 usb_wlan0_1;
@@ -27,6 +38,7 @@ struct rtw89_usb_info {
 	u32 usb3_mac_npi_config_intf_0;
 	u32 usb_endpoint_0;
 	u32 usb_endpoint_2;
+	u8 rx_agg_alignment;
 	u8 bulkout_id[RTW89_DMA_CH_NUM];
 };
 

base-commit: 039cd522dc70151da13329a5e3ae19b1736f468a

Signature · 1 line
2.25.1
author maintainer
#1 lore raw
Quoted 37 lines · Ping-Ke Shih

From: Shin-Yi Lin <[email protected]>

USB RX Aggregation is a performance optimization technique used in USB network devices to increase throughput.

Instead of sending every received network packet to the host computer individually, the device hardware groups multiple smaller packets into a single, large USB Bulk Transfer.

* toAP/toNB use iperf3 respectively.

With Cisco BE6000 - iperf3 tcp 10 pair (to another NB)

[6G 160Mhz]:

RTL8832CU-USB3.0

       before   after
 TX    941      941
 RX    847      919

RTL8832CU-USB2.0

       before   after
 TX    293      286
 RX    342      356

[5G 80Mhz]:

RTL8832CU-USB3.0

       before   after
 TX    864      877
 RX    864      902

RTL8832CU-USB2.0

       before   after
 TX    279      271
 RX    327      349
Quoted 7 lines

RTL8851BU

       before   after
 TX    115      114
 RX    295      306

1 patch(es) applied to rtw-next branch of rtw.git, thanks.

eef6d4449e8a wifi: rtw89: usb: Rx aggregation for RTL8832CU/RTL8851BU

---
https://github.com/pkshih/rtw.git