RE: [PATCH v8 6/6] wifi: rtw88: sdio: add TX back-pressure and retry on page starvation
From: Ping-Ke Shih
Date: Fri Aug 28 2026 - 05:30:37 EST
luka.gejak@xxxxxxxxx <luka.gejak@xxxxxxxxx> wrote:
> From: Luka Gejak <luka.gejak@xxxxxxxxx>
>
> Two problems show up on RTL8723BS uplink. The per-AC software FIFO is
> unbounded, so mac80211 keeps handing frames down until latency collapses
> under load. And when a transfer cannot be completed the queue is simply
> abandoned for that pass, which stalls the AC until something else kicks
> the worker.
>
> Stop the mac80211 queue once a data AC fills past a high watermark and
> wake it from the drain path when it falls back to a low one. Both sides
> take the TX queue lock across the length check and the flag update, the
> way rtw_pci_tx_write() and rtw_pci_tx_isr() use irq_lock. Without it the
> producer could stop a queue on a length the drain path had already
> emptied, having seen the flag still clear and so skipped the wake, and
> the AC would have stayed stopped with nothing left to wake it.
>
> Convert the TX work item to a delayed work and re-arm it when a transfer
> fails for a reason that can clear on its own, so it is retried rather
> than the AC abandoned, and cancel the work on teardown.
>
> Retrying matters once the queue can be stopped. A stopped queue is
> handed no further frames, so nothing else would kick the worker, and the
> AC would stay stopped for good with the link still up and receive
> unaffected. The two retried cases, a transmit page or output queue
> shortage and a failed skb expansion, are also the two that fail
> silently; the rest are logged where they happen, so they are visible
> rather than an unexplained hang, and they keep the existing behaviour
> rather than being retried indefinitely.
>
> Measured on RTL8723BS hardware, uplink goes from 11.9 Mbit/s with 204
> TCP retransmits to 20.1 Mbit/s with 2.
>
> Signed-off-by: Luka Gejak <luka.gejak@xxxxxxxxx>
Acked-by: Ping-Ke Shih <pkshih@xxxxxxxxxxx>
The v8 is almost done. Only one small nit.
Since I don't test the RTL8723BS at all, please test it by yourself
carefully. At the last review (I think v9), I will focus on the changes
of this patchset doesn't affect existing chips.