]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: rtw88: Don't set SUPPORTS_AMSDU_IN_AMPDU for RTL8814AU
authorBitterblue Smith <rtl8821cerfe2@gmail.com>
Wed, 2 Apr 2025 15:31:36 +0000 (18:31 +0300)
committerPing-Ke Shih <pkshih@realtek.com>
Wed, 9 Apr 2025 02:02:14 +0000 (10:02 +0800)
RTL8814AU doesn't work well with SUPPORTS_AMSDU_IN_AMPDU. The RX speed
is noticeably lower and the VHT RX statistics are strange. Typical
values with SUPPORTS_AMSDU_IN_AMPDU:

Reverse mode, remote host 192.168.0.1 is sending
[  5] local 192.168.0.50 port 60710 connected to 192.168.0.1 port 5201
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec  74.6 MBytes   626 Mbits/sec
[  5]   1.00-2.00   sec  79.2 MBytes   665 Mbits/sec
[  5]   2.00-3.00   sec  84.9 MBytes   712 Mbits/sec
[  5]   3.00-4.00   sec  83.8 MBytes   703 Mbits/sec
[  5]   4.00-5.00   sec  85.9 MBytes   720 Mbits/sec
[  5]   5.00-6.00   sec  78.9 MBytes   662 Mbits/sec
[  5]   6.00-7.00   sec  81.2 MBytes   682 Mbits/sec
[  5]   7.00-8.00   sec  80.5 MBytes   675 Mbits/sec
[  5]   8.00-9.00   sec  79.4 MBytes   666 Mbits/sec
[  5]   9.00-10.00  sec  82.2 MBytes   689 Mbits/sec
[  5]  10.00-11.00  sec  82.0 MBytes   688 Mbits/sec
[  5]  11.00-12.00  sec  84.2 MBytes   707 Mbits/sec
[  5]  12.00-13.00  sec  71.0 MBytes   596 Mbits/sec
[  5]  13.00-14.00  sec  69.4 MBytes   582 Mbits/sec
[  5]  14.00-15.00  sec  80.2 MBytes   673 Mbits/sec
[  5]  15.00-16.00  sec  74.5 MBytes   625 Mbits/sec

[Rx Counter]:
 * CCA (CCK, OFDM, Total) = (0, 2455, 2455)
 * False Alarm (CCK, OFDM, Total) = (0, 69, 69)
 * CCK cnt (ok, err) = (0, 0)
 * OFDM cnt (ok, err) = (1239, 2)
 * HT cnt (ok, err) = (0, 0)
 * VHT cnt (ok, err) = (21, 12109)

The "VHT ok" number is not believable.

And without SUPPORTS_AMSDU_IN_AMPDU:

Reverse mode, remote host 192.168.0.1 is sending
[  5] local 192.168.0.50 port 50030 connected to 192.168.0.1 port 5201
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec  70.5 MBytes   591 Mbits/sec
[  5]   1.00-2.00   sec  86.9 MBytes   729 Mbits/sec
[  5]   2.00-3.00   sec  98.6 MBytes   827 Mbits/sec
[  5]   3.00-4.00   sec  97.4 MBytes   817 Mbits/sec
[  5]   4.00-5.00   sec  98.6 MBytes   827 Mbits/sec
[  5]   5.00-6.00   sec  96.9 MBytes   813 Mbits/sec
[  5]   6.00-7.00   sec  98.2 MBytes   824 Mbits/sec
[  5]   7.00-8.00   sec  98.0 MBytes   822 Mbits/sec
[  5]   8.00-9.00   sec  99.9 MBytes   838 Mbits/sec
[  5]   9.00-10.00  sec  99.2 MBytes   833 Mbits/sec
[  5]  10.00-11.00  sec  98.0 MBytes   822 Mbits/sec
[  5]  11.00-12.00  sec  98.1 MBytes   823 Mbits/sec
[  5]  12.00-13.00  sec  97.0 MBytes   814 Mbits/sec
[  5]  13.00-14.00  sec  98.2 MBytes   824 Mbits/sec
[  5]  14.00-15.00  sec  98.5 MBytes   826 Mbits/sec
[  5]  15.00-16.00  sec  97.4 MBytes   817 Mbits/sec

[Rx Counter]:
 * CCA (CCK, OFDM, Total) = (0, 3860, 3860)
 * False Alarm (CCK, OFDM, Total) = (0, 2, 2)
 * CCK cnt (ok, err) = (0, 0)
 * OFDM cnt (ok, err) = (1486, 0)
 * HT cnt (ok, err) = (0, 0)
 * VHT cnt (ok, err) = (7399, 9118)

Add a new member "amsdu_in_ampdu" in struct rtw_chip_info and use it
to set SUPPORTS_AMSDU_IN_AMPDU only for the other chips.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/6202ccfb-feb0-4107-a08d-db2699e179f0@gmail.com
drivers/net/wireless/realtek/rtw88/main.c
drivers/net/wireless/realtek/rtw88/main.h
drivers/net/wireless/realtek/rtw88/rtw8812a.c
drivers/net/wireless/realtek/rtw88/rtw8814a.c
drivers/net/wireless/realtek/rtw88/rtw8821a.c
drivers/net/wireless/realtek/rtw88/rtw8821c.c
drivers/net/wireless/realtek/rtw88/rtw8822b.c
drivers/net/wireless/realtek/rtw88/rtw8822c.c

index bc2c1a5a30b37908e95f9b5c561fa00d53a66412..c4de5d114eda1db785e0999d952510806da21604 100644 (file)
@@ -2242,7 +2242,8 @@ int rtw_register_hw(struct rtw_dev *rtwdev, struct ieee80211_hw *hw)
        ieee80211_hw_set(hw, SUPPORTS_PS);
        ieee80211_hw_set(hw, SUPPORTS_DYNAMIC_PS);
        ieee80211_hw_set(hw, SUPPORT_FAST_XMIT);
-       ieee80211_hw_set(hw, SUPPORTS_AMSDU_IN_AMPDU);
+       if (rtwdev->chip->amsdu_in_ampdu)
+               ieee80211_hw_set(hw, SUPPORTS_AMSDU_IN_AMPDU);
        ieee80211_hw_set(hw, HAS_RATE_CONTROL);
        ieee80211_hw_set(hw, TX_AMSDU);
        ieee80211_hw_set(hw, SINGLE_SCAN_ON_ALL_BANDS);
index f410c554da58a30ea84b755290a2d79ac05b4b01..b0f1fabe95545e3926a0c43e611c3502268cca12 100644 (file)
@@ -1230,6 +1230,7 @@ struct rtw_chip_info {
        u16 fw_fifo_addr[RTW_FW_FIFO_MAX];
        const struct rtw_fwcd_segs *fwcd_segs;
 
+       bool amsdu_in_ampdu;
        u8 usb_tx_agg_desc_num;
        bool hw_feature_report;
        u8 c2h_ra_report_size;
index adbfb37105d0516de71b19fc7b8c2aaae889d6c1..c2ef41767ff937be3fea90ae872922acd6be46a7 100644 (file)
@@ -1076,6 +1076,7 @@ const struct rtw_chip_info rtw8812a_hw_spec = {
        .rfe_defs = rtw8812a_rfe_defs,
        .rfe_defs_size = ARRAY_SIZE(rtw8812a_rfe_defs),
        .rx_ldpc = false,
+       .amsdu_in_ampdu = true,
        .hw_feature_report = false,
        .c2h_ra_report_size = 4,
        .old_datarate_fb_limit = true,
index ce8d4e4c6c57bc49d2b250a13b9a8e1b64f88cbc..44dd3090484b8a1b6070880115d0da7e34a42388 100644 (file)
@@ -2200,6 +2200,7 @@ const struct rtw_chip_info rtw8814a_hw_spec = {
        .rx_ldpc = true,
        .max_power_index = 0x3f,
        .ampdu_density = IEEE80211_HT_MPDU_DENSITY_2,
+       .amsdu_in_ampdu = false, /* RX speed is better without AMSDU */
        .usb_tx_agg_desc_num = 3,
        .hw_feature_report = false,
        .c2h_ra_report_size = 6,
index 4d81fb29c9fcd8cd85ee8c53486726ce522dbedf..413aec694c33a3e6522904a38a3f873e7c87f350 100644 (file)
@@ -1176,6 +1176,7 @@ const struct rtw_chip_info rtw8821a_hw_spec = {
        .rfe_defs = rtw8821a_rfe_defs,
        .rfe_defs_size = ARRAY_SIZE(rtw8821a_rfe_defs),
        .rx_ldpc = false,
+       .amsdu_in_ampdu = true,
        .hw_feature_report = false,
        .c2h_ra_report_size = 4,
        .old_datarate_fb_limit = true,
index f68b0041dcc06c77d559a64a5b2ed663dfa80a42..413130a30ca911fc7198e8a3f3dd084c1aed5403 100644 (file)
@@ -1991,6 +1991,7 @@ const struct rtw_chip_info rtw8821c_hw_spec = {
        .band = RTW_BAND_2G | RTW_BAND_5G,
        .page_size = TX_PAGE_SIZE,
        .dig_min = 0x1c,
+       .amsdu_in_ampdu = true,
        .usb_tx_agg_desc_num = 3,
        .hw_feature_report = true,
        .c2h_ra_report_size = 7,
index 0da212e27d55b3be03d162e8858c4751eacba8ce..ab199eaea3c7641a06331950ce8e7866d7f91829 100644 (file)
@@ -2532,6 +2532,7 @@ const struct rtw_chip_info rtw8822b_hw_spec = {
        .band = RTW_BAND_2G | RTW_BAND_5G,
        .page_size = TX_PAGE_SIZE,
        .dig_min = 0x1c,
+       .amsdu_in_ampdu = true,
        .usb_tx_agg_desc_num = 3,
        .hw_feature_report = true,
        .c2h_ra_report_size = 7,
index ca0cf26b905533c7c4c7e7697ffd375c6ca968ca..369ca75061b2b8f1d67b4a1ecfac444038354097 100644 (file)
@@ -5350,6 +5350,7 @@ const struct rtw_chip_info rtw8822c_hw_spec = {
        .band = RTW_BAND_2G | RTW_BAND_5G,
        .page_size = TX_PAGE_SIZE,
        .dig_min = 0x20,
+       .amsdu_in_ampdu = true,
        .usb_tx_agg_desc_num = 3,
        .hw_feature_report = true,
        .c2h_ra_report_size = 7,