[PATCH wireless-next v2 0/7] wifi: mac80211: TSO and SG for encap offload, and the TID of 802.3 RX frames

From: Julius Bairaktaris

Date: Sat Nov 28 2026 - 11:03:43 EST


Patch 4 lets a driver offer TSO and scatter-gather on the netdevs that
send with 802.3 encap offload, without offering them on the 802.11
path. ath11k uses it in a series for ath-next that lets the TCL segment
TCP batches, which depends on this patch. Patches 1 to 3 fix the AQL
airtime estimate, which patch 4 uses to segment a GSO frame for a slow
station.

Patches 5 to 7 count frames received in 802.3 format on their TID: the
802.3 receive path counted all of them on TID 0. Patch 5 adds the field,
6 and 7 fill it in ath11k and ath12k.

What the fixes for released code change:

- Patch 1: a station that sends at a low rate to an mt76x0, mt76x2 or
mt7603 radio, which compute RX airtime over a whole A-MPDU, is
charged a fraction of its airtime and gets more than its share under
airtime fairness. CVSS 3.1 3.5 (AV:A/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L).
Found by the hosted Sashiko review of v1.
- Patch 2: every VO frame an AQL driver (mt76, ath10k) sends at an HT
or later rate is charged less than its airtime, so the VO queue holds
more than the AQL limit. CVSS 3.1 0.0, queue accounting only. Found
by an LLM review (Claude).
- Patch 3: an estimate of 65536 us or more is charged modulo 65536 us.
Without patch 4 that takes an A-MSDU of about 8 KB to a station whose
last rate is 1 Mbit/s. CVSS 3.1 0.0, queue accounting only. Found by
an LLM review (Claude).
- Patch 5: the per-TID RX MSDU counters of a station count every 802.3
frame on TID 0. CVSS 3.1 0.0, statistics only. Found reading the
802.3 receive path.

None of them touches memory safety, and nothing short of the patches
avoids them.

Tests, on x86_64:
- A KUnit test of airtime.c (not part of this series), HT MCS0 20 MHz.
wireless-next fails all 5 cases: 65536 bytes come out as 2834 us
instead of 80658 us, the VO and A-MPDU estimates of 1500 bytes are
both 1912 us, and 65540 us is stored as 4 us. With patch 1, 3 cases
pass; with patch 2, 4 (VO 1932 us); with patch 3, all 5. One run
each.
- mac80211_hwsim in QEMU with a local change that sets encap offload
and encap_netdev_features (not part of this series): a netdev created
as station, changed to mesh point and joined to a mesh, TCP for 5 s.
v1 handed GSO frames to its ndo_start_xmit and skb_checksum_help()
warned, in 2 of 2 runs; this version hands it none and nothing warns,
in 2 of 2 runs. A P2P client netdev has TSO and SG with this version
and had neither with v1.
- W=1 builds of each patch for x86_64 (gcc) and arm64 (clang 21), with
no warnings.

Changes in v2:
- New patches 1 to 3.
- Patch 4 (v1 1/4): the encap features are taken away per frame on the
non-encap netdev ops, the AQL fallback keeps SG, a station without a
usable rate gets its GSO frames segmented, kernel-doc for an
encap_gso_max_segs of 0.
- Patches 6 and 7 (v1 3/4 and 4/4): read the TID before the copy of the
rx status overwrites it, and report frames without QoS control as
such.
- Rebased onto wireless-next 18d0bedbb5f0.
Details below the --- of each patch.

v1: https://lore.kernel.org/all/20261122134228.956044-1-julius@xxxxxxxxxxxxxx/

I used Claude (Anthropic) to help write these patches.

Julius Bairaktaris (7):
wifi: mac80211: compute the airtime estimate in 64 bits
wifi: mac80211: use the ampdu argument of
ieee80211_calc_expected_tx_airtime()
wifi: mac80211: clamp the AQL airtime estimate before narrowing it
wifi: mac80211: advertise TSO and SG for encap offloaded frames
wifi: mac80211: take the TID of an 802.3 frame from the driver
wifi: ath11k: pass the TID of a received 802.3 frame to mac80211
wifi: ath12k: pass the TID of a received 802.3 frame to mac80211

drivers/net/wireless/ath/ath11k/dp_rx.c | 14 +++-
drivers/net/wireless/ath/ath11k/hw.c | 25 +++++++
drivers/net/wireless/ath/ath11k/hw.h | 1 +
drivers/net/wireless/ath/ath12k/dp_rx.c | 2 +
drivers/net/wireless/ath/ath12k/hal.h | 1 +
.../wireless/ath/ath12k/wifi7/hal_qcc2072.c | 8 +++
.../wireless/ath/ath12k/wifi7/hal_qcn9274.c | 9 +++
.../wireless/ath/ath12k/wifi7/hal_wcn7850.c | 9 +++
include/net/mac80211.h | 23 ++++++-
net/mac80211/airtime.c | 9 +--
net/mac80211/iface.c | 28 ++++++++
net/mac80211/main.c | 3 +-
net/mac80211/rx.c | 3 +
net/mac80211/tx.c | 65 ++++++++++++++++++-
14 files changed, 188 insertions(+), 12 deletions(-)


base-commit: 18d0bedbb5f0538396cb7f763ed9cd1dd69c5b23
--
2.53.0