f9f9977cee5ef08e8775f01132eb0e136b0c7b12
[openwrt/staging/wigyori.git] /
1 From: Alexander Wetzel <alexander@wetzel-home.de>
2 Date: Sun, 9 Oct 2022 18:30:40 +0200
3 Subject: [PATCH] wifi: mac80211: Drop support for TX push path
4
5 All drivers are now using mac80211 internal queues (iTXQs).
6 Drop mac80211 internal support for the old push path.
7
8 Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
9 Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 ---
11
12 --- a/net/mac80211/cfg.c
13 +++ b/net/mac80211/cfg.c
14 @@ -4346,9 +4346,6 @@ static int ieee80211_get_txq_stats(struc
15 struct ieee80211_sub_if_data *sdata;
16 int ret = 0;
17
18 - if (!local->ops->wake_tx_queue)
19 - return 1;
20 -
21 spin_lock_bh(&local->fq.lock);
22 rcu_read_lock();
23
24 --- a/net/mac80211/debugfs.c
25 +++ b/net/mac80211/debugfs.c
26 @@ -663,9 +663,7 @@ void debugfs_hw_add(struct ieee80211_loc
27 DEBUGFS_ADD_MODE(force_tx_status, 0600);
28 DEBUGFS_ADD_MODE(aql_enable, 0600);
29 DEBUGFS_ADD(aql_pending);
30 -
31 - if (local->ops->wake_tx_queue)
32 - DEBUGFS_ADD_MODE(aqm, 0600);
33 + DEBUGFS_ADD_MODE(aqm, 0600);
34
35 DEBUGFS_ADD_MODE(airtime_flags, 0600);
36
37 --- a/net/mac80211/debugfs_netdev.c
38 +++ b/net/mac80211/debugfs_netdev.c
39 @@ -677,8 +677,7 @@ static void add_common_files(struct ieee
40 DEBUGFS_ADD(rc_rateidx_vht_mcs_mask_5ghz);
41 DEBUGFS_ADD(hw_queues);
42
43 - if (sdata->local->ops->wake_tx_queue &&
44 - sdata->vif.type != NL80211_IFTYPE_P2P_DEVICE &&
45 + if (sdata->vif.type != NL80211_IFTYPE_P2P_DEVICE &&
46 sdata->vif.type != NL80211_IFTYPE_NAN)
47 DEBUGFS_ADD(aqm);
48 }
49 --- a/net/mac80211/debugfs_sta.c
50 +++ b/net/mac80211/debugfs_sta.c
51 @@ -1057,10 +1057,8 @@ void ieee80211_sta_debugfs_add(struct st
52 DEBUGFS_ADD_COUNTER(rx_fragments, deflink.rx_stats.fragments);
53 DEBUGFS_ADD_COUNTER(tx_filtered, deflink.status_stats.filtered);
54
55 - if (local->ops->wake_tx_queue) {
56 - DEBUGFS_ADD(aqm);
57 - DEBUGFS_ADD(airtime);
58 - }
59 + DEBUGFS_ADD(aqm);
60 + DEBUGFS_ADD(airtime);
61
62 if (wiphy_ext_feature_isset(local->hw.wiphy,
63 NL80211_EXT_FEATURE_AQL))
64 --- a/net/mac80211/ieee80211_i.h
65 +++ b/net/mac80211/ieee80211_i.h
66 @@ -2294,7 +2294,6 @@ void ieee80211_wake_queue_by_reason(stru
67 void ieee80211_stop_queue_by_reason(struct ieee80211_hw *hw, int queue,
68 enum queue_stop_reason reason,
69 bool refcounted);
70 -void ieee80211_propagate_queue_wake(struct ieee80211_local *local, int queue);
71 void ieee80211_add_pending_skb(struct ieee80211_local *local,
72 struct sk_buff *skb);
73 void ieee80211_add_pending_skbs(struct ieee80211_local *local,
74 --- a/net/mac80211/iface.c
75 +++ b/net/mac80211/iface.c
76 @@ -460,12 +460,6 @@ static void ieee80211_do_stop(struct iee
77 if (cancel_scan)
78 ieee80211_scan_cancel(local);
79
80 - /*
81 - * Stop TX on this interface first.
82 - */
83 - if (!local->ops->wake_tx_queue && sdata->dev)
84 - netif_tx_stop_all_queues(sdata->dev);
85 -
86 ieee80211_roc_purge(local, sdata);
87
88 switch (sdata->vif.type) {
89 @@ -813,13 +807,6 @@ static void ieee80211_uninit(struct net_
90 ieee80211_teardown_sdata(IEEE80211_DEV_TO_SUB_IF(dev));
91 }
92
93 -static u16 ieee80211_netdev_select_queue(struct net_device *dev,
94 - struct sk_buff *skb,
95 - struct net_device *sb_dev)
96 -{
97 - return ieee80211_select_queue(IEEE80211_DEV_TO_SUB_IF(dev), skb);
98 -}
99 -
100 static void
101 ieee80211_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
102 {
103 @@ -833,7 +820,6 @@ static const struct net_device_ops ieee8
104 .ndo_start_xmit = ieee80211_subif_start_xmit,
105 .ndo_set_rx_mode = ieee80211_set_multicast_list,
106 .ndo_set_mac_address = ieee80211_change_mac,
107 - .ndo_select_queue = ieee80211_netdev_select_queue,
108 .ndo_get_stats64 = ieee80211_get_stats64,
109 };
110
111 @@ -941,7 +927,6 @@ static const struct net_device_ops ieee8
112 .ndo_start_xmit = ieee80211_subif_start_xmit_8023,
113 .ndo_set_rx_mode = ieee80211_set_multicast_list,
114 .ndo_set_mac_address = ieee80211_change_mac,
115 - .ndo_select_queue = ieee80211_netdev_select_queue,
116 .ndo_get_stats64 = ieee80211_get_stats64,
117 .ndo_fill_forward_path = ieee80211_netdev_fill_forward_path,
118 };
119 @@ -1443,35 +1428,6 @@ int ieee80211_do_open(struct wireless_de
120
121 ieee80211_recalc_ps(local);
122
123 - if (sdata->vif.type == NL80211_IFTYPE_MONITOR ||
124 - sdata->vif.type == NL80211_IFTYPE_AP_VLAN ||
125 - local->ops->wake_tx_queue) {
126 - /* XXX: for AP_VLAN, actually track AP queues */
127 - if (dev)
128 - netif_tx_start_all_queues(dev);
129 - } else if (dev) {
130 - unsigned long flags;
131 - int n_acs = IEEE80211_NUM_ACS;
132 - int ac;
133 -
134 - if (local->hw.queues < IEEE80211_NUM_ACS)
135 - n_acs = 1;
136 -
137 - spin_lock_irqsave(&local->queue_stop_reason_lock, flags);
138 - if (sdata->vif.cab_queue == IEEE80211_INVAL_HW_QUEUE ||
139 - (local->queue_stop_reasons[sdata->vif.cab_queue] == 0 &&
140 - skb_queue_empty(&local->pending[sdata->vif.cab_queue]))) {
141 - for (ac = 0; ac < n_acs; ac++) {
142 - int ac_queue = sdata->vif.hw_queue[ac];
143 -
144 - if (local->queue_stop_reasons[ac_queue] == 0 &&
145 - skb_queue_empty(&local->pending[ac_queue]))
146 - netif_start_subqueue(dev, ac);
147 - }
148 - }
149 - spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags);
150 - }
151 -
152 set_bit(SDATA_STATE_RUNNING, &sdata->state);
153
154 return 0;
155 @@ -1501,17 +1457,12 @@ static void ieee80211_if_setup(struct ne
156 {
157 ether_setup(dev);
158 dev->priv_flags &= ~IFF_TX_SKB_SHARING;
159 + dev->priv_flags |= IFF_NO_QUEUE;
160 dev->netdev_ops = &ieee80211_dataif_ops;
161 dev->needs_free_netdev = true;
162 dev->priv_destructor = ieee80211_if_free;
163 }
164
165 -static void ieee80211_if_setup_no_queue(struct net_device *dev)
166 -{
167 - ieee80211_if_setup(dev);
168 - dev->priv_flags |= IFF_NO_QUEUE;
169 -}
170 -
171 static void ieee80211_iface_process_skb(struct ieee80211_local *local,
172 struct ieee80211_sub_if_data *sdata,
173 struct sk_buff *skb)
174 @@ -2096,9 +2047,7 @@ int ieee80211_if_add(struct ieee80211_lo
175 struct net_device *ndev = NULL;
176 struct ieee80211_sub_if_data *sdata = NULL;
177 struct txq_info *txqi;
178 - void (*if_setup)(struct net_device *dev);
179 int ret, i;
180 - int txqs = 1;
181
182 ASSERT_RTNL();
183
184 @@ -2121,30 +2070,18 @@ int ieee80211_if_add(struct ieee80211_lo
185 sizeof(void *));
186 int txq_size = 0;
187
188 - if (local->ops->wake_tx_queue &&
189 - type != NL80211_IFTYPE_AP_VLAN &&
190 + if (type != NL80211_IFTYPE_AP_VLAN &&
191 (type != NL80211_IFTYPE_MONITOR ||
192 (params->flags & MONITOR_FLAG_ACTIVE)))
193 txq_size += sizeof(struct txq_info) +
194 local->hw.txq_data_size;
195
196 - if (local->ops->wake_tx_queue) {
197 - if_setup = ieee80211_if_setup_no_queue;
198 - } else {
199 - if_setup = ieee80211_if_setup;
200 - if (local->hw.queues >= IEEE80211_NUM_ACS)
201 - txqs = IEEE80211_NUM_ACS;
202 - }
203 -
204 ndev = alloc_netdev_mqs(size + txq_size,
205 name, name_assign_type,
206 - if_setup, txqs, 1);
207 + ieee80211_if_setup, 1, 1);
208 if (!ndev)
209 return -ENOMEM;
210
211 - if (!local->ops->wake_tx_queue && local->hw.wiphy->tx_queue_len)
212 - ndev->tx_queue_len = local->hw.wiphy->tx_queue_len;
213 -
214 dev_net_set(ndev, wiphy_net(local->hw.wiphy));
215
216 ndev->tstats = netdev_alloc_pcpu_stats(struct pcpu_sw_netstats);
217 --- a/net/mac80211/main.c
218 +++ b/net/mac80211/main.c
219 @@ -630,7 +630,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_
220
221 if (WARN_ON(!ops->tx || !ops->start || !ops->stop || !ops->config ||
222 !ops->add_interface || !ops->remove_interface ||
223 - !ops->configure_filter))
224 + !ops->configure_filter || !ops->wake_tx_queue))
225 return NULL;
226
227 if (WARN_ON(ops->sta_state && (ops->sta_add || ops->sta_remove)))
228 @@ -719,9 +719,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_
229 if (!ops->set_key)
230 wiphy->flags |= WIPHY_FLAG_IBSS_RSN;
231
232 - if (ops->wake_tx_queue)
233 - wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_TXQS);
234 -
235 + wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_TXQS);
236 wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_RRM);
237
238 wiphy->bss_priv_size = sizeof(struct ieee80211_bss);
239 @@ -834,10 +832,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_
240 atomic_set(&local->agg_queue_stop[i], 0);
241 }
242 tasklet_setup(&local->tx_pending_tasklet, ieee80211_tx_pending);
243 -
244 - if (ops->wake_tx_queue)
245 - tasklet_setup(&local->wake_txqs_tasklet, ieee80211_wake_txqs);
246 -
247 + tasklet_setup(&local->wake_txqs_tasklet, ieee80211_wake_txqs);
248 tasklet_setup(&local->tasklet, ieee80211_tasklet_handler);
249
250 skb_queue_head_init(&local->skb_queue);
251 --- a/net/mac80211/rx.c
252 +++ b/net/mac80211/rx.c
253 @@ -1571,9 +1571,6 @@ static void sta_ps_start(struct sta_info
254
255 ieee80211_clear_fast_xmit(sta);
256
257 - if (!sta->sta.txq[0])
258 - return;
259 -
260 for (tid = 0; tid < IEEE80211_NUM_TIDS; tid++) {
261 struct ieee80211_txq *txq = sta->sta.txq[tid];
262 struct txq_info *txqi = to_txq_info(txq);
263 --- a/net/mac80211/sta_info.c
264 +++ b/net/mac80211/sta_info.c
265 @@ -140,17 +140,15 @@ static void __cleanup_single_sta(struct
266 atomic_dec(&ps->num_sta_ps);
267 }
268
269 - if (sta->sta.txq[0]) {
270 - for (i = 0; i < ARRAY_SIZE(sta->sta.txq); i++) {
271 - struct txq_info *txqi;
272 + for (i = 0; i < ARRAY_SIZE(sta->sta.txq); i++) {
273 + struct txq_info *txqi;
274
275 - if (!sta->sta.txq[i])
276 - continue;
277 + if (!sta->sta.txq[i])
278 + continue;
279
280 - txqi = to_txq_info(sta->sta.txq[i]);
281 + txqi = to_txq_info(sta->sta.txq[i]);
282
283 - ieee80211_txq_purge(local, txqi);
284 - }
285 + ieee80211_txq_purge(local, txqi);
286 }
287
288 for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) {
289 @@ -425,8 +423,7 @@ void sta_info_free(struct ieee80211_loca
290
291 sta_dbg(sta->sdata, "Destroyed STA %pM\n", sta->sta.addr);
292
293 - if (sta->sta.txq[0])
294 - kfree(to_txq_info(sta->sta.txq[0]));
295 + kfree(to_txq_info(sta->sta.txq[0]));
296 kfree(rcu_dereference_raw(sta->sta.rates));
297 #ifdef CPTCFG_MAC80211_MESH
298 kfree(sta->mesh);
299 @@ -527,6 +524,8 @@ __sta_info_alloc(struct ieee80211_sub_if
300 struct ieee80211_local *local = sdata->local;
301 struct ieee80211_hw *hw = &local->hw;
302 struct sta_info *sta;
303 + void *txq_data;
304 + int size;
305 int i;
306
307 sta = kzalloc(sizeof(*sta) + hw->sta_data_size, gfp);
308 @@ -597,21 +596,18 @@ __sta_info_alloc(struct ieee80211_sub_if
309
310 sta->last_connected = ktime_get_seconds();
311
312 - if (local->ops->wake_tx_queue) {
313 - void *txq_data;
314 - int size = sizeof(struct txq_info) +
315 - ALIGN(hw->txq_data_size, sizeof(void *));
316 + size = sizeof(struct txq_info) +
317 + ALIGN(hw->txq_data_size, sizeof(void *));
318
319 - txq_data = kcalloc(ARRAY_SIZE(sta->sta.txq), size, gfp);
320 - if (!txq_data)
321 - goto free;
322 + txq_data = kcalloc(ARRAY_SIZE(sta->sta.txq), size, gfp);
323 + if (!txq_data)
324 + goto free;
325
326 - for (i = 0; i < ARRAY_SIZE(sta->sta.txq); i++) {
327 - struct txq_info *txq = txq_data + i * size;
328 + for (i = 0; i < ARRAY_SIZE(sta->sta.txq); i++) {
329 + struct txq_info *txq = txq_data + i * size;
330
331 - /* might not do anything for the bufferable MMPDU TXQ */
332 - ieee80211_txq_init(sdata, sta, txq, i);
333 - }
334 + /* might not do anything for the (bufferable) MMPDU TXQ */
335 + ieee80211_txq_init(sdata, sta, txq, i);
336 }
337
338 if (sta_prepare_rate_control(local, sta, gfp))
339 @@ -685,8 +681,7 @@ __sta_info_alloc(struct ieee80211_sub_if
340 return sta;
341
342 free_txq:
343 - if (sta->sta.txq[0])
344 - kfree(to_txq_info(sta->sta.txq[0]));
345 + kfree(to_txq_info(sta->sta.txq[0]));
346 free:
347 sta_info_free_link(&sta->deflink);
348 #ifdef CPTCFG_MAC80211_MESH
349 @@ -1960,9 +1955,6 @@ ieee80211_sta_ps_deliver_response(struct
350 * TIM recalculation.
351 */
352
353 - if (!sta->sta.txq[0])
354 - return;
355 -
356 for (tid = 0; tid < ARRAY_SIZE(sta->sta.txq); tid++) {
357 if (!sta->sta.txq[tid] ||
358 !(driver_release_tids & BIT(tid)) ||
359 @@ -2447,7 +2439,7 @@ static void sta_set_tidstats(struct sta_
360 tidstats->tx_msdu_failed = sta->deflink.status_stats.msdu_failed[tid];
361 }
362
363 - if (local->ops->wake_tx_queue && tid < IEEE80211_NUM_TIDS) {
364 + if (tid < IEEE80211_NUM_TIDS) {
365 spin_lock_bh(&local->fq.lock);
366 rcu_read_lock();
367
368 @@ -2775,9 +2767,6 @@ unsigned long ieee80211_sta_last_active(
369
370 static void sta_update_codel_params(struct sta_info *sta, u32 thr)
371 {
372 - if (!sta->sdata->local->ops->wake_tx_queue)
373 - return;
374 -
375 if (thr && thr < STA_SLOW_THRESHOLD * sta->local->num_sta) {
376 sta->cparams.target = MS2TIME(50);
377 sta->cparams.interval = MS2TIME(300);
378 --- a/net/mac80211/tdls.c
379 +++ b/net/mac80211/tdls.c
380 @@ -1016,7 +1016,6 @@ ieee80211_tdls_prep_mgmt_packet(struct w
381 skb->priority = 256 + 5;
382 break;
383 }
384 - skb_set_queue_mapping(skb, ieee80211_select_queue(sdata, skb));
385
386 /*
387 * Set the WLAN_TDLS_TEARDOWN flag to indicate a teardown in progress.
388 --- a/net/mac80211/tx.c
389 +++ b/net/mac80211/tx.c
390 @@ -1600,9 +1600,6 @@ int ieee80211_txq_setup_flows(struct iee
391 bool supp_vht = false;
392 enum nl80211_band band;
393
394 - if (!local->ops->wake_tx_queue)
395 - return 0;
396 -
397 ret = fq_init(fq, 4096);
398 if (ret)
399 return ret;
400 @@ -1650,9 +1647,6 @@ void ieee80211_txq_teardown_flows(struct
401 {
402 struct fq *fq = &local->fq;
403
404 - if (!local->ops->wake_tx_queue)
405 - return;
406 -
407 kfree(local->cvars);
408 local->cvars = NULL;
409
410 @@ -1669,8 +1663,7 @@ static bool ieee80211_queue_skb(struct i
411 struct ieee80211_vif *vif;
412 struct txq_info *txqi;
413
414 - if (!local->ops->wake_tx_queue ||
415 - sdata->vif.type == NL80211_IFTYPE_MONITOR)
416 + if (sdata->vif.type == NL80211_IFTYPE_MONITOR)
417 return false;
418
419 if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
420 @@ -4193,12 +4186,7 @@ void __ieee80211_subif_start_xmit(struct
421 if (IS_ERR(sta))
422 sta = NULL;
423
424 - if (local->ops->wake_tx_queue) {
425 - u16 queue = __ieee80211_select_queue(sdata, sta, skb);
426 - skb_set_queue_mapping(skb, queue);
427 - skb_get_hash(skb);
428 - }
429 -
430 + skb_set_queue_mapping(skb, ieee80211_select_queue(sdata, sta, skb));
431 ieee80211_aggr_check(sdata, sta, skb);
432
433 sk_pacing_shift_update(skb->sk, sdata->local->hw.tx_sk_pacing_shift);
434 @@ -4509,11 +4497,7 @@ static void ieee80211_8023_xmit(struct i
435 struct tid_ampdu_tx *tid_tx;
436 u8 tid;
437
438 - if (local->ops->wake_tx_queue) {
439 - u16 queue = __ieee80211_select_queue(sdata, sta, skb);
440 - skb_set_queue_mapping(skb, queue);
441 - skb_get_hash(skb);
442 - }
443 + skb_set_queue_mapping(skb, ieee80211_select_queue(sdata, sta, skb));
444
445 if (unlikely(test_bit(SCAN_SW_SCANNING, &local->scanning)) &&
446 test_bit(SDATA_STATE_OFFCHANNEL, &sdata->state))
447 @@ -4767,9 +4751,6 @@ void ieee80211_tx_pending(struct tasklet
448 if (!txok)
449 break;
450 }
451 -
452 - if (skb_queue_empty(&local->pending[i]))
453 - ieee80211_propagate_queue_wake(local, i);
454 }
455 spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags);
456
457 @@ -5962,10 +5943,9 @@ int ieee80211_tx_control_port(struct wip
458 }
459
460 if (!IS_ERR(sta)) {
461 - u16 queue = __ieee80211_select_queue(sdata, sta, skb);
462 + u16 queue = ieee80211_select_queue(sdata, sta, skb);
463
464 skb_set_queue_mapping(skb, queue);
465 - skb_get_hash(skb);
466
467 /*
468 * for MLO STA, the SA should be the AP MLD address, but
469 --- a/net/mac80211/util.c
470 +++ b/net/mac80211/util.c
471 @@ -444,39 +444,6 @@ void ieee80211_wake_txqs(struct tasklet_
472 spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags);
473 }
474
475 -void ieee80211_propagate_queue_wake(struct ieee80211_local *local, int queue)
476 -{
477 - struct ieee80211_sub_if_data *sdata;
478 - int n_acs = IEEE80211_NUM_ACS;
479 -
480 - if (local->ops->wake_tx_queue)
481 - return;
482 -
483 - if (local->hw.queues < IEEE80211_NUM_ACS)
484 - n_acs = 1;
485 -
486 - list_for_each_entry_rcu(sdata, &local->interfaces, list) {
487 - int ac;
488 -
489 - if (!sdata->dev)
490 - continue;
491 -
492 - if (sdata->vif.cab_queue != IEEE80211_INVAL_HW_QUEUE &&
493 - local->queue_stop_reasons[sdata->vif.cab_queue] != 0)
494 - continue;
495 -
496 - for (ac = 0; ac < n_acs; ac++) {
497 - int ac_queue = sdata->vif.hw_queue[ac];
498 -
499 - if (ac_queue == queue ||
500 - (sdata->vif.cab_queue == queue &&
501 - local->queue_stop_reasons[ac_queue] == 0 &&
502 - skb_queue_empty(&local->pending[ac_queue])))
503 - netif_wake_subqueue(sdata->dev, ac);
504 - }
505 - }
506 -}
507 -
508 static void __ieee80211_wake_queue(struct ieee80211_hw *hw, int queue,
509 enum queue_stop_reason reason,
510 bool refcounted,
511 @@ -507,11 +474,7 @@ static void __ieee80211_wake_queue(struc
512 /* someone still has this queue stopped */
513 return;
514
515 - if (skb_queue_empty(&local->pending[queue])) {
516 - rcu_read_lock();
517 - ieee80211_propagate_queue_wake(local, queue);
518 - rcu_read_unlock();
519 - } else
520 + if (!skb_queue_empty(&local->pending[queue]))
521 tasklet_schedule(&local->tx_pending_tasklet);
522
523 /*
524 @@ -521,12 +484,10 @@ static void __ieee80211_wake_queue(struc
525 * release someone's lock, but it is fine because all the callers of
526 * __ieee80211_wake_queue call it right before releasing the lock.
527 */
528 - if (local->ops->wake_tx_queue) {
529 - if (reason == IEEE80211_QUEUE_STOP_REASON_DRIVER)
530 - tasklet_schedule(&local->wake_txqs_tasklet);
531 - else
532 - _ieee80211_wake_txqs(local, flags);
533 - }
534 + if (reason == IEEE80211_QUEUE_STOP_REASON_DRIVER)
535 + tasklet_schedule(&local->wake_txqs_tasklet);
536 + else
537 + _ieee80211_wake_txqs(local, flags);
538 }
539
540 void ieee80211_wake_queue_by_reason(struct ieee80211_hw *hw, int queue,
541 @@ -554,8 +515,6 @@ static void __ieee80211_stop_queue(struc
542 bool refcounted)
543 {
544 struct ieee80211_local *local = hw_to_local(hw);
545 - struct ieee80211_sub_if_data *sdata;
546 - int n_acs = IEEE80211_NUM_ACS;
547
548 trace_stop_queue(local, queue, reason);
549
550 @@ -567,27 +526,7 @@ static void __ieee80211_stop_queue(struc
551 else
552 local->q_stop_reasons[queue][reason]++;
553
554 - if (__test_and_set_bit(reason, &local->queue_stop_reasons[queue]))
555 - return;
556 -
557 - if (local->hw.queues < IEEE80211_NUM_ACS)
558 - n_acs = 1;
559 -
560 - rcu_read_lock();
561 - list_for_each_entry_rcu(sdata, &local->interfaces, list) {
562 - int ac;
563 -
564 - if (!sdata->dev)
565 - continue;
566 -
567 - for (ac = 0; ac < n_acs; ac++) {
568 - if (!local->ops->wake_tx_queue &&
569 - (sdata->vif.hw_queue[ac] == queue ||
570 - sdata->vif.cab_queue == queue))
571 - netif_stop_subqueue(sdata->dev, ac);
572 - }
573 - }
574 - rcu_read_unlock();
575 + set_bit(reason, &local->queue_stop_reasons[queue]);
576 }
577
578 void ieee80211_stop_queue_by_reason(struct ieee80211_hw *hw, int queue,
579 --- a/net/mac80211/wme.c
580 +++ b/net/mac80211/wme.c
581 @@ -122,6 +122,9 @@ u16 ieee80211_select_queue_80211(struct
582 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
583 u8 *p;
584
585 + /* Ensure hash is set prior to potential SW encryption */
586 + skb_get_hash(skb);
587 +
588 if ((info->control.flags & IEEE80211_TX_CTRL_DONT_REORDER) ||
589 local->hw.queues < IEEE80211_NUM_ACS)
590 return 0;
591 @@ -141,13 +144,16 @@ u16 ieee80211_select_queue_80211(struct
592 return ieee80211_downgrade_queue(sdata, NULL, skb);
593 }
594
595 -u16 __ieee80211_select_queue(struct ieee80211_sub_if_data *sdata,
596 - struct sta_info *sta, struct sk_buff *skb)
597 +u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata,
598 + struct sta_info *sta, struct sk_buff *skb)
599 {
600 const struct ethhdr *eth = (void *)skb->data;
601 struct mac80211_qos_map *qos_map;
602 bool qos;
603
604 + /* Ensure hash is set prior to potential SW encryption */
605 + skb_get_hash(skb);
606 +
607 /* all mesh/ocb stations are required to support WME */
608 if ((sdata->vif.type == NL80211_IFTYPE_MESH_POINT &&
609 !is_multicast_ether_addr(eth->h_dest)) ||
610 @@ -178,59 +184,6 @@ u16 __ieee80211_select_queue(struct ieee
611 return ieee80211_downgrade_queue(sdata, sta, skb);
612 }
613
614 -
615 -/* Indicate which queue to use. */
616 -u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata,
617 - struct sk_buff *skb)
618 -{
619 - struct ieee80211_local *local = sdata->local;
620 - struct sta_info *sta = NULL;
621 - const u8 *ra = NULL;
622 - u16 ret;
623 -
624 - /* when using iTXQ, we can do this later */
625 - if (local->ops->wake_tx_queue)
626 - return 0;
627 -
628 - if (local->hw.queues < IEEE80211_NUM_ACS || skb->len < 6) {
629 - skb->priority = 0; /* required for correct WPA/11i MIC */
630 - return 0;
631 - }
632 -
633 - rcu_read_lock();
634 - switch (sdata->vif.type) {
635 - case NL80211_IFTYPE_AP_VLAN:
636 - sta = rcu_dereference(sdata->u.vlan.sta);
637 - if (sta)
638 - break;
639 - fallthrough;
640 - case NL80211_IFTYPE_AP:
641 - ra = skb->data;
642 - break;
643 - case NL80211_IFTYPE_STATION:
644 - /* might be a TDLS station */
645 - sta = sta_info_get(sdata, skb->data);
646 - if (sta)
647 - break;
648 -
649 - ra = sdata->deflink.u.mgd.bssid;
650 - break;
651 - case NL80211_IFTYPE_ADHOC:
652 - ra = skb->data;
653 - break;
654 - default:
655 - break;
656 - }
657 -
658 - if (!sta && ra && !is_multicast_ether_addr(ra))
659 - sta = sta_info_get(sdata, ra);
660 -
661 - ret = __ieee80211_select_queue(sdata, sta, skb);
662 -
663 - rcu_read_unlock();
664 - return ret;
665 -}
666 -
667 /**
668 * ieee80211_set_qos_hdr - Fill in the QoS header if there is one.
669 *
670 --- a/net/mac80211/wme.h
671 +++ b/net/mac80211/wme.h
672 @@ -13,10 +13,8 @@
673 u16 ieee80211_select_queue_80211(struct ieee80211_sub_if_data *sdata,
674 struct sk_buff *skb,
675 struct ieee80211_hdr *hdr);
676 -u16 __ieee80211_select_queue(struct ieee80211_sub_if_data *sdata,
677 - struct sta_info *sta, struct sk_buff *skb);
678 u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata,
679 - struct sk_buff *skb);
680 + struct sta_info *sta, struct sk_buff *skb);
681 void ieee80211_set_qos_hdr(struct ieee80211_sub_if_data *sdata,
682 struct sk_buff *skb);
683