History

mac80211: Move reorder-sensitive TX handlers to after TXQ dequeue

The TXQ intermediate queues can cause packet reordering when more than one flow is active to a single station. Since some of the wifi-specific packet handling (notably sequence number and encryption handling) is sensitive to re-ordering, things break if they are applied before the TXQ. This splits up the TX handlers and fast_xmit logic into two parts: An early part and a late part. The former is applied before TXQ enqueue, and the latter after dequeue. The non-TXQ path just applies both parts at once. Because fragments shouldn't be split up or reordered, the fragmentation handler is run after dequeue. Any fragments are then kept in the TXQ and on subsequent dequeues they take precedence over dequeueing from the FQ structure. This approach avoids having to scatter special cases all over the place for when TXQ is enabled, at the cost of making the fast_xmit and TX handler code slightly more complex.

Toke Høiland-Jørgensen committed 10 years ago

Commit bb42f2d1 parent 3a537316 files · +230 −90Browse files

Unified · Split

6 files
  1. include/net/mac80211.h +2 −0
  2. net/mac80211/ieee80211_i.h +9 −0
  3. net/mac80211/rx.c +1 −3
  4. net/mac80211/sta_info.c +3 −7
  5. net/mac80211/tx.c +206 −78
  6. net/mac80211/util.c +9 −2
include/net/mac80211.h+2−0
@@ -715,6 +715,7 @@ enum mac80211_tx_info_flags { · 714 unmodified lines
715715 * frame (PS-Poll or uAPSD).
716716 * @IEEE80211_TX_CTRL_RATE_INJECT: This frame is injected with rate information
717717 * @IEEE80211_TX_CTRL_AMSDU: This frame is an A-MSDU frame
718+ * @IEEE80211_TX_CTRL_FAST_XMIT: This frame is going through the fast_xmit path
718719 *
719720 * These flags are used in tx_info->control.flags.
720721 */
@@ -723,6 +724,7 @@ enum mac80211_tx_control_flags { · 2 unmodified lines
723724 IEEE80211_TX_CTRL_PS_RESPONSE = BIT(1),
724725 IEEE80211_TX_CTRL_RATE_INJECT = BIT(2),
725726 IEEE80211_TX_CTRL_AMSDU = BIT(3),
727+ IEEE80211_TX_CTRL_FAST_XMIT = BIT(4),
726728 };
727729
728730 /*
net/mac80211/ieee80211_i.h+9−0
@@ -815,12 +815,14 @@ enum txq_info_flags { · 814 unmodified lines
815815 * @def_flow: used as a fallback flow when a packet destined to @tin hashes to
816816 * a fq_flow which is already owned by a different tin
817817 * @def_cvars: codel vars for @def_flow
818+ * @frags: used to keep fragments created after dequeue
818819 */
819820 struct txq_info {
820821 struct fq_tin tin;
821822 struct fq_flow def_flow;
822823 struct codel_vars def_cvars;
823824 struct codel_stats cstats;
825+ struct sk_buff_head frags;
824826 unsigned long flags;
825827
826828 /* keep last! */
@@ -1498,6 +1500,13 @@ static inline struct txq_info *to_txq_info(struct ieee80211_txq *txq) · 671 unmodified lines
14981500 return container_of(txq, struct txq_info, txq);
14991501 }
15001502
1503+static inline bool txq_has_queue(struct ieee80211_txq *txq)
1504+{
1505+ struct txq_info *txqi = to_txq_info(txq);
1506+
1507+ return !(skb_queue_empty(&txqi->frags) && !txqi->tin.backlog_packets);
1508+}
1509+
15011510 static inline int ieee80211_bssid_match(const u8 *raddr, const u8 *addr)
15021511 {
15031512 return ether_addr_equal(raddr, addr) ||
net/mac80211/rx.c+1−3
@@ -1323,9 +1323,7 @@ static void sta_ps_start(struct sta_info *sta) · 1322 unmodified lines
13231323 return;
13241324
13251325 for (tid = 0; tid < ARRAY_SIZE(sta->sta.txq); tid++) {
1326− struct txq_info *txqi = to_txq_info(sta->sta.txq[tid]);
1327−
1328− if (txqi->tin.backlog_packets)
1326+ if (txq_has_queue(sta->sta.txq[tid]))
13291327 set_bit(tid, &sta->txq_buffered_tids);
13301328 else
13311329 clear_bit(tid, &sta->txq_buffered_tids);
net/mac80211/sta_info.c+3−7
@@ -1212,12 +1212,10 @@ void ieee80211_sta_ps_deliver_wakeup(struct sta_info *sta) · 1211 unmodified lines
12121212
12131213 if (sta->sta.txq[0]) {
12141214 for (i = 0; i < ARRAY_SIZE(sta->sta.txq); i++) {
1215− struct txq_info *txqi = to_txq_info(sta->sta.txq[i]);
1216−
1217− if (!txqi->tin.backlog_packets)
1215+ if (!txq_has_queue(sta->sta.txq[i]))
12181216 continue;
12191217
1220− drv_wake_tx_queue(local, txqi);
1218+ drv_wake_tx_queue(local, to_txq_info(sta->sta.txq[i]));
12211219 }
12221220 }
12231221
@@ -1649,9 +1647,7 @@ ieee80211_sta_ps_deliver_response(struct sta_info *sta, · 425 unmodified lines
16491647 return;
16501648
16511649 for (tid = 0; tid < ARRAY_SIZE(sta->sta.txq); tid++) {
1652− struct txq_info *txqi = to_txq_info(sta->sta.txq[tid]);
1653−
1654− if (!(tids & BIT(tid)) || txqi->tin.backlog_packets)
1650+ if (!(tids & BIT(tid)) || txq_has_queue(sta->sta.txq[tid]))
16551651 continue;
16561652
16571653 sta_info_recalc_tim(sta);
net/mac80211/tx.c+206−78
@@ -853,8 +853,7 @@ ieee80211_tx_h_sequence(struct ieee80211_tx_data *tx) · 852 unmodified lines
853853 tid = *qc & IEEE80211_QOS_CTL_TID_MASK;
854854 tx->sta->tx_stats.msdu[tid]++;
855855
856− if (!tx->sta->sta.txq[0])
857− hdr->seq_ctrl = ieee80211_tx_next_seq(tx->sta, tid);
856+ hdr->seq_ctrl = ieee80211_tx_next_seq(tx->sta, tid);
858857
859858 return TX_CONTINUE;
860859 }
@@ -1404,6 +1403,7 @@ void ieee80211_txq_init(struct ieee80211_sub_if_data *sdata, · 543 unmodified lines
14041403 fq_flow_init(&txqi->def_flow);
14051404 codel_vars_init(&txqi->def_cvars);
14061405 codel_stats_init(&txqi->cstats);
1406+ __skb_queue_head_init(&txqi->frags);
14071407
14081408 txqi->txq.vif = &sdata->vif;
14091409
@@ -1426,6 +1426,7 @@ void ieee80211_txq_purge(struct ieee80211_local *local, · 16 unmodified lines
14261426 struct fq_tin *tin = &txqi->tin;
14271427
14281428 fq_tin_reset(fq, tin, fq_skb_free_func);
1429+ ieee80211_purge_tx_queue(&local->hw, &txqi->frags);
14291430 }
14301431
14311432 int ieee80211_txq_setup_flows(struct ieee80211_local *local)
@@ -1495,6 +1496,47 @@ void ieee80211_txq_teardown_flows(struct ieee80211_local *local) · 63 unmodified lines
14951496 spin_unlock_bh(&fq->lock);
14961497 }
14971498
1499+static bool ieee80211_queue_skb(struct ieee80211_local *local,
1500+ struct ieee80211_sub_if_data *sdata,
1501+ struct sta_info *sta,
1502+ struct sk_buff *skb)
1503+{
1504+ struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
1505+ struct fq *fq = &local->fq;
1506+ struct ieee80211_vif *vif;
1507+ struct txq_info *txqi;
1508+ struct ieee80211_sta *pubsta;
1509+
1510+ if (!local->ops->wake_tx_queue ||
1511+ sdata->vif.type == NL80211_IFTYPE_MONITOR)
1512+ return false;
1513+
1514+ if (sta && sta->uploaded)
1515+ pubsta = &sta->sta;
1516+ else
1517+ pubsta = NULL;
1518+
1519+ if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
1520+ sdata = container_of(sdata->bss,
1521+ struct ieee80211_sub_if_data, u.ap);
1522+
1523+ vif = &sdata->vif;
1524+ txqi = ieee80211_get_txq(local, vif, pubsta, skb);
1525+
1526+ if (!txqi)
1527+ return false;
1528+
1529+ info->control.vif = vif;
1530+
1531+ spin_lock_bh(&fq->lock);
1532+ ieee80211_txq_enqueue(local, txqi, skb);
1533+ spin_unlock_bh(&fq->lock);
1534+
1535+ drv_wake_tx_queue(local, txqi);
1536+
1537+ return true;
1538+}
1539+
14981540 static bool ieee80211_tx_frags(struct ieee80211_local *local,
14991541 struct ieee80211_vif *vif,
15001542 struct ieee80211_sta *sta,
@@ -1502,9 +1544,7 @@ static bool ieee80211_tx_frags(struct ieee80211_local *local, · 1 unmodified line
15021544 bool txpending)
15031545 {
15041546 struct ieee80211_tx_control control = {};
1505− struct fq *fq = &local->fq;
15061547 struct sk_buff *skb, *tmp;
1507− struct txq_info *txqi;
15081548 unsigned long flags;
15091549
15101550 skb_queue_walk_safe(skbs, skb, tmp) {
@@ -1519,21 +1559,6 @@ static bool ieee80211_tx_frags(struct ieee80211_local *local, · 8 unmodified lines
15191559 }
15201560 #endif
15211561
1522− txqi = ieee80211_get_txq(local, vif, sta, skb);
1523− if (txqi) {
1524− info->control.vif = vif;
1525−
1526− __skb_unlink(skb, skbs);
1527−
1528− spin_lock_bh(&fq->lock);
1529− ieee80211_txq_enqueue(local, txqi, skb);
1530− spin_unlock_bh(&fq->lock);
1531−
1532− drv_wake_tx_queue(local, txqi);
1533−
1534− continue;
1535− }
1536−
15371562 spin_lock_irqsave(&local->queue_stop_reason_lock, flags);
15381563 if (local->queue_stop_reasons[q] ||
15391564 (!txpending && !skb_queue_empty(&local->pending[q]))) {
@@ -1654,10 +1679,13 @@ static bool __ieee80211_tx(struct ieee80211_local *local, · 114 unmodified lines
16541679 /*
16551680 * Invoke TX handlers, return 0 on success and non-zero if the
16561681 * frame was dropped or queued.
1682+ *
1683+ * The handlers are split into an early and late part. The latter is everything
1684+ * that can be sensitive to reordering, and will be deferred to after packets
1685+ * are dequeued from the intermediate queues (when they are enabled).
16571686 */
1658−static int invoke_tx_handlers(struct ieee80211_tx_data *tx)
1687+static int invoke_tx_handlers_early(struct ieee80211_tx_data *tx)
16591688 {
1660− struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb);
16611689 ieee80211_tx_result res = TX_DROP;
16621690
16631691 #define CALL_TXH(txh) \
@@ -1675,6 +1703,31 @@ static int invoke_tx_handlers(struct ieee80211_tx_data *tx) · 11 unmodified lines
16751703 if (!ieee80211_hw_check(&tx->local->hw, HAS_RATE_CONTROL))
16761704 CALL_TXH(ieee80211_tx_h_rate_ctrl);
16771705
1706+ txh_done:
1707+ if (unlikely(res == TX_DROP)) {
1708+ I802_DEBUG_INC(tx->local->tx_handlers_drop);
1709+ if (tx->skb)
1710+ ieee80211_free_txskb(&tx->local->hw, tx->skb);
1711+ else
1712+ ieee80211_purge_tx_queue(&tx->local->hw, &tx->skbs);
1713+ return -1;
1714+ } else if (unlikely(res == TX_QUEUED)) {
1715+ I802_DEBUG_INC(tx->local->tx_handlers_queued);
1716+ return -1;
1717+ }
1718+
1719+ return 0;
1720+}
1721+
1722+/*
1723+ * Late handlers can be called while the sta lock is held. Handlers that can
1724+ * cause packets to be generated will cause deadlock!
1725+ */
1726+static int invoke_tx_handlers_late(struct ieee80211_tx_data *tx)
1727+{
1728+ struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb);
1729+ ieee80211_tx_result res = TX_CONTINUE;
1730+
16781731 if (unlikely(info->flags & IEEE80211_TX_INTFL_RETRANSMISSION)) {
16791732 __skb_queue_tail(&tx->skbs, tx->skb);
16801733 tx->skb = NULL;
@@ -1707,6 +1760,15 @@ static int invoke_tx_handlers(struct ieee80211_tx_data *tx) · 26 unmodified lines
17071760 return 0;
17081761 }
17091762
1763+static int invoke_tx_handlers(struct ieee80211_tx_data *tx)
1764+{
1765+ int r = invoke_tx_handlers_early(tx);
1766+
1767+ if (r)
1768+ return r;
1769+ return invoke_tx_handlers_late(tx);
1770+}
1771+
17101772 bool ieee80211_tx_prepare_skb(struct ieee80211_hw *hw,
17111773 struct ieee80211_vif *vif, struct sk_buff *skb,
17121774 int band, struct ieee80211_sta **sta)
@@ -1781,7 +1843,13 @@ static bool ieee80211_tx(struct ieee80211_sub_if_data *sdata, · 68 unmodified lines
17811843 info->hw_queue =
17821844 sdata->vif.hw_queue[skb_get_queue_mapping(skb)];
17831845
1784− if (!invoke_tx_handlers(&tx))
1846+ if (invoke_tx_handlers_early(&tx))
1847+ return false;
1848+
1849+ if (ieee80211_queue_skb(local, sdata, tx.sta, tx.skb))
1850+ return true;
1851+
1852+ if (!invoke_tx_handlers_late(&tx))
17851853 result = __ieee80211_tx(local, &tx.skbs, led_len,
17861854 tx.sta, txpending);
17871855
@@ -3125,8 +3193,71 @@ out: · 1337 unmodified lines
31253193 return ret;
31263194 }
31273195
3196+/*
3197+ * Can be called while the sta lock is held. Anything that can cause packets to
3198+ * be generated will cause deadlock!
3199+ */
3200+static void ieee80211_xmit_fast_finish(struct ieee80211_sub_if_data *sdata,
3201+ struct sta_info *sta, u8 pn_offs,
3202+ struct ieee80211_key *key,
3203+ struct sk_buff *skb)
3204+{
3205+ struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
3206+ struct ieee80211_hdr *hdr = (void *)skb->data;
3207+ u8 tid = IEEE80211_NUM_TIDS;
3208+
3209+ if (key)
3210+ info->control.hw_key = &key->conf;
3211+
3212+ ieee80211_tx_stats(skb->dev, skb->len);
3213+
3214+ if (hdr->frame_control & cpu_to_le16(IEEE80211_STYPE_QOS_DATA)) {
3215+ tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK;
3216+ *ieee80211_get_qos_ctl(hdr) = tid;
3217+ hdr->seq_ctrl = ieee80211_tx_next_seq(sta, tid);
3218+ } else {
3219+ info->flags |= IEEE80211_TX_CTL_ASSIGN_SEQ;
3220+ hdr->seq_ctrl = cpu_to_le16(sdata->sequence_number);
3221+ sdata->sequence_number += 0x10;
3222+ }
3223+
3224+ if (skb_shinfo(skb)->gso_size)
3225+ sta->tx_stats.msdu[tid] +=
3226+ DIV_ROUND_UP(skb->len, skb_shinfo(skb)->gso_size);
3227+ else
3228+ sta->tx_stats.msdu[tid]++;
3229+
3230+ info->hw_queue = sdata->vif.hw_queue[skb_get_queue_mapping(skb)];
3231+
3232+ /* statistics normally done by ieee80211_tx_h_stats (but that
3233+ * has to consider fragmentation, so is more complex)
3234+ */
3235+ sta->tx_stats.bytes[skb_get_queue_mapping(skb)] += skb->len;
3236+ sta->tx_stats.packets[skb_get_queue_mapping(skb)]++;
3237+
3238+ if (pn_offs) {
3239+ u64 pn;
3240+ u8 *crypto_hdr = skb->data + pn_offs;
3241+
3242+ switch (key->conf.cipher) {
3243+ case WLAN_CIPHER_SUITE_CCMP:
3244+ case WLAN_CIPHER_SUITE_CCMP_256:
3245+ case WLAN_CIPHER_SUITE_GCMP:
3246+ case WLAN_CIPHER_SUITE_GCMP_256:
3247+ pn = atomic64_inc_return(&key->conf.tx_pn);
3248+ crypto_hdr[0] = pn;
3249+ crypto_hdr[1] = pn >> 8;
3250+ crypto_hdr[4] = pn >> 16;
3251+ crypto_hdr[5] = pn >> 24;
3252+ crypto_hdr[6] = pn >> 32;
3253+ crypto_hdr[7] = pn >> 40;
3254+ break;
3255+ }
3256+ }
3257+}
3258+
31283259 static bool ieee80211_xmit_fast(struct ieee80211_sub_if_data *sdata,
3129− struct net_device *dev, struct sta_info *sta,
3260+ struct sta_info *sta,
31303261 struct ieee80211_fast_tx *fast_tx,
31313262 struct sk_buff *skb)
31323263 {
@@ -3177,8 +3308,6 @@ static bool ieee80211_xmit_fast(struct ieee80211_sub_if_data *sdata, · 44 unmodified lines
31773308 return true;
31783309 }
31793310
3180− ieee80211_tx_stats(dev, skb->len + extra_head);
3181−
31823311 if ((hdr->frame_control & cpu_to_le16(IEEE80211_STYPE_QOS_DATA)) &&
31833312 ieee80211_amsdu_aggregate(sdata, sta, fast_tx, skb))
31843313 return true;
@@ -3207,24 +3336,7 @@ static bool ieee80211_xmit_fast(struct ieee80211_sub_if_data *sdata, · 22 unmodified lines
32073336 info->flags = IEEE80211_TX_CTL_FIRST_FRAGMENT |
32083337 IEEE80211_TX_CTL_DONTFRAG |
32093338 (tid_tx ? IEEE80211_TX_CTL_AMPDU : 0);
3210−
3211− if (hdr->frame_control & cpu_to_le16(IEEE80211_STYPE_QOS_DATA)) {
3212− *ieee80211_get_qos_ctl(hdr) = tid;
3213− if (!sta->sta.txq[0])
3214− hdr->seq_ctrl = ieee80211_tx_next_seq(sta, tid);
3215− } else {
3216− info->flags |= IEEE80211_TX_CTL_ASSIGN_SEQ;
3217− hdr->seq_ctrl = cpu_to_le16(sdata->sequence_number);
3218− sdata->sequence_number += 0x10;
3219− }
3220−
3221− if (skb_shinfo(skb)->gso_size)
3222− sta->tx_stats.msdu[tid] +=
3223− DIV_ROUND_UP(skb->len, skb_shinfo(skb)->gso_size);
3224− else
3225− sta->tx_stats.msdu[tid]++;
3226−
3227− info->hw_queue = sdata->vif.hw_queue[skb_get_queue_mapping(skb)];
3339+ info->control.flags = IEEE80211_TX_CTRL_FAST_XMIT;
32283340
32293341 __skb_queue_head_init(&tx.skbs);
32303342
@@ -3234,9 +3346,6 @@ static bool ieee80211_xmit_fast(struct ieee80211_sub_if_data *sdata, · 3 unmodified lines
32343346 tx.sta = sta;
32353347 tx.key = fast_tx->key;
32363348
3237− if (fast_tx->key)
3238− info->control.hw_key = &fast_tx->key->conf;
3239−
32403349 if (!ieee80211_hw_check(&local->hw, HAS_RATE_CONTROL)) {
32413350 tx.skb = skb;
32423351 r = ieee80211_tx_h_rate_ctrl(&tx);
@@ -3250,31 +3359,11 @@ static bool ieee80211_xmit_fast(struct ieee80211_sub_if_data *sdata, · 7 unmodified lines
32503359 }
32513360 }
32523361
3253− /* statistics normally done by ieee80211_tx_h_stats (but that
3254− * has to consider fragmentation, so is more complex)
3255− */
3256− sta->tx_stats.bytes[skb_get_queue_mapping(skb)] += skb->len;
3257− sta->tx_stats.packets[skb_get_queue_mapping(skb)]++;
3362+ if (ieee80211_queue_skb(local, sdata, sta, skb))
3363+ return true;
32583364
3259− if (fast_tx->pn_offs) {
3260− u64 pn;
3261− u8 *crypto_hdr = skb->data + fast_tx->pn_offs;
3262−
3263− switch (fast_tx->key->conf.cipher) {
3264− case WLAN_CIPHER_SUITE_CCMP:
3265− case WLAN_CIPHER_SUITE_CCMP_256:
3266− case WLAN_CIPHER_SUITE_GCMP:
3267− case WLAN_CIPHER_SUITE_GCMP_256:
3268− pn = atomic64_inc_return(&fast_tx->key->conf.tx_pn);
3269− crypto_hdr[0] = pn;
3270− crypto_hdr[1] = pn >> 8;
3271− crypto_hdr[4] = pn >> 16;
3272− crypto_hdr[5] = pn >> 24;
3273− crypto_hdr[6] = pn >> 32;
3274− crypto_hdr[7] = pn >> 40;
3275− break;
3276− }
3277− }
3365+ ieee80211_xmit_fast_finish(sdata, sta, fast_tx->pn_offs,
3366+ fast_tx->key, skb);
32783367
32793368 if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
32803369 sdata = container_of(sdata->bss,
@@ -3294,12 +3383,21 @@ struct sk_buff *ieee80211_tx_dequeue(struct ieee80211_hw *hw, · 13 unmodified lines
32943383 struct sk_buff *skb = NULL;
32953384 struct fq *fq = &local->fq;
32963385 struct fq_tin *tin = &txqi->tin;
3386+ struct ieee80211_tx_info *info;
3387+ struct ieee80211_tx_data tx;
3388+ ieee80211_tx_result r;
32973389
32983390 spin_lock_bh(&fq->lock);
32993391
33003392 if (test_bit(IEEE80211_TXQ_STOP, &txqi->flags))
33013393 goto out;
33023394
3395+ /* Make sure fragments stay together. */
3396+ skb = __skb_dequeue(&txqi->frags);
3397+ if (skb)
3398+ goto out;
3399+
3400+begin:
33033401 skb = fq_tin_dequeue(fq, tin, fq_tin_dequeue_func);
33043402 if (!skb)
33053403 goto out;
@@ -3307,16 +3405,46 @@ struct sk_buff *ieee80211_tx_dequeue(struct ieee80211_hw *hw, · 1 unmodified line
33073405 ieee80211_set_skb_vif(skb, txqi);
33083406
33093407 hdr = (struct ieee80211_hdr *)skb->data;
3310− if (txq->sta && ieee80211_is_data_qos(hdr->frame_control)) {
3408+ info = IEEE80211_SKB_CB(skb);
3409+
3410+ memset(&tx, 0, sizeof(tx));
3411+ __skb_queue_head_init(&tx.skbs);
3412+ tx.local = local;
3413+ tx.skb = skb;
3414+ tx.sdata = vif_to_sdata(info->control.vif);
3415+
3416+ if (txq->sta)
3417+ tx.sta = container_of(txq->sta, struct sta_info, sta);
3418+
3419+ /*
3420+ * The key can be removed while the packet was queued, so need to call
3421+ * this here to get the current key.
3422+ */
3423+ r = ieee80211_tx_h_select_key(&tx);
3424+ if (r != TX_CONTINUE) {
3425+ ieee80211_free_txskb(&local->hw, skb);
3426+ goto begin;
3427+ }
3428+
3429+ if (info->control.flags & IEEE80211_TX_CTRL_FAST_XMIT) {
33113430 struct sta_info *sta = container_of(txq->sta, struct sta_info,
33123431 sta);
3313− struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
3432+ u8 pn_offs = 0;
33143433
3315− hdr->seq_ctrl = ieee80211_tx_next_seq(sta, txq->tid);
3316− if (test_bit(IEEE80211_TXQ_AMPDU, &txqi->flags))
3317− info->flags |= IEEE80211_TX_CTL_AMPDU;
3318− else
3319− info->flags &= ~IEEE80211_TX_CTL_AMPDU;
3434+ if (tx.key &&
3435+ (tx.key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV))
3436+ pn_offs = ieee80211_hdrlen(hdr->frame_control);
3437+
3438+ ieee80211_xmit_fast_finish(sta->sdata, sta, pn_offs,
3439+ tx.key, skb);
3440+ } else {
3441+ if (invoke_tx_handlers_late(&tx))
3442+ goto begin;
3443+
3444+ skb = __skb_dequeue(&tx.skbs);
3445+
3446+ if (!skb_queue_empty(&tx.skbs))
3447+ skb_queue_splice_tail(&tx.skbs, &txqi->frags);
33203448 }
33213449
33223450 out:
@@ -3354,7 +3482,7 @@ void __ieee80211_subif_start_xmit(struct sk_buff *skb, · 31 unmodified lines
33543482 fast_tx = rcu_dereference(sta->fast_tx);
33553483
33563484 if (fast_tx &&
3357− ieee80211_xmit_fast(sdata, dev, sta, fast_tx, skb))
3485+ ieee80211_xmit_fast(sdata, sta, fast_tx, skb))
33583486 goto out;
33593487 }
33603488
net/mac80211/util.c+9−2
@@ -3441,11 +3441,18 @@ void ieee80211_txq_get_depth(struct ieee80211_txq *txq, · 3440 unmodified lines
34413441 unsigned long *byte_cnt)
34423442 {
34433443 struct txq_info *txqi = to_txq_info(txq);
3444+ u32 frag_cnt = 0, frag_bytes = 0;
3445+ struct sk_buff *skb;
3446+
3447+ skb_queue_walk(&txqi->frags, skb) {
3448+ frag_cnt++;
3449+ frag_bytes += skb->len;
3450+ }
34443451
34453452 if (frame_cnt)
3446− *frame_cnt = txqi->tin.backlog_packets;
3453+ *frame_cnt = txqi->tin.backlog_packets + frag_cnt;
34473454
34483455 if (byte_cnt)
3449− *byte_cnt = txqi->tin.backlog_bytes;
3456+ *byte_cnt = txqi->tin.backlog_bytes + frag_bytes;
34503457 }
34513458 EXPORT_SYMBOL(ieee80211_txq_get_depth);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t