Repository navigation
Conversation
…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.
PR Summary by QodoBound RTL8812A DATA queue age and correct unicast TX reports
AI Description
Merge Risk
|
Code Review by Qodo
1. Doc omits the lifetime's drop cost
|
What
1.
tx.data_on_beandtx.ac_lifetime_us, RTL8812A only. Both are opt-in and off by default.tx.data_on_be: DATA frames go to the BE queue (QSEL 0) and its LOW bulk-OUT endpoint instead of MGMT.tx.ac_lifetime_us: the MAC drops a frame that is still queued after this long, mid retry chain included.The problem it solves: an injected frame on MGMT retries until the retry limit however old it is. A peer that stops ACKing therefore leaves seconds of stale frames in the queue.
src/AcTxQueue.hholds the register arithmetic, pinned by a new headless selftest. The environment variables areDEVOURER_TX_DATA_BEandDEVOURER_TX_AC_LIFETIME_US.2. The TX descriptor's BMC bit follows addr1 on the RTL8812A. It was a constant 1. The firmware echoes it into the CCX TX report, so every unicast report read as a group frame.
This is the one change that applies with no knob set. It is its own commit, so it can be taken or left separately.
Scope: only what we could verify
The code applies on the RTL8812A with three bulk-OUT endpoints, the one part we measured.
Evidence
One RTL8812AU sends to an MT7612U on channel 100, near field. Every arm below ran on this branch, built on current master. "Stock" is master
df65991.Peer hears but never ACKs (500 fps of 1400 B at MCS4, retry 16, 10 s):
ac_lifetime_us=68000ac_lifetime_us=20000Saturated MCS2, 7 s, interleaved (spread between runs is about 2 Mbit/s):
Knobs off: host RX frame counts match stock (231/223/199 against 235/220). The only difference is the BMC fix: unicast CCX reports go from 0 to about 7,000 per run.
Also:
For the maintainer: what we found but did not put in code (unverified, or other hardware)
hal_com_reg.hgivesHAL92C_MSDU_LIFE_TIME_UNIT 128, but 20,000 µs gave 21.0 ms and 68,000 µs gave 68.8 ms. 128 would halve both.REG_EDCA_BE_PARAM0x005EA42B → 0x0000442B. On the 8812A it cut saturated MCS2 to 3.5–10.1 Mbit/s, against 11.3–13.6 without it. The lifetime alone holds the bound: 68.7 ms with it, 68.9 ms without.two_out_pipeand_InitNormalChipTwoOutEpPriorityput BE/BK on the second pipe. Wideningdata_on_bethere needs that endpoint map; we have no such part.rx.own_addr_onlyon Jaguar1 and RCR_ADF: our fork also clears RCR_ADF underown_addr_only. Master's rx filters: Jaguar1 port, identity refusal, caps flag (#597) #599 leaves it set. Our test could not isolate whether ADF matters, so it is not in this PR. A three-station test (a unicast link on the same channel, a listener on another address) would settle it.rx.drop_ctrlon Jaguar1: the vendor header puts BlockAck/BAR/PS-Poll under ADF. This matches rx filters: Jaguar1 port, identity refusal, caps flag (#597) #599's note that BlockAcks still arrive._InitNormalChipThreeOutEpPriority_8812AUsbmaps them. We exercised only BE (DATA) and MGMT on air.std::min<unsigned long long>. Astd::min<long>(v, UINT_MAX)form would givemin(v, -1)wherelongis 32 bits (ARM32), turning any value into the 16.8 s maximum. Arithmetic only; not run on an ARM32 board.🤖 Generated with Claude Code