aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2015-06-11 10:02:32 -0400
committerJohannes Berg <johannes.berg@intel.com>2015-07-17 09:37:59 -0400
commitaf9f9b22beee70aae58651cdbb9d6375e6e51797 (patch)
tree5a90af54ae293c49d1baa3b17f2e0d8dd1961397 /net
parent798a457dfb232535ebc9670082b8dfccdab684ff (diff)
mac80211: don't store napi struct
When introducing multiple RX queues, a single NAPI struct will not be sufficient. Instead of trying to store multiple, simply change the API to have the NAPI struct passed to the RX function. This of course means that drivers using rx_irqsafe() cannot use NAPI, but that seems a reasonable trade-off, particularly since only two of all drivers are currently using it at all. While at it, we can now remove the IEEE80211_RX_REORDER_TIMER flag again since this code path cannot have a napi struct anyway. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/ieee80211_i.h6
-rw-r--r--net/mac80211/main.c12
-rw-r--r--net/mac80211/rx.c18
3 files changed, 11 insertions, 25 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 361bb3ca335c..7d75f93bac7d 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -202,8 +202,6 @@ enum ieee80211_packet_rx_flags {
202 * @IEEE80211_RX_CMNTR: received on cooked monitor already 202 * @IEEE80211_RX_CMNTR: received on cooked monitor already
203 * @IEEE80211_RX_BEACON_REPORTED: This frame was already reported 203 * @IEEE80211_RX_BEACON_REPORTED: This frame was already reported
204 * to cfg80211_report_obss_beacon(). 204 * to cfg80211_report_obss_beacon().
205 * @IEEE80211_RX_REORDER_TIMER: this frame is released by the
206 * reorder buffer timeout timer, not the normal RX path
207 * 205 *
208 * These flags are used across handling multiple interfaces 206 * These flags are used across handling multiple interfaces
209 * for a single frame. 207 * for a single frame.
@@ -211,10 +209,10 @@ enum ieee80211_packet_rx_flags {
211enum ieee80211_rx_flags { 209enum ieee80211_rx_flags {
212 IEEE80211_RX_CMNTR = BIT(0), 210 IEEE80211_RX_CMNTR = BIT(0),
213 IEEE80211_RX_BEACON_REPORTED = BIT(1), 211 IEEE80211_RX_BEACON_REPORTED = BIT(1),
214 IEEE80211_RX_REORDER_TIMER = BIT(2),
215}; 212};
216 213
217struct ieee80211_rx_data { 214struct ieee80211_rx_data {
215 struct napi_struct *napi;
218 struct sk_buff *skb; 216 struct sk_buff *skb;
219 struct ieee80211_local *local; 217 struct ieee80211_local *local;
220 struct ieee80211_sub_if_data *sdata; 218 struct ieee80211_sub_if_data *sdata;
@@ -1347,8 +1345,6 @@ struct ieee80211_local {
1347 1345
1348 struct ieee80211_sub_if_data __rcu *p2p_sdata; 1346 struct ieee80211_sub_if_data __rcu *p2p_sdata;
1349 1347
1350 struct napi_struct *napi;
1351
1352 /* virtual monitor interface */ 1348 /* virtual monitor interface */
1353 struct ieee80211_sub_if_data __rcu *monitor_sdata; 1349 struct ieee80211_sub_if_data __rcu *monitor_sdata;
1354 struct cfg80211_chan_def monitor_chandef; 1350 struct cfg80211_chan_def monitor_chandef;
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 3c63468b4dfb..dba0a86dee18 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -1132,18 +1132,6 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
1132} 1132}
1133EXPORT_SYMBOL(ieee80211_register_hw); 1133EXPORT_SYMBOL(ieee80211_register_hw);
1134 1134
1135void ieee80211_napi_add(struct ieee80211_hw *hw, struct napi_struct *napi,
1136 struct net_device *napi_dev,
1137 int (*poll)(struct napi_struct *, int),
1138 int weight)
1139{
1140 struct ieee80211_local *local = hw_to_local(hw);
1141
1142 netif_napi_add(napi_dev, napi, poll, weight);
1143 local->napi = napi;
1144}
1145EXPORT_SYMBOL_GPL(ieee80211_napi_add);
1146
1147void ieee80211_unregister_hw(struct ieee80211_hw *hw) 1135void ieee80211_unregister_hw(struct ieee80211_hw *hw)
1148{ 1136{
1149 struct ieee80211_local *local = hw_to_local(hw); 1137 struct ieee80211_local *local = hw_to_local(hw);
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index dd6bb2a54d45..817bf22dad5a 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -2148,9 +2148,8 @@ ieee80211_deliver_skb(struct ieee80211_rx_data *rx)
2148 /* deliver to local stack */ 2148 /* deliver to local stack */
2149 skb->protocol = eth_type_trans(skb, dev); 2149 skb->protocol = eth_type_trans(skb, dev);
2150 memset(skb->cb, 0, sizeof(skb->cb)); 2150 memset(skb->cb, 0, sizeof(skb->cb));
2151 if (!(rx->flags & IEEE80211_RX_REORDER_TIMER) && 2151 if (rx->napi)
2152 rx->local->napi) 2152 napi_gro_receive(rx->napi, skb);
2153 napi_gro_receive(rx->local->napi, skb);
2154 else 2153 else
2155 netif_receive_skb(skb); 2154 netif_receive_skb(skb);
2156 } 2155 }
@@ -3256,7 +3255,7 @@ void ieee80211_release_reorder_timeout(struct sta_info *sta, int tid)
3256 /* This is OK -- must be QoS data frame */ 3255 /* This is OK -- must be QoS data frame */
3257 .security_idx = tid, 3256 .security_idx = tid,
3258 .seqno_idx = tid, 3257 .seqno_idx = tid,
3259 .flags = IEEE80211_RX_REORDER_TIMER, 3258 .napi = NULL, /* must be NULL to not have races */
3260 }; 3259 };
3261 struct tid_ampdu_rx *tid_agg_rx; 3260 struct tid_ampdu_rx *tid_agg_rx;
3262 3261
@@ -3433,7 +3432,8 @@ static bool ieee80211_prepare_and_rx_handle(struct ieee80211_rx_data *rx,
3433 * be called with rcu_read_lock protection. 3432 * be called with rcu_read_lock protection.
3434 */ 3433 */
3435static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw, 3434static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw,
3436 struct sk_buff *skb) 3435 struct sk_buff *skb,
3436 struct napi_struct *napi)
3437{ 3437{
3438 struct ieee80211_local *local = hw_to_local(hw); 3438 struct ieee80211_local *local = hw_to_local(hw);
3439 struct ieee80211_sub_if_data *sdata; 3439 struct ieee80211_sub_if_data *sdata;
@@ -3449,6 +3449,7 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw,
3449 memset(&rx, 0, sizeof(rx)); 3449 memset(&rx, 0, sizeof(rx));
3450 rx.skb = skb; 3450 rx.skb = skb;
3451 rx.local = local; 3451 rx.local = local;
3452 rx.napi = napi;
3452 3453
3453 if (ieee80211_is_data(fc) || ieee80211_is_mgmt(fc)) 3454 if (ieee80211_is_data(fc) || ieee80211_is_mgmt(fc))
3454 I802_DEBUG_INC(local->dot11ReceivedFragmentCount); 3455 I802_DEBUG_INC(local->dot11ReceivedFragmentCount);
@@ -3550,7 +3551,8 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw,
3550 * This is the receive path handler. It is called by a low level driver when an 3551 * This is the receive path handler. It is called by a low level driver when an
3551 * 802.11 MPDU is received from the hardware. 3552 * 802.11 MPDU is received from the hardware.
3552 */ 3553 */
3553void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb) 3554void ieee80211_rx_napi(struct ieee80211_hw *hw, struct sk_buff *skb,
3555 struct napi_struct *napi)
3554{ 3556{
3555 struct ieee80211_local *local = hw_to_local(hw); 3557 struct ieee80211_local *local = hw_to_local(hw);
3556 struct ieee80211_rate *rate = NULL; 3558 struct ieee80211_rate *rate = NULL;
@@ -3649,7 +3651,7 @@ void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb)
3649 ieee80211_tpt_led_trig_rx(local, 3651 ieee80211_tpt_led_trig_rx(local,
3650 ((struct ieee80211_hdr *)skb->data)->frame_control, 3652 ((struct ieee80211_hdr *)skb->data)->frame_control,
3651 skb->len); 3653 skb->len);
3652 __ieee80211_rx_handle_packet(hw, skb); 3654 __ieee80211_rx_handle_packet(hw, skb, napi);
3653 3655
3654 rcu_read_unlock(); 3656 rcu_read_unlock();
3655 3657
@@ -3657,7 +3659,7 @@ void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb)
3657 drop: 3659 drop:
3658 kfree_skb(skb); 3660 kfree_skb(skb);
3659} 3661}
3660EXPORT_SYMBOL(ieee80211_rx); 3662EXPORT_SYMBOL(ieee80211_rx_napi);
3661 3663
3662/* This is a version of the rx handler that can be called from hard irq 3664/* This is a version of the rx handler that can be called from hard irq
3663 * context. Post the skb on the queue and schedule the tasklet */ 3665 * context. Post the skb on the queue and schedule the tasklet */