Re: [RFC PATCH v1 00/19] rtw88: Add SDIO support

Ping-Ke Shih
2022-12-30T00:07:07Z

On Fri, 2022-12-30 at 00:18 +0100, Martin Blumenstingl wrote:
> Hi Ping-Ke,
>
> thanks again for all your input!
>
> On Thu, Dec 29, 2022 at 5:19 AM Ping-Ke Shih <pkshih@realtek.com> wrote:
> [...]
> > > - RX throughput on a 5GHz network is at 19 Mbit/s
> >
> > I have a suggestion about RX throughput, please check below registers with
> > vendor driver:
> >
> > REG_RXDMA_AGG_PG_TH
> > REG_TXDMA_PQ_MAP(0x10c) BIT_RXDMA_AGG_EN (bit2)
> > REG_RXDMA_MODE(0290) BIT_DMA_MODE (bit1)
> Unfortunately I didn't manage to get the vendor driver to work with
> mainline Linux.
> The Android installation on my board (which is how it was shipped)
> uses the vendor driver but unlike some Amlogic code the Realtek
> (vendor) wireless driver does not allow reading arbitrary registers
> through sysfs.
> So I can't check the values that the vendor driver uses.
>
> > Try to adjust AGG_PG_TH to see if it can help.
> I tried a few values and I can say that it does change the RX
> throughput, but the result is always lower than 19 Mbit/s, meaning
> that it's worse than RX aggregation disabled (on my RTL8822CS).
> Currently we're disabling RX aggregation in the driver. But Jernej
> mentioned previously that for his RTL8822BS he found that RX
> aggregation seems to improve performance.
>
> Independent of this I did some investigation on my own and found that
> when reducing the TX throughput the RX throughput increases.
> For this I tried using ieee80211_{stop,wake}_queue() in the sdio.c HCI
> sub-driver.
> RX throughput is now at 23.5 Mbit/s (that +25% compared to before) on
> my RTL8822CS (with RX aggregation still disabled, just like in the 19
> Mbit/s test).
> Unfortunately TX throughput is now way below 10 Mbit/s.
>
> Additionally I think that the antenna of my board is worse than my
> access point's antenna. So TX from rtw88 to my AP may be faster
> (because the AP can "hear better") than RX (rtw88 "hearing is worse").
>

Without equipment like CAT-C, it is hard to investigate SDIO usb
aggregation, so I suggest to capture WiFi packets in the air to make
sure things work as expected. After that, we can focus on bus
aggregation tuning.

The instructions to use another WiFi card to capture packets are:
1. sudo iw dev wlan0 interface add mon0 type monitor
2. sudo wireshark // select mon0 to capture

Please check AMPDU and AMSDU size during doing TX/RX throughput test.
Normally, expected AMSDU size is 3000+ bytes, and AMPDU number is
around 32 MSDUs. If RX is too slow resulting in buffer overflow,
AP could resend (check sequence number and 'R' bit, or BA of 8822CS).

Also, check TX/RX rates to know if RF calibration and PHY dynamic
mechanism work well. Normally, with 50cm distance long from AP,
it must yield the highest rate, no doubt.

I hope this can narrow down the problems you met.

---
Ping-Ke