sv6160: root-cause A-MSDU -- we never set SUPPORT_FAST_XMIT, and the chip cannot carry it
Chased down properly instead of guessed at, and every previous explanation in
this repo turned out to be wrong.
WHY IT NEVER ENGAGED. ieee80211_amsdu_aggregate() has exactly one call site,
inside ieee80211_xmit_fast(). mac80211 only populates sta->fast_tx when the
driver advertises IEEE80211_HW_SUPPORT_FAST_XMIT, and
ieee80211_check_fast_xmit() returns at its very first line without it. We
never set that flag, so the aggregation code was structurally unreachable. We
did set TX_AMSDU, which only says we can ACCEPT an aggregated frame -- not that
mac80211 should build one.
Adding the flag works: tx_max_frame went 1542 -> 3080, two MSDUs in one frame,
the first A-MSDU this driver has sent.
AND IT IS UNUSABLE. Throughput collapsed from 0.77 MB/s to 0.02-0.08 MB/s,
with sdio_write_data() failing -16 and the host-rebind recovery firing. The
chip will not carry the larger body, which is consistent with the rule already
recorded here that padding a CMD53 to the block size kills the link and that
the vendor found concatenating does too. So A-MSDU is closed as a throughput
lever -- now for a measured reason rather than a guessed one.
REFUTED ON HARDWARE, recorded so nobody repeats them:
- "the peer does not advertise a usable max_amsdu_len" -- it does, iw decodes
the AP's HT capabilities as "Max AMSDU length: 7935 bytes"
- "the ADDBA Response clears the A-MSDU bit so mac80211 latches
IEEE80211_TXQ_NO_AMSDU on the TID" -- refusing TX BlockAck outright left
tx_max_frame at 1542 and cut throughput 5x
- "blocked on a pull-model TX rewrite" -- that rewrite exists (mod_txq) and
could never have helped: with fast-xmit off no TX model can aggregate
METHOD NOTE, because it cost three invalid runs: SUPPORT_FAST_XMIT is latched
at probe from mod_amsdu, so it has to be passed to insmod. Setting amsdu=1 by
sysfs after loading measures the unflagged driver and produces a clean-looking
negative result. The probe build was made to log its own flag state and the
harness to discard any arm that could not prove it, which is the only reason
the real answer surfaced.
Comment and README only; no behavioural change.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JSNniou44nN9EFGqTmZ6my
This commit is contained in:
1 parent
aa908e8c7f
commit
768b42a0b6
2 files changed
+61
-34
No files matched your search
@@ -55,42 +55,51 @@ and `SDIO_ARCHITECTURE.md` for the SDIO protocol specification.
|
||||
| A-MSDU | Not engaged — the enabling rewrite (`txq=1`) exists and is active, but mac80211 still never builds one; see below |
|
||||
| eFuse MAC address | Not implemented (random MAC) |
|
||||
|
||||
### A-MSDU: why it is still not engaged
|
||||
### A-MSDU: chased down, and it is a dead end
|
||||
|
||||
Worth stating plainly, because the obvious next step has already been taken.
|
||||
Root-caused rather than assumed, because the obvious explanations were all
|
||||
wrong.
|
||||
|
||||
The pull-model TX rewrite that A-MSDU needs **is implemented** -- `txq=1`,
|
||||
wired to `.wake_tx_queue` and `ieee80211_tx_dequeue`. The push shim drains the
|
||||
txq on every wake, so mac80211 never has a queued head to append to and
|
||||
`ieee80211_amsdu_aggregate()` can never fire; pulling only when a descriptor is
|
||||
free was supposed to fix that.
|
||||
**Why it never engaged: we do not set `IEEE80211_HW_SUPPORT_FAST_XMIT`.**
|
||||
`ieee80211_amsdu_aggregate()` has exactly one call site, inside
|
||||
`ieee80211_xmit_fast()`; mac80211 only builds `sta->fast_tx` when the driver
|
||||
advertises that flag, and `ieee80211_check_fast_xmit()` returns at its first
|
||||
line without it. So the aggregation code was structurally unreachable. We
|
||||
advertised `TX_AMSDU` -- "we can accept an A-MSDU" -- without the flag that
|
||||
makes mac80211 take the path that *builds* one.
|
||||
|
||||
Measured with it on: frames really are pulled (`txq_pulled` climbs into the
|
||||
thousands) and `tx_max_frame` stays pinned at **1542** -- a single MSDU. No
|
||||
A-MSDU is ever built, in any combination:
|
||||
Adding the flag does work: `tx_max_frame` went from 1542 to **3080**, i.e. two
|
||||
MSDUs in one frame, the first A-MSDU this driver has ever sent.
|
||||
|
||||
| mode | throughput | `tx_max_frame` | `txq_pulled` |
|
||||
|---|---|---|---|
|
||||
| `txq=0 amsdu=0` | 0.92 MB/s | 1542 | 0 |
|
||||
| `txq=0 amsdu=1` | 0.95 MB/s | 1542 | 0 |
|
||||
| `txq=1 amsdu=1` | 0.79 MB/s | 1542 | 4392 |
|
||||
**And it is unusable.** Throughput collapsed from 0.77 MB/s to 0.02-0.08 MB/s,
|
||||
with `sdio_write_data(...) failed: -16` in the log and the host-rebind recovery
|
||||
firing. The chip cannot carry the larger frame bodies -- consistent with what
|
||||
is already known about this SDIO path, where padding a CMD53 to the block size
|
||||
kills the link and the vendor records that concatenating does too.
|
||||
|
||||
So the pull model is not the missing piece, and it costs throughput, which is
|
||||
why it defaults off.
|
||||
So A-MSDU is closed as a throughput lever, for a better reason than before.
|
||||
|
||||
The payoff was also overstated. A-MSDU was motivated by a model of the TX cost
|
||||
as ~500 us fixed per CMD53 almost regardless of size -- if that were true,
|
||||
fewer, larger frames would be a large win. It is not true: measured, 326 B
|
||||
costs 318 us and 1530 B costs 1592 us, an intercept of about zero. Cost scales
|
||||
with bytes, so bigger frames save only per-frame header and contention
|
||||
overhead, not a fixed per-command charge.
|
||||
Two earlier explanations, both refuted on hardware:
|
||||
|
||||
What has *not* been checked is whether the peer advertises a usable
|
||||
`max_amsdu_len` at all -- mac80211 will not aggregate if it is absent or zero,
|
||||
and that is decided by the AP, not by us. That is the next thing to look at,
|
||||
and it is cheap.
|
||||
- *"the peer does not advertise a usable max_amsdu_len"* -- it does:
|
||||
`iw` decodes the AP's HT capabilities as `Max AMSDU length: 7935 bytes`.
|
||||
- *"the ADDBA Response clears the A-MSDU bit, so mac80211 latches
|
||||
`IEEE80211_TXQ_NO_AMSDU` on the TID"* -- refusing TX BlockAck entirely left
|
||||
`tx_max_frame` at 1542 while collapsing throughput 5x.
|
||||
|
||||
### Recovery ladder
|
||||
And the pull-model rewrite (`txq=1`) was built to unblock A-MSDU on the theory
|
||||
that the push shim drains the txq before mac80211 can aggregate. That theory
|
||||
was untestable: with fast-xmit off, no TX model could have produced an A-MSDU.
|
||||
The rewrite costs throughput and is correctly left off, but it was never the
|
||||
blocker.
|
||||
|
||||
**Testing note.** `SUPPORT_FAST_XMIT` is latched at probe from the `amsdu`
|
||||
parameter, so it must be passed to `insmod` -- setting it by sysfs afterwards
|
||||
silently measures the unflagged driver. Three runs were invalidated that way
|
||||
before the probe build was made to log its own flag state and the harness to
|
||||
discard any arm that could not prove it.
|
||||
|
||||
### Recovery ladder### Recovery ladder
|
||||
|
||||
The driver rescues itself from both wedge modes rather than needing a human:
|
||||
|
||||
|
||||
@@ -317,12 +317,30 @@ MODULE_PARM_DESC(fixed_mcs, "Force this HT MCS index for data frames (-1 = let m
|
||||
* scales with bytes, so A-MSDU saves per-frame header and contention overhead
|
||||
* only -- real, but far smaller than that model implied.
|
||||
*
|
||||
* And it does not currently engage at all. The pull model it needs is
|
||||
* implemented (mod_txq) and verifiably active -- txq_pulled climbs into the
|
||||
* thousands -- yet tx_max_frame stays at 1542, one MSDU, with txq on or off
|
||||
* and amsdu on or off. So the push shim was not the blocker. The unchecked
|
||||
* candidate is the peer's advertised max_amsdu_len: mac80211 will not
|
||||
* aggregate if the AP does not offer one. */
|
||||
* And the chip cannot carry it. Root-caused 2026-09-18: aggregation never
|
||||
* happened because we do not set IEEE80211_HW_SUPPORT_FAST_XMIT.
|
||||
* ieee80211_amsdu_aggregate() has exactly one call site, inside
|
||||
* ieee80211_xmit_fast(), and mac80211 only builds sta->fast_tx when that flag
|
||||
* is advertised -- ieee80211_check_fast_xmit() returns at its first line
|
||||
* without it. So the code was unreachable; TX_AMSDU alone only says we can
|
||||
* ACCEPT an A-MSDU, not that mac80211 should build one.
|
||||
*
|
||||
* Adding the flag does work -- tx_max_frame 1542 -> 3080, two MSDUs in one
|
||||
* frame -- and is unusable: throughput collapses from 0.77 to 0.02-0.08 MB/s
|
||||
* with sdio_write_data() failing -16 and the host-rebind recovery firing. The
|
||||
* larger body is more than this SDIO path will carry, which matches the
|
||||
* existing rule that padding a CMD53 to the block size kills the link.
|
||||
*
|
||||
* Refuted on hardware, so do not re-run them: the peer DOES advertise a usable
|
||||
* length (Max AMSDU length: 7935 bytes), and IEEE80211_TXQ_NO_AMSDU from the
|
||||
* ADDBA Response is not the gate either (refusing TX BlockAck left
|
||||
* tx_max_frame at 1542 while cutting throughput 5x). The pull model (mod_txq)
|
||||
* was written to unblock this and never could have: with fast-xmit off, no TX
|
||||
* model can produce an A-MSDU.
|
||||
*
|
||||
* If anyone retries this: the flag is latched at PROBE from mod_amsdu, so it
|
||||
* must be passed to insmod. Setting amsdu=1 by sysfs afterwards measures the
|
||||
* unflagged driver and looks exactly like a clean negative result. */
|
||||
static int mod_amsdu;
|
||||
module_param_named(amsdu, mod_amsdu, int, 0644);
|
||||
MODULE_PARM_DESC(amsdu, "Allow mac80211 to build A-MSDUs: 0=off (default), 1=on");
|
||||
|
||||
Reference in new issue
Block a user