jaguar3: honour rx.keep_corrupted in the monitor RCR (ACRC32|AICV) - #416
Conversation
PR Summary by QodoHonor keep_corrupted in Jaguar3 monitor receive configuration
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo
1.
|
8bf7d8b to
870f076
Compare
DEVOURER_RX_KEEP_CORRUPTED was a silent no-op on Jaguar3 — the hardcoded monitor RCR left ACRC32/AICV clear despite a comment claiming otherwise, so the WMAC dropped every FCS-failed frame and the fused-FEC salvage layer had nothing to work on. Submitted upstream as OpenIPC#416. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JiAS32956Z3cmTbnmcXYkT
josephnef
left a comment
There was a problem hiding this comment.
Correct fix, and the decode in the new comment holds up.
I checked 0xF410400F | BIT28 against reference/rtl88x2cu/hal/halmac/halmac_bit_8822c.h:15954-15986: APP_FCS(31) APP_MIC(30) APP_ICV(29) APP_PHYSTS(28) VHT_DACK(26) PKTCTL_DLEN(20) HTC_LOC_CTRL(14) AB(3) AM(2) APM(1) AAP(0). ACRC32(8) and AICV(9) are genuinely absent, and the old comment's ACF was never in the literal either — the correction is right on both counts.
Downstream is wired, so the RCR bits really are the whole gate: FrameParserJaguar3.h:242-243 decodes crc_err/icv_err, RtlJaguar3Device.cpp:299-300 propagates them into RxAtrib, and the RX loop delivers the frame to the packetProcessor without a software drop (only the PHY-status fold at :343 gates on crc_err). The fix does reach the salvage layer.
Two things beyond the inline note:
A behaviour change the description doesn't cover. examples/doctor/main.cpp:229 sets cfg.rx.keep_corrupted = true unconditionally. On Jaguar3 the doctor's rx_frames_crc goes from structurally-always-0 to a real count. No verdict flip — ClassifyAdapterHealth reads rx_frames_ok separately — but the printed report changes on this generation, and "default behaviour is unchanged" reads as covering the shipped tools. Worth a line in the body.
Needs a rebase. The branch is BEHIND master; #415 renamed IRtlDevice→IRadio. Trivial here since this diff touches neither.
No objection to merging once rebased.
DEVOURER_RX_KEEP_CORRUPTED / DeviceConfig::rx.keep_corrupted was a silent
no-op on Jaguar3 (RTL8812CU/8822CU, RTL8812EU/8822EU).
monitor_rx_cfg wrote a hardcoded RCR of 0xF410400F and its comment claimed
that value already accepted CRC/ICV-error frames. Decoding the literal
against halmac_bit_8822c.h / halmac_bit_8822e.h shows ACRC32 (BIT8) and
AICV (BIT9) are not in it, so the WMAC dropped every FCS-failed frame no
matter how the config field was set, and the corrupted-frame retention the
fused-FEC salvage layer is built on never worked on this generation.
The fix gates the two bits on _cfg.rx.keep_corrupted, which is what
Jaguar1, Jaguar2 and the RTL8733B already do. Both misleading comments are
corrected, including a full decode of the base literal. The separate
`| (1u << 28)` for APP_PHYSTS is dropped: bit 28 is already inside the
leading 0xF nibble, and ORing it again read as if it were being added.
Default behaviour of the library is unchanged: keep_corrupted defaults to
false, so an unconfigured Jaguar3 monitor session programs exactly the RCR
it programmed before. One shipped tool does change: `doctor` sets
keep_corrupted unconditionally, so on Jaguar3 its printed rx_frames_crc
goes from structurally-always-0 to a real count. The HEALTHY/SUSPECT
verdict reads rx_frames_ok separately and does not move.
Also widens the keep_corrupted doc comment in DeviceConfig.h to name
Jaguar3 and the RTL8733B, and to state that Kestrel has no port.
Validation (tests/keep_corrupted_j3_ab.sh, one 20-30 s cell per arm, host
counting rx.corrupt events with the descriptor's crc_err bit set):
8812CU (0bda:c812) ch6: off 2894 frames / 0 crc_err
on 4152 frames / 1258 crc_err (2894 good)
8812EU (0bda:a81a) ch36: off 47351 frames / 0 crc_err
on 41726 frames / 1918 crc_err
One unit of each die, one bench. The 8812EU unit on this bench hears
nothing on 2.4 GHz with or without the knob, so its 2.4 GHz cell is
uninformative rather than a counter-example.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
870f076 to
4c1ecc4
Compare
|
/review |
|
Code review by qodo was updated up to the latest commit 4c1ecc4 |
…fuses a dead cell The off arm now runs under env -u DEVOURER_RX_KEEP_CORRUPTED, so a caller who exported the knob cannot silently turn both arms into the on arm. A cell whose rxdemo is no longer running when the dwell ends (device open, claim or bring-up failed) is reported as FAIL with its stderr tail instead of a zero-frame "result". Both re-checked on the 8812CU (off 1962/0, on 2462/647 crc_err in 10 s) and the failure path on a bogus PID. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
/review |
|
Code review by qodo was updated up to the latest commit c0744c7 |
…s events to stdout Mt7612uRadio forwards rx.keep_corrupted into mt7612u_set_monitor_rx, so the doc comment listing where the knob is honoured now includes it, and the mechanism wording no longer assumes a Realtek RCR. The A/B script pins DEVOURER_EVENTS=stdout, the stream it counts from, so an exported DEVOURER_EVENTS=off|stderr cannot turn both arms into zeros. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
/review |
|
Code review by qodo was updated up to the latest commit 7352dc0 |
DEVOURER_RX_KEEP_CORRUPTED/DeviceConfig::rx.keep_corruptedwas a silentno-op on Jaguar3 (RTL8812CU/8822CU, RTL8812EU/8822EU).
monitor_rx_cfgwrote a hardcoded RCR of0xF410400F | BIT28, and its commentclaimed that value already accepted CRC/ICV-error frames — it listed
AAP/APM/AM/AB/ACF/AICV/ACRC32 + APP_PHYSTS. Decoding the literal againsthalmac_bit_8822c.h/halmac_bit_8822e.hshows ACRC32 (BIT8) and AICV (BIT9)are not in it. The WMAC filter therefore dropped every FCS-failed frame no
matter how the config field was set, so the corrupted-frame retention the
fused-FEC salvage layer is built on never worked on this generation.
The fix gates the two bits on
_cfg.rx.keep_corrupted, which is what Jaguar1(
RadioManagementModule.cpp), Jaguar2 (HalJaguar2.cpp) and the RTL8733B(
Halmac8733bMac::configure_monitor_rx) already do. Both misleading commentsare corrected, including a full decode of the base literal so the next reader
does not have to redo it.
Default behaviour is unchanged:
keep_corrupteddefaults tofalse, so anunconfigured Jaguar3 monitor session programs exactly the RCR it programmed
before this patch.
The separate
| (1u << 28)for APP_PHYSTS is dropped: bit 28 is alreadyinside the leading
0xFnibble of the base literal, and ORing it again readas if it were being added on top.
One shipped tool does change:
doctorsetskeep_corruptedunconditionally,so on Jaguar3 its printed
rx_frames_crcgoes from structurally-always-0 to areal count. The HEALTHY/SUSPECT verdict reads
rx_frames_okseparately anddoes not move.
Also widens the
keep_corrupteddoc comment inDeviceConfig.h, which said"Jaguar1 + Jaguar2": it now names Jaguar3 and the RTL8733B, and states that
Kestrel has no port and the knob is inert there.
Validation
tests/keep_corrupted_j3_ab.sh(added here): one rxdemo cell per arm on thesame channel, host counting
rx.corruptevents with the descriptor'scrc_errbit set (DEVOURER_RX_DUMP_ALL=1).0bda:c812)0bda:a81a)One unit of each die, one bench, single cells. The 8812EU unit on this bench
hears nothing on 2.4 GHz with or without the knob, so its 2.4 GHz cell is
uninformative rather than a counter-example. The original author's 8812EU
A/B (crc_err non-zero only with the bits set) agrees.
No headless selftest:
monitor_rx_cfgwrites straight to the device with noseam to assert against, which is also why the Jaguar1 and Jaguar2 equivalents
have none.
cmake --build+ctestgreen (66/66).Note the Jaguar1 measurement in
docs/pseudo-preamble-puncturing.md("zeroFCS-failed frames" under a jammed slice) is unaffected — that experiment used
an 8814AU receiver, whose path already gated correctly.