bes2600: Patch C2 — replace ieee80211_rx_irqsafe with ieee80211_rx_ni #9
Reference in New Issue
Block a user
Delete Branch "bes2600/rx-list-batch-delivery"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Per Phase 4 plan (besser PR #14 merged) + kerneldoc audit task #19. 6 call sites in bes2600 deferred per-RX-frame mac80211 dispatch via tasklet (
ieee80211_rx_irqsafe); replace with synchronous-from-process-context APIieee80211_rx_niwhich does its ownlocal_bh_disablewrap.Why
_niand not_listThe Phase 4 plan originally targeted
ieee80211_rx_listfor batch delivery. Mining mt76 mainline (the only driver upstream using_list) showed the canonical pattern requires threading astruct list_headthrough the per-frame call chain.bes2600's WSM dispatcher (
wsm_handle_rx→bes2600_rx_cb/wsm.cbeacon path) sits between the bh thread's SDIO read and the mac80211 hand-off; threading alist_headthrough the dispatcher is a non-trivial refactor.ieee80211_rx_ni()is the simpler drop-in: no list management, still removes the tasklet hop. Per-calllocal_bh_disablecost is trivial vs the saved tasklet schedule. Future refactor can revisit_listif measurements warrant.Sites converted (6 total)
bes2600_sta_addlink-id rx_queue drainspin_lock_bh(&ps_state_lock), would otherwise hold the lock across full mac80211 dispatchbes2600_rx_cbskb_copy → beacon_bkppattern; no lifecycle change (Phase 4 plan §6 risk #5 cleared)ap.c:96 splice refactor
The original code drained
entry->rx_queuewith_irqsafecalls inside a spin_lock_bh._irqsafedeferred to a tasklet (no actual mac80211 work under the lock). After conversion to_ni, mac80211's full RX dispatch runs synchronously — would hold ps_state_lock across that. Refactor:Mixing constraint
Kerneldoc (
include/net/mac80211.h:5399-5430):ieee80211_rx_ni()cannot mix withieee80211_rx_irqsafe()for a single hardware. All 6 sites convert atomically; no mixed state.Diff
4 files (ap.c, sta.c, txrx.c, wsm.c), +18/-7 net.
Build verified
bes2600.kobuilds clean on ohm sandbox: srcversion619A51E61BF5479AAC146E6, 0 warnings, 0 errors.Predicted Phase 7
+5-15% over post-D+E baseline (single-rep was 3.22 MB/s; v3 N=3 mean was 2.35 MB/s). Modest improvement from removing the tasklet schedule per RX frame. Smaller delta still a net win for upstream-cleanliness — kernel.org submission story benefits from not using
_irqsafefrom process context.Test plan
/var/tmp/bes2600.patchCv3.rollback.koon ohm