mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mehmet Fide <mehmet.fide@gmail.com>
To: Luka Gejak <luka.gejak@linux.dev>
Cc: Ping-Ke Shih <pkshih@realtek.com>,
	linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
	mehmet.fide@screeningeagle.com
Subject: Re: [PATCH RFC rtw-next] wifi: rtw88: raise the TBTT hold time while beaconing
Date: Sat, 21 Nov 2026 20:46:28 +0100	[thread overview]
Message-ID: <20261121194628.604026-1-mehmet.fide@gmail.com> (raw)
In-Reply-To: <95610ac92e284b3b7b32981e14c380fcda09fcb7@linux.dev>

Hi Luka,

> Your captures fit a beacon transmit deadline. The RTL8822CU vendor
> header says data queues can also wait during the hold, so I'd measure
> latency around TBTT under load.

A station pinged the AP every 5 ms for 20 s, idle and with TCP in each
direction, 0x064 and 0x0ff taking turns, on an RTL8822BU on channels 36
and 6 and an RTL8822CE on channel 6. Each ping was placed in the beacon
interval from the sniffed beacons.

On channel 36 the idle median was 1.7 to 1.9 ms all through the first
10 ms after the TBTT, with both values. On channel 6, where the
neighbour's beacons pass our TBTT, the RTL8822BU pings of the first
8 ms after it had a median of 3.4 to 6.7 ms with 0x0ff and 2.5 to
4.5 ms with 0x064, and 2.3 to 3.4 ms with both from 15 ms on. So data
does wait there while the beacon waits for the medium. The RTL8822CE
showed no such difference. Under TCP load the median was 20 to 80 ms
from queueing, and neither the time after the TBTT nor the hold value
stood out.

> I'd start with 0x0ff and cap it for short beacon intervals. At 10 TU
> that leaves 2.08 ms before the next TBTT. I'd measure beacon loss and
> data latency before raising it on RTL8822CE.

v2 will use 0x0ff, capped at a quarter of the beacon interval but not
below 0x064, and write it again when the interval changes. I will leave
the RTL8822CE at that.

> I'd expect the old template if the MAC has already fetched it and
> still sends. Your v13 tests also saw missed beacons during a write.
>
> At 100 TU a late CSA worker can pass rtw_fw_csa_hold() at 6 ms after
> TBTT, inside the 8.16 ms window. Could the guard account for the hold
> and beacon airtime before a rewrite or switch completion? It currently
> skips intervals of 20 ms or less.

I have no measurement of which beacon goes out then.
rtw_fw_write_data_rsvd_page() clears BIT_EN_BCN_FUNCTION for the
download, so I would keep downloads out of that window. v14 of the CSA
series scales its margins with the interval and runs no step less than
5 ms after a TBTT. That covers 0x064 and a beacon of about 200 bytes at
1 Mb/s, not 0x0ff, so v2 of this patch will make the guard the hold
time plus the beacon airtime, and I will repeat the countdowns while
the neighbour's beacons pass our TBTT.

> To me it looks like a station scan on RTL8822C can pause AP beacons
> through rtw_hw_scan_chan_switch() and rtw_core_enable_beacon(), leaving
> 0xff programmed. The vendor driver restores 0x64 on scan pause. Could
> we update the hold on scan pause and resume too?

Yes. With this patch on an RTL8822CE and an RTL8822CU, a station scan
next to the AP cleared BIT_EN_BCN_FUNCTION off channel while the hold
stayed 0x0ff. v2 will also write the hold in rtw_core_enable_beacon():
0x064 when a scan pauses the beacons, the beaconing value when it
resumes them.

Mehmet

      reply	other threads:[~2026-11-21 19:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19 10:29 Mehmet Fide
2026-11-20 17:31 ` Luka Gejak
2026-11-21 19:46   ` Mehmet Fide [this message]

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=20261121194628.604026-1-mehmet.fide@gmail.com \
    --to=mehmet.fide@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luka.gejak@linux.dev \
    --cc=mehmet.fide@screeningeagle.com \
    --cc=pkshih@realtek.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®