Skip to content

Commit d20ef63

Browse files
jmberglinvjw
authored andcommitted
mac80211: document ieee80211_rx() context requirement
ieee80211_rx() must be called with softirqs disabled since the networking stack requires this for netif_rx() and some code in mac80211 can assume that it can not be processing its own tasklet and this call at the same time. It may be possible to remove this requirement after a careful audit of mac80211 and doing any needed locking improvements in it along with disabling softirqs around netif_rx(). An alternative might be to push all packet processing to process context in mac80211, instead of to the tasklet, and add other synchronisation. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: John W. Linville <[email protected]>
1 parent edbfdcc commit d20ef63

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

include/net/mac80211.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1669,6 +1669,8 @@ void ieee80211_restart_hw(struct ieee80211_hw *hw);
16691669
* to this function and ieee80211_rx_irqsafe() may not be mixed for a
16701670
* single hardware.
16711671
*
1672+
* Note that right now, this function must be called with softirqs disabled.
1673+
*
16721674
* @hw: the hardware this frame came in on
16731675
* @skb: the buffer to receive, owned by mac80211 after this call
16741676
*/

net/mac80211/rx.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2453,6 +2453,8 @@ void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb)
24532453
struct ieee80211_supported_band *sband;
24542454
struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
24552455

2456+
WARN_ON_ONCE(softirq_count() == 0);
2457+
24562458
if (WARN_ON(status->band < 0 ||
24572459
status->band >= IEEE80211_NUM_BANDS))
24582460
goto drop;

0 commit comments

Comments
 (0)