Skip to content

RFC wifi: ath11k: isolate RXDMA page-frag lifetimes

Mark Ruvald Pedersen ath11k linux-wireless 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3wifi: ath11k: reserve headroom when aligning RX buffersdrivers/net/wireless/ath/ath11k/dp_rx.c+4 -40 replies
2/3wifi: ath11k: make external IRQ control idempotentdrivers/net/wireless/ath/ath11k/ahb.c drivers/net/wireless/ath/ath11k/pcic.c+6 -62 replies
3/3wifi: ath11k: use private page-frag caches for RXDMA ringsdrivers/net/wireless/ath/ath11k/core.c drivers/net/wireless/ath/ath11k/dp.h drivers/net/wireless/ath/ath11k/dp_rx.c+44 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/3] wifi: ath11k: isolate RXDMA page-frag lifetimes

ath11k fills RXDMA rings with skb heads allocated by dev_alloc_skb(). Those allocations use shared per-CPU page-frag caches, so unrelated RXDMA rings and other network users can place fragments with different lifetimes on the same backing page.

On an IPQ8074-based Linksys MX4200, repeater/AP traffic made available memory fall at roughly 12-16 MiB/min until OOM. Ring and IDR ownership remained bounded while page-frag backing accumulated. Two ownership captures found fragments from multiple allocation origins on 86-87% of the final tracker-visible backing pages.

This RFC:

1. fixes an existing no-op alignment attempt on empty RX skbs;
2. makes sequential external IRQ/NAPI lifecycle transitions idempotent;
3. quiesces non-reset crash recovery before DP teardown, gives each RXDMA ring a private page-frag cache, and drains it after the ring's DMA mappings and skbs have been released.

No RX buffer or ring sizes are changed, and the existing per-buffer DMA map/unmap lifecycle is unchanged.

page_pool should also be viable, but it is not a mechanical allocator substitution here. These skb heads need about 2.5 KiB of backing, so an order-0 pool uses one 4 KiB page per buffer. An order-1 fragmented pool restores packing density but lacks page_frag_cache's lower-order fallback under fragmentation. page_pool also adds fallible setup/unwind and requires every skb return path to become pool-aware. This RFC keeps those behaviors unchanged; I can prototype page_pool if that is the preferred ath11k direction.

The AHB version was built as an OpenWrt backport and remained bounded in natural-load, resident, and high-packet-rate pressure runs. PCI has not been runtime-tested. The non-reset firmware-recovery path has not been validated in isolation, so feedback on patches 2 and 3 is especially welcome. The IRQ state guards make repeated sequential calls safe; they do not add synchronization between concurrent lifecycle callers.

OpenWrt discussion:
https://github.com/openwrt/openwrt/pull/24254

Mark Ruvald Pedersen (3):
wifi: ath11k: reserve headroom when aligning RX buffers
wifi: ath11k: make external IRQ control idempotent
wifi: ath11k: use private page-frag caches for RXDMA rings

---
base-commit: 189721a4afa1804315e7dcfca9ca0539c7b1d7af