mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "David Härdeman" <david@hardeman.nu>
To: Ping-Ke Shih <pkshih@realtek.com>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Leonard Lausen <leonard@lausen.nl>,
	Alastair D'Silva <alastair@d-silva.org>,
	Luka Gejak <luka.gejak@linux.dev>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Bitterblue Smith <rtl8821cerfe2@gmail.com>
Subject: Re: [PATCH rtw-next 0/5] wifi: rtw88: sdio: faster and fairer TX for the 88xx chips
Date: Tue, 17 Nov 2026 15:44:41 +0100	[thread overview]
Message-ID: <avxoWTaI2G8aklLk@hardeman.nu> (raw)
In-Reply-To: <4c0d81f7a207468d8bca3c3c1a5b8dc5@realtek.com>

On Tue, Nov 17, 2026 at 07:46:44AM +0000, Ping-Ke Shih wrote:
>David Härdeman <david@hardeman.nu> wrote:
>> Known issue, not addressed here: when the client goes off-channel (for
>> example for a background scan), the chip sometimes gives up on an MPDU
>> of an A-MPDU session without sending a BAR, and keeps sending up to 64
>> frames past it. 
>
>What do you expect? 
>
>     rtw88                client
>     TX A-MPDU   -->
>     TX BAR      -->
>                 <--      BA
>
>I have not seen BAR for a long time. Do you really need it?

First, I'm not a WiFi expert, so please excuse me if my
understanding/explanation is wrong, weird, or both...

That said, I should have explained this better. What I see is:

1. The client (iwlwifi) goes off-channel for a scan, about 120 ms at a
   time. Here these were the background scans that NetworkManager sets
   up in wpa_supplicant to find roaming candidates, which run every 30 s
   while the signal is below a threshold.

2. The chip keeps retrying the frames it already has, gives up on one of
   them (SN n) when the retry limit is reached, and later continues with
   n+1 and onwards. SN n is never sent again.

3. The client's reorder buffer now has a hole at n. It holds n+1 and the
   following frames until its reorder timeout fires, or until a frame at
   n+64 or beyond pushes the window past the hole.

A BAR with starting sequence number n+1 after step 2 would tell the
client that n won't come, so that it can release the frames it holds
right away. That's the use I mean, not asking for a BA.

>> rtw88 reports every SDIO data frame as acked, so
>> mac80211 doesn't know either and can't send a BAR. 
>
>Can you check air sniffer if the A-MPDU is actually acked, or firmware
>report incorrect ack?

I did use a second AP as a sniffer, but it was too far from the R76S to
decode its VHT data frames. It did see the client's BAs, and no BAR from
the AP. I can repeat the capture closer to the AP if you think it would
help (I would have to wait until a time when I'm not interrupting the
kids' gaming though).

What I have seen:

- On the client, a trace of every MPDU its firmware passed up showed
  that SN n never arrived (within +-500 ms, on any RX queue), while n+1
  and onwards arrived as retries once the client was back.

- On the AP, a debug build of the driver that polls the firmware's
  per-MACID TX statistics every 2 s (H2C 0x43, C2H AP_REQ_TXRPT)
  saw failed frames only while the client was scanning (13 in four
  2-minute runs, all during scans).

So I don't think the firmware considers these frames acked: it knows
that it dropped them, but rtw88 doesn't learn which ones. The "acked" I
wrote about is what rtw88 tells mac80211 for every SDIO data frame.

>I think mac80211 has no way to send a BAR. How can it do? Driver
>tells mac80211 once it TX a set of frames?

From what I understand, mac80211 can, but only if the driver tells it
which frame was dropped: the driver reports that frame as not acked,
with IEEE80211_TX_STAT_AMPDU_NO_BACK set, and mac80211 then sends a BAR
with SSN = SN + 1 (see net/mac80211/status.c). iwlwifi's mvm does this
when a single frame of an A-MPDU fails.

rtw88 can't do that today, because it doesn't learn which frame the chip
dropped: for SDIO it reports every data frame as acked once it has been
handed to the chip. That's why I asked if the firmware can report the
dropped frames (or send the BAR itself).

>> The client's
>> reorder window then stalls until it is pushed past the hole, which
>> costs a short throughput dip. 
>
>Are there some frames get missed but hardware somehow considers it
>has acked them already? (I think need to check air sniffer)

See above: as far as I can tell, the frame is missed, and the firmware
counts it as failed (so it must be aware).

>> With iwlwifi clients it turned into
>> bursts of up to 63 lost frames per hole because of a reorder buffer
>> bug there, for which I have sent fixes:
>> https://lore.kernel.org/linux-wireless/20261116155609.535595-1-david@hardeman.nu/
>> I tried the hardware BAR settings (REG_BAR_MODE_CTRL thresholds, the
>> BAR retry bits in the TX descriptor), a longer retry limit, MACID sleep
>> for dozing clients, per-frame TX reports and a BAR sent by the driver
>> after the client wakes up; none of them helped, and per-frame reports
>> only came back for about one frame per A-MPDU. Ping-Ke, is there a way
>> for the firmware to report which MPDU it dropped, 
>
>I think hardware's retry buffer will do it properly. If a frame exceeds
>retry limit, TX report tells driver a frame is dropped. But this is only
>for specific frames with SN (see rtw_tx_report_enqueue()). 

I tried requesting that report for every QoS data frame: only about 7 %
of the requests were answered, roughly one per A-MPDU, and download
throughput dropped by about a third (~210 to ~140 Mbit/s). So per-frame
reports don't seem usable for this. A report that only covers the
dropped frames, with their SN, would be enough.

>> or to send the BAR
>> itself?
>
>As I know BAR is to ask peer to send BA, what does your expectation if
>you can send BAR?

As above, a BAR with SSN = n+1 moves the client's window past the
dropped frame. REG_BAR_MODE_CTRL suggests that the MAC can send BARs by
itself (BAR_EN is set on my chip), but lowering its thresholds made no
difference to the losses.

As for whether it's needed: with the iwlwifi fix, the remaining cost is
a throughput dip while the client scans, because it waits for the
timeout or for the window to be pushed past the hole. So it isn't
urgent, and this series doesn't try to fix it. I mentioned it as a
known issue in case there is a firmware feature for it.

-- 
David Härdeman

  reply	other threads:[~2026-11-17 14:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 19:01 David Härdeman
2026-11-16 19:01 ` [PATCH rtw-next 1/5] wifi: rtw88: sdio: cache the free TX page counts of " David Härdeman
2026-11-17  7:20   ` Luka Gejak
2026-11-17 12:50     ` David Härdeman
2026-11-16 19:01 ` [PATCH rtw-next 2/5] wifi: rtw88: sdio: aggregate TX frames " David Härdeman
2026-11-16 19:01 ` [PATCH rtw-next 3/5] wifi: rtw88: sdio: limit the TX queue length " David Härdeman
2026-11-17  7:21   ` Luka Gejak
2026-11-17 12:57     ` David Härdeman
2026-11-16 19:01 ` [PATCH rtw-next 4/5] wifi: rtw88: sdio: let TX in while receiving on " David Härdeman
2026-11-16 19:01 ` [PATCH rtw-next 5/5] wifi: rtw88: sdio: read neighbouring registers of the 88xx chips at once David Härdeman
2026-11-16 21:59 ` [PATCH rtw-next 0/5] wifi: rtw88: sdio: faster and fairer TX for the 88xx chips Luka Gejak
2026-11-17  7:46 ` Ping-Ke Shih
2026-11-17 14:44   ` David Härdeman [this message]
2026-11-17 15:27     ` Luka Gejak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=avxoWTaI2G8aklLk@hardeman.nu \
    --to=david@hardeman.nu \
    --cc=alastair@d-silva.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=leonard@lausen.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luka.gejak@linux.dev \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=pkshih@realtek.com \
    --cc=rtl8821cerfe2@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®