Repository navigation
wifi: apple: centauri: keep the station counter length with its record - #2908
Conversation
Every reply to the statistics command overwrites stats_length, while station_stats_valid is only set by a station counter record of a supported length. A later reply carrying another record leaves the counters marked valid with a length that no longer describes them, and the debugfs and connection readers then iterate past station_stats. Record the length of the accepted counter record in its own field, set together with station_stats_valid, and iterate over that. Move the statistics reply handling into a helper so that it can be tested, and add a KUnit case for it (CONFIG_APPLE_CENTAURI_KUNIT_TEST). Signed-off-by: Ryan Murray <[email protected]>
|
Review at a789b5c. Follow-up to the #2894 review, centauri part. This is the same commit that was reviewed there as good (same patch as e0b2c56, rebased), and it stands. What it fixes: the debugfs and connection readers iterated Nothing new found. Two small remarks, neither blocking:
Rows owed at this head (none run): one Mac with this Wi-Fi (J813/J815, or a T6050 Mac): join a network, read |
There was a problem hiding this comment.
Formal adversarial §1–§6 pre-PR checklist review at a789b5ca16130b8e46998cb4f73311c6cf6270d6 (REQUEST_CHANGES — 0 code blockers; pending CI and owed §5 hardware row).
Checklist Summary
- §1 (No model gating): Pass — no chip, SoC, board, or firmware-version gates.
- §2 (Production-ready, no hacks): Pass — no new command-line or module parameters; clean extraction of
record_stats_reply(). - §3 (Safety — bounds, concurrency, memory): Pass —
station_statsisu8[888](0x378).record_stats_reply()(centauri_wifi.c:554-588) only setsstation_stats_len(to752or888) together withstation_stats_valid = trueafter checking!status,stats_tag == 0xf928, andsize >= 28 + wifi->stats_length(withsize <= BUFFER_SIZEalready bounded bydrain_control()).query_station_stats()clears both fields (centauri_wifi.c:2287-2288), and both readers (connect_worker():1294,station_stats_show():2309) run underwifi->lockand iterate up tostation_stats_lenin 4-byte steps. The other stats decoders (rx_crypto_stats,dot11_mib_stats,tx_power_report) iterate over fixed array sizes.centauri_wifi_test.cexercises the 752-byte record, unrelated TLV withU16_MAX, 888-byte record, and rejected 900-byte record. - §4 (Clean-room & attribution): Pass — commit
a789b5ca1613carries human author/committer (Ryan Murray <[email protected]>) and humanSigned-off-by:only (zero AI trailers in commits); PR body includesAssisted-by:. - §5 (Evidence): Blocked — see Blockers below.
- §6 (Naming): Pass.
Blockers
- §5 (Owed hardware verification row): No on-hardware run has been recorded at
a789b5ca1613. Owed: a Centauri Wi-Fi Mac (J813/J815/J873 or T6050) on the default command line joining a network and reading debugfsstation_stats(including after another stats debugfs read), plus regression counts (0 SELinux denials, 0 failed units, 0 new kernel errors). - CI pending: 4/7 green (
source,host-tests,rust-build,DWC3/ATC modular-no-atc); 3/7 stillqueued(kunit,DWC3/ATC builtin-no-atc,DWC3/ATC builtin-modular-atc).
Non-blocking Notes
connect_worker()(centauri_wifi.c:1292) andstation_stats_show()(centauri_wifi.c:2307) still printwifi->stats_length(the last reply's length) besidestation_stats_validrather thanwifi->station_stats_len.drivers/net/wireless/apple/Kconfig:31help text mentions a specific board ("the J813 Wi-Fi reply handler"); since the driver is chip-level and also serves T6050 Macs, "the Centauri Wi-Fi reply handler" is cleaner.
The connection log line printed the last statistics reply's length next to the station counters, which no longer has to be the counters' own length. Print the kept counter length there, and add it to the debugfs station_stats header as counters=, after the reply's own fields. Word the KUnit option's help for the driver, not one board. Signed-off-by: Ryan Murray <[email protected]>
|
Both notes done at 6c2b438: the connection log line prints |
|
Review at 6c2b438. Both remarks from a789b5c are done in the new commit:
Nothing new in the diff: it is two format strings and help text. Commit trailers are fine. Verdict: APPROVE on code. Rows owed at this head (none run): one Mac with this Wi-Fi (J813/J815, or a T6050 Mac) on the default command line: join a network and read |
There was a problem hiding this comment.
Formal adversarial §1–§6 re-review at 6c2b4388b5d82338ffa11105928cf3d4bfa418bb (REQUEST_CHANGES — 0 code blockers; both prior non-blocking notes cleanly resolved at 6c2b4388b5d8, still blocked on owed §5 Centauri hardware row and pending CI).
Update Verification (6c2b4388b5d8)
connect_worker()(centauri_wifi.c:1292-1293) now logswifi->station_stats_len, andstation_stats_show()(centauri_wifi.c:2307-2309) preserves the reply'slength=%uwhile appendingcounters=%u(wifi->station_stats_len).drivers/net/wireless/apple/Kconfig:36-38help text now names "the Centauri Wi-Fi reply handler" instead of a single board.- Core bounds/locking fix from
a789b5ca1613(station_stats_lenin{0, 752, 888},station_stats[0x378],wifi->lock, KUnit test) remains clean.
Checklist Summary
- §1 (No model gating): Pass.
- §2 (Production-ready, no hacks): Pass.
- §3 (Safety): Pass.
- §4 (Clean-room & attribution): Pass — both commits (
a789b5ca1613,6c2b4388b5d8) carry human author/committer (Ryan Murray <[email protected]>) and humanSigned-off-by:only (zero AI trailers in commits); PR body includesAssisted-by:. - §5 (Evidence): Blocked — see Remaining Blockers below.
- §6 (Naming): Pass.
Remaining Blockers
- §5 (Owed Centauri hardware verification row): No on-hardware run recorded at
6c2b4388b5d8. Owed: a Centauri Wi-Fi Mac (J813/J815/J873 or T6050) on the default command line joining a network and reading debugfsstation_statstwice with another statistics debugfs read in between, plus regression counts (0 SELinux denials, 0 failed units, 0 new kernel errors). - CI pending: 4/7 green (
host-tests,source,rust-build,DWC3/ATC builtin-no-atc); 3/7 stillIN_PROGRESS/QUEUED(kunit,DWC3/ATC modular-no-atc,DWC3/ATC builtin-modular-atc).
|
Merge readiness at
Areas: none matched in CODEOWNERS Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verdict: FINISH, then merge at 6c2b4388b5d8: the code is ready; it needs only a row at this head.
Blockers: none in the code. Missing row: one Centauri Wi-Fi Mac at this head (the J714s, or a J813/J815): join a network and read station_stats twice with another statistics read in between, with sane counters.
Checked: no Apple material, no gates. The station counter length is kept with its record. CI green.
Superseded by the review at 6c2b438
|
6c2b438 J616s (T6040, M4 Pro) PASS: guarded one-shot combined batch (1c06fa69cde5 over main 8f99a85, 0 merge-tree diffs on 3 changed files, default cmdline, stock Stage 2 1.0.0b17, boot 1efdeb87-4c6d-44ed-9e5a-929ba5ed4c4f): 0 failed units, Enforcing, 0 new AVC, 0 GPU faults, 0 new kernel errors, eDP-1 connected, 25 thermal zones clean, Borealis VK api.smoke 8/8 pre/post 2/2 rtc1 s2idle, Wi-Fi 3/3 pre/post; stock 7.3.0-aurora-fleet89 restored. |
Every reply to the centauri statistics command overwrote
stats_length, whilestation_stats_validwas only set by a station counter record of a supported length, so the two could disagree.Problem
A later statistics reply carrying another record leaves the counters marked valid with a length that no longer describes them, and the debugfs and connection readers iterate by that length.
Change
station_stats_valid, and iterate over that.CONFIG_APPLE_CENTAURI_KUNIT_TEST).No gates; no new parameters.
Testing
apple-centauri-wifipasses (arm64 qemu,LLVM=1); with the fix reverted and the test kept, it fails.W=1build ofdrivers/net/wireless/apple/: no warnings; checkpatch clean apart from the MAINTAINERS note.Still to run
station_statsin debugfs. We have none in the lab; a row from someone who has one is welcome.Reviewer detail