Repository navigation
jaguar3: GetTxQueuePages, the PUB TX queue's free and configured pages - #610
Conversation
DeviceConfig::Tuning::wide_tx_igi_floor is fixed at construction. The edge below which a Jaguar3 transmitter loses 40 MHz capacity differs per unit and per channel, and the 0x35 default costs uplink sensitivity, so a caller that wants the lowest safe floor has to move it while the radio runs. IRtlRadio::SetWideTxIgiFloor(floor) records the new floor and re-applies it under _reg_mu, under the same rule as the construction-time value (after the session's first >= 40 MHz frame, while tuned that wide; every retune re-applies it). It is callable while another thread is blocked in bulk-OUT, and it can throw on a failed USB transfer; the floor is recorded first, so the DIG tick enforces it either way. Default: false (unsupported). PhydmRuntimeJaguar3::set_igi_floor now clamps IGI at once whenever the floor is lowered, not only when it is dropped to 0: a lowered non-zero floor pulls IGI down to max(floor, top of the channel's DIG window). The rule is a pure function (jaguar3/IgiFloor.h) with an igi_floor selftest. The TX arm in build_tx_block now runs on the first wide frame even when the floor is 0, so a floor set later still applies; with a floor of 0 the apply writes no register, and it takes _reg_mu once per session as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
tests/igi_floor_probe.cpp (IgiFloorProbe) is the in-tree caller for IRtlRadio::SetWideTxIgiFloor: it floods a 40 MHz tune, walks the floor through a list and prints the rate, failed sends, longest send and IGI per step; --rx-ta counts a second card's frames and their RSSI per step, for the receiver-cost table. The per-channel edge and the receiver cost measured on one 8812EU now live in docs/experiments/8822c-ht40-tx-stall.md and the DeviceConfig::Tuning::wide_tx_igi_floor comment, with their scope, in place of the "per unit" / "estimated, not measured" text. PhydmRuntimeJaguar3::set_igi_floor reads IGI before it records the new floor: a throw on that read now changes nothing, so a retry of the same lowered floor still clamps (before, it saw prev == floor and skipped the clamp, which stuck under skip_dig). The SetWideTxIgiFloor comment now says only the read throws (BB writes drop their result), that a floor at or below the DIG window bottom acts like no floor, and that the live value outlives Stop / Init / InitWrite. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ds it Before bring-up the PUB page read is the unpowered chip's 0xeaeaeaea pattern, which decodes as a full, all-free queue (2794 / 2794). It now returns false with the outputs untouched, under _reg_mu, as GetCcaGates does. The header says the reading discriminates only below the TX ceiling: under a no-gap flood the sender keeps the queue full on a healthy link. tests/igi_floor_probe.cpp samples GetTxQueuePages at 10 Hz from a second thread during each floor step (configured pages, fewest free, samples empty), checks the pre-bring-up refusal, and takes --gap-us to hold the offered load under the air's ceiling. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Stacked on #609. This branch now merges
|
josephnef
left a comment
There was a problem hiding this comment.
Re-review of 2d53500 + d198b51. Both first-round points are addressed; the one remaining blocker is inherited from #609.
Blocking
- The MSVC job fails on
tests/igi_floor_probe.cpp(std::maxagainst the Windowsmaxmacro; details on #609). This branch adds two more affected lines, see the inline comment. Fixing it in #609 and merging forward covers both.
Resolved
GetTxQueuePagesrefuses before bring-up with the outputs untouched, under_reg_mu.- The header states the below-the-ceiling limit and the pre-bring-up refusal.
- The probe is the in-tree caller.
Checked on hardware (BL-M8812EU2, ch 157(+), MCS2/40/LDPC, 1400 B, this head):
-
Before bring-up: refused, poisoned outputs left alone (probe exit 0, two runs).
-
Offered ~650 frames/s (
--gap-us 1100), 8 s per step, 80 samples:floor (IGI) sent / failed empty in lowest free 0x22 5238 / 0 80/80 1745 0x1e 5241 / 0 78/80 1725 0x22 5227 / 0 80/80 1745 0x1e 4954 / 18 65/80 17 -
No gap, 2792-2813 frames/s, 0 failed: lowest free 17 at every floor, empty in 0-1 of 40 samples. That matches your control and the header's wording.
-
The two 0x1e steps differ a lot (78/80 against 65/80 with 18 failed sends), so on this unit the reading at 0x1e varies within one session.
Non-blocking
- The probe needed a local -20 dB power offset to run on my bench (inline comment on #609).
Limits: one unit, one channel, one run, TX power at -20 dB through a local patch to the probe.
NOMINMAX before the libusb include, as the other libusb tools do, so windows.h does not turn std::max into its macro (C2589). --pwr-qdb N applies SetTxPowerOffsetQdb(N) after bring-up, so the probe reproduces the doc's -20 dB run-time row and runs on a bench whose supply sags under a full-power flood. A step whose register access throws prints a FAIL line and the walk goes on, as the setter's contract tells callers to catch, instead of an uncaught terminate. The doc's run-time paragraph adds the second session on the same unit, which kept full rate at 0x1e. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… FAIL on a throw The probe's step loop now catches a throwing step; the PUB sampler thread is joined on that path too, so the throw cannot destroy a joinable thread. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
josephnef
left a comment
There was a problem hiding this comment.
Re-review of 8a89e68. The inherited MSVC blocker is fixed (build (windows-latest, Release, cl) passes, CI 30/30), and the sampler thread is now joined when a step throws.
Checked on hardware (BL-M8812EU2, ch 157(+), MCS2/40/LDPC, 1400 B, this head, the probe unpatched with --pwr-qdb -80, exit 0):
Offered ~750 frames/s (--gap-us 1100), 8 s per step, 80 samples:
| floor (IGI) | sent / failed | empty in | lowest free |
|---|---|---|---|
| 0x22 | 5956 / 0 | 80/80 | 1745 |
| 0x1e | 6126 / 0 | 51/80 | 765 |
| 0x22 | 6182 / 0 | 80/80 | 1745 |
| 0x1e | 5464 / 44 | 29/80 | 17 |
No gap, 2221-2818 frames/s: lowest free 17 at every floor, empty in 0-1 of 40 samples.
The first 0x1e step shows the page count catching the stalled state with no failed send, which is the point of the reading.
Limits: one unit, one channel, one run per arm, host-side submitted rates only.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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