Repository navigation
Conversation
IRtlRadio::GetTxQueuePages(free, total) reads REG_FIFOPAGE_INFO_5 (PUB: bits 27:16 free, 11:0 configured) in one control read under _reg_mu. Frames the MAC holds back fill the PUB queue long before a bulk-OUT send blocks, so the free count shows a TX stall that send timing alone misses. Callable from any thread while a sender is blocked in bulk-OUT; throws on a failed USB transfer. Default: false (unsupported, outputs untouched). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PR Summary by QodoExpose Jaguar3 PUB TX queue page counts
AI Description
Merge Risk
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can copy the agent prompt from any finding and feed it to your IDE agent |
josephnef
left a comment
There was a problem hiding this comment.
The reading does what the PR says. I reproduced it on a second 8812EU (bare BL-M8812EU2, 0bda:a81a), channel 157(+) at 40 MHz, MCS2/40/LDPC, 1400-byte frames, with this PR merged together with #609 (clean merge, full build, ctest 96/96 with the two MT7612U generator checks skipped).
Reproduced
- Idle: 1745 / 1745.
- Polling at 10 Hz from a second thread during a no-gap flood costs nothing: 2739–2788 frames/s with the poller, 2742–2783 without.
- At ~795 frames/s offered and IGI 0x1e, every frame was sent and no send took over 2 ms, yet free pages dipped to 449–1305 and the queue was empty in only 16–25 of 40 samples. At IGI 0x20 and above it read 1745 in all 40. So the page count shows the stalled state where send timing does not.
Requested before merge
- Refuse before bring-up (inline).
- An in-tree caller. Nothing in the repo calls this, so the table above and the one in the description cannot be reproduced from the tree.
tests/cca_gates_probe.cppwas added for the same reason for the gate split; one small probe could cover this andSetWideTxIgiFloortogether.
Also
- Fork CI has not run on this PR; it needs a green run.
Limits of my check: one unit, one channel, one run per arm, TX power at −20 dB (this module's bench supply sags at full power under a no-gap flood, on master too), and host-side submitted rates rather than frames counted by a witness receiver.
| const uint32_t v = _device.rtw_read<uint32_t>(0x0240); | ||
| total_pages = v & 0x0fff; | ||
| free_pages = (v >> 16) & 0x0fff; | ||
| return true; |
There was a problem hiding this comment.
Before bring-up this returns true with garbage. Called between CreateRadio and InitWrite on an 8812EU it reported free=2794 total=2794, which is 0xaea from the unpowered chip's 0xeaeaeaea read pattern. A caller computing backlog from that sees a plausible, fully-free queue.
SetCcaGates / GetCcaGates already refuse in this state with if (!_brought_up) return false; under _reg_mu. The same check here, leaving the outputs untouched, would match the "returns false … outputs are untouched" contract in the header.
| * (REG_FIFOPAGE_INFO_5: bits 27:16 free, 11:0 configured). One control | ||
| * read. A stalled TX path shows as free_pages stuck well below total_pages | ||
| * while bulk-OUT sends still return. Callable from any thread at the | ||
| * caller's own cadence (never per frame), including while a sender is |
There was a problem hiding this comment.
Non-blocking: worth one sentence that the reading only discriminates below the TX ceiling. Under a no-gap flood on a healthy link (2745–2780 frames/s, no failed sends) it read ~17 free of 1745 for the whole run, because the sender is what keeps the queue full. "Stuck well below total_pages" is the stalled state only when the offered load is under what the air can carry.
Also non-blocking: once the pre-bring-up refusal is in, "returns false where unsupported" should mention it too.
The gap
When a Jaguar3 transmitter holds 40 MHz frames (low IGI on a quiet channel,
docs/experiments/8822c-ht40-tx-stall.md), the frames back up inside the chip. A bulk-OUT send blocks only once the chip's queue is full, so a caller that watches send timing sees the stall late or never. The PUB queue's free-page count does show it, but today onlyDumpChipStatereads it, as a log line.The change
IRtlRadio::GetTxQueuePages(uint16_t& free_pages, uint16_t& total_pages)(Jaguar3) readsREG_FIFOPAGE_INFO_5(0x0240; free pages in bits 27:16, configured pages in 11:0), the same fieldDumpChipStateprints._reg_mu. Callable from any thread at a supervisory cadence (never per frame), including while a sender is blocked in bulk-OUT, since EP0 is separate from the bulk pipe.Measured
One 8812EU, MCS2/40, 1400-byte frames at a fixed offered load, silent 144(-) with no other traffic, IGI pinned, 10 s per cell, sampled every 200 ms. "Empty" means free pages at the idle value 1745.
At 790 frames/s and 0x1e, one run had no blocked send at all, yet it sent 98 %, its worst 200 ms carried 68 % of the offered load, and the queue was empty in only 14 % of samples. The free count separates the stalled state where send timing does not.
The same reading drove a run-time floor controller (with
SetWideTxIgiFloor, #609). Once per second it took the deepest backlog: healthy seconds reached 40 % backlog in 1 % of seconds, seconds at IGI 0x1e in 90 %.Build: full, no-Jaguar3 and Jaguar3-only configure + build;
ctest91/91 (82/82 Jaguar3-only). No selftest: the method is one register read and a field split.Not covered
🤖 Generated with Claude Code