Control: reassign -1 broadcom-sta-dkms 6.30.223.271-29
Control: tags -1 + patch

Apologies: my webmail sent the original report with its plain-text part
flattened onto a single line, so the BTS read every word after "Package:"
as a package name and copied the report to many unrelated maintainers.
Sorry for the noise. The Control lines above reassign it to
broadcom-sta-dkms only. The report, as intended, follows.

With a BCM4360 (14e4:43a0) on 5 GHz 802.11ac, the wl driver stops receiving
during sustained downloads (about once a minute at 200-300 Mbit/s). It stays
associated and transmit works, but nothing is received until a reconnect.

During a stall the firmware counters show every unicast frame from the AP
dropped as a CCMP replay (rxdfrmucastmbss == rxundec == ccmpreplay). A/B tests
point at A-MSDUs carried inside A-MPDUs:

  rx_amsdu_in_ampdu=1 (default): 3 stalls in 4 min, 232 Mbit/s
  rx_amsdu_in_ampdu=0:           0 stalls in 5 min, 346 Mbit/s
  fixed driver, 20 min soak:     0 stalls, 298 Mbit/s average

Re-checked from scratch: the unmodified Ubuntu driver stalled 5 times in
10 min (first within a minute); stock + only the fix: 0 stalls in 10 min at
347 Mbit/s; the same build with the option set back to 1: 8 stalls in 5 min.

The stored replay counter was also read directly, through a read-only debug
/proc file (no key bytes) that exposes the blob's per-key receive PNs. In
three stalls it jumped from about 22k-80k to 8.4M, 2.1M and 1.08G in the same
200 ms interval in which the replay drops began, and stayed there until the
reconnect. The low 16 bits kept advancing normally; only the high 32 bits took
a wrong value. With the option at 0 it grew steadily, with no replays.

Traced further with a separate kprobe module (in the repo), the bad PN comes
from a mis-assembled A-MSDU. With hardware deaggregation, a buffer tagged
"first" sometimes arrives mid-MPDU. It has an odd length and 3-15 flipped bits
in the QoS/key-ID/PN[2..5] bytes of its 802.11 header. The RxStatus2 piece
counter then skips 3-31 pieces. wlc_recvamsdu looks only at the
first/middle/last bits, so it completes the chain with a later MPDU's
middle/last pieces. That last piece's clean decrypt status is trusted, and the
PN parsed from the damaged head is stored. Seen directly in 4 jumps, with the
same signs in 6 more. Card counters per 60 s, option at 1 vs 0: rxfrmtoolong
115/0, rxgiant 139/0, ccmpreplay 805/0.

The flag is only read when the driver builds its ADDBA response, so with 0
the AP simply stops nesting A-MSDUs in A-MPDUs (standard 802.11 behaviour).

The catch: the hybrid blob rejects this iovar (and most non-core ones) with
BCME_UNSUPPORTED, because wlc_iovar_check requires flag 0x4000 in the iovar
table entry. A small script sets that bit on the local blob copy at build
time (11 bytes, found by ELF relocation; the blob itself is not
redistributed), and a short patch sets the option after wlc_attach. It could
be applied in the package's DKMS build step.

Patches, the unlock script, a stall test and the full write-up:
https://github.com/patij212/bcm4360-wl-rx-stall-fix

Seen on Ubuntu 26.04 (6.30.223.271-29ubuntu1, kernel 7.0); the patches are
against that source, i.e. with the Debian patch series applied. Tested on one
card and one router so far.

Reply via email to