Skip to content

jaguar2: AC lifetime and BE fast retry on the RTL8822B (stacked on #600) - #601

Draft
snokvist wants to merge 3 commits into
OpenIPC:masterfrom
snokvist:upstream/88xx-ac-queue
Draft

snokvist wants to merge 3 commits into
OpenIPC:masterfrom
snokvist:upstream/88xx-ac-queue

Conversation

@snokvist

Copy link
Copy Markdown
Collaborator

Draft, stacked on #600. This branch carries #600's two commits; the new work is the last commit, 06fcade (Jaguar2). It will be rebased after #600 merges.

What

All knobs default off. With them off, descriptors, endpoints and registers are unchanged.

Scope: only what we could verify

  • Applied on the RTL8822B with three bulk-OUT endpoints.
  • The 8821C shares the Jaguar2 code but was not measured, so it logs that the knobs are not applied.

Evidence

One RTL8812BU sends to an MT7612U on channel 100, near field. Every arm ran on this branch. "Stock" is master df65991.

Peer hears but never ACKs (500 fps of 1400 B at MCS4, retry 16, 10 s):

Build Delivered age max Frames delivered
Stock 1.18 s 1,395
This branch, knobs off 1.19 s 1,393
All three on, ac_lifetime_us=68000 68.8 ms 5,003
All three on, ac_lifetime_us=20000 20.8 ms 5,001

Saturated MCS2, 7 s, interleaved, steady state:

Build Mbit/s
Stock 14.2 / 14.1
Knobs off 14.1 / 14.2
Knobs on 13.0 / 13.0 (age max 70 ms against 124 ms stock)

Counterpart: with the knobs on, saturated throughput is about 8 % lower. The lifetime drops frames that queue past it, which is the point of the bound.

ctest: 94/94.

Not in this PR (for the maintainer)

  • RTL8822E (Jaguar3): the same apply call, prepared but held until it is measured on an 8812EU. Jaguar3 already puts DATA on BE whenever it has three endpoints (TxQueueMap.h), so only the lifetime and fast retry would apply.
  • RTL8822C (8812CU) and the RTL8733B (8733BU): the same halmac registers. A downstream fork applies the knobs there and measured them on an earlier master, but no unit was available to re-measure on this one, so they are left out.
  • 8821C: unmeasured, so the knobs are not applied (see Scope).
  • Fast retry gives up exponential backoff on BE, as MGMT already has, so BE contends harder than stock against other stations' traffic. That is why it is opt-in and separate from the lifetime.

🤖 Generated with Claude Code

…ifetime_us)

Two opt-in TX knobs, both off by default:

- tx.data_on_be: DATA frames use the BE queue (QSEL 0) and its LOW bulk-OUT
  endpoint instead of MGMT (0x12, HIGH). A USB-aggregated URB never mixes
  DATA with other frames.
- tx.ac_lifetime_us: the MAC drops a frame still queued after this long,
  retry chain included (REG_LIFETIME_EN 0x0426 bits 0..3,
  REG_PKT_LIFE_TIME 0x04C0, 256 us units).

Without them an injected frame on MGMT retries until the retry limit no
matter how old it is, so a peer that stops ACKing leaves seconds of stale
frames queued.

Scope: Jaguar1 on the RTL8812A with three bulk-OUT endpoints, the only
part measured. The 8814A, 8821A and two-endpoint parts log that the knobs
are not applied. src/AcTxQueue.h holds the register arithmetic, pinned by
tests/ac_tx_queue_selftest.cpp.

Measured, one 8812AU -> MT7612U, ch 100, near field, 500 fps of 1400 B at
MCS4, retry 16, a peer that never ACKs: delivered age max 3.3 s stock,
68.8 ms at 68000 us, 21.0 ms at 20000 us (so the unit is 256 us; the vendor
header names 128). Saturated MCS2, interleaved: stock 9.5 / 10.6 / 10.9
Mbit/s, knobs off 10.1 / 10.7, knobs on 11.6 / 11.8.
build_tx_block set BMC to a constant 1. The firmware echoes the bit into
the CCX TX report (TxReport::bmc), so every unicast frame's report read as
a group frame and a reader filtering group reports saw none.

On the RTL8812A, BMC now follows addr1's group bit. The MAC takes its ACK
decision from addr1 either way: delivery and retries were unchanged, and
unicast reports appeared (0 -> about 7,000 per 7 s saturated run). The
8814A and 8821A keep the constant 1: they share this code but were not
measured.

This changes behaviour with no knob set, for RTL8812A users of TX reports.
Extends the RTL8812A AC lifetime (previous commit) to the RTL8822B and adds
tx.be_fast_retry.

- tx.data_on_be: DATA on BE (QSEL 0) and the LOW bulk-OUT endpoint; the
  endpoint follows the descriptor QSEL through the 3-endpoint TXDMA_PQ_MAP
  (BE/BK -> LOW, VI/VO -> NORMAL, the rest -> HIGH). A USB-aggregated URB
  never mixes DATA with other frames.
- tx.ac_lifetime_us: the same halmac lifetime registers.
- tx.be_fast_retry (new): clears the BE EDCA TXOP and pulls CWmax down to
  CWmin (REG_EDCA_BE_PARAM 0x0508), so a BE retry chain re-airs back to
  back as MGMT's does instead of doubling the window to 1023 slots. Jaguar1
  logs that it ignores it: on the RTL8812A it cut saturated throughput.

Scope: the 8822B with three bulk-OUT endpoints. The 8821C shares the code,
was not measured, and logs that the knobs are not applied.

Measured, one RTL8812BU -> MT7612U, ch 100, near field, 500 fps of 1400 B
at MCS4, retry 16, a peer that never ACKs: delivered age max 1.18 s stock
master and with the knobs off, 68.8 ms at 68000 us and 20.8 ms at 20000 us
with all three on. Saturated MCS2 steady state 14.1-14.2 Mbit/s stock and
knobs off, 13.0 with the knobs on.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant