Commit d20ef63d32461332958661df73e21c0ca42601b0
Committed by
John W. Linville
1 parent
edbfdcceb4
Exists in
master
and in
20 other branches
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 <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Showing 2 changed files with 4 additions and 0 deletions Side-by-side Diff
include/net/mac80211.h
... | ... | @@ -1669,6 +1669,8 @@ |
1669 | 1669 | * to this function and ieee80211_rx_irqsafe() may not be mixed for a |
1670 | 1670 | * single hardware. |
1671 | 1671 | * |
1672 | + * Note that right now, this function must be called with softirqs disabled. | |
1673 | + * | |
1672 | 1674 | * @hw: the hardware this frame came in on |
1673 | 1675 | * @skb: the buffer to receive, owned by mac80211 after this call |
1674 | 1676 | */ |
net/mac80211/rx.c
... | ... | @@ -2453,6 +2453,8 @@ |
2453 | 2453 | struct ieee80211_supported_band *sband; |
2454 | 2454 | struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); |
2455 | 2455 | |
2456 | + WARN_ON_ONCE(softirq_count() == 0); | |
2457 | + | |
2456 | 2458 | if (WARN_ON(status->band < 0 || |
2457 | 2459 | status->band >= IEEE80211_NUM_BANDS)) |
2458 | 2460 | goto drop; |
-
mentioned in commit c730c9
-
mentioned in commit c730c9
-
mentioned in commit c730c9
-
mentioned in commit c730c9
-
mentioned in commit c730c9
-
mentioned in commit c730c9
-
mentioned in commit c730c9
-
mentioned in commit c730c9
-
mentioned in commit c730c9
-
mentioned in commit c730c9
-
mentioned in commit c730c9
-
mentioned in commit c730c9
-
mentioned in commit c730c9