1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Sat, 16 Mar 2019 18:00:12 +0100
3 Subject: [PATCH] mac80211: run late dequeue late tx handlers without
6 Reduces lock contention on enqueue/dequeue of iTXQ packets
8 Signed-off-by: Felix Fietkau <nbd@nbd.name>
11 --- a/net/mac80211/tx.c
12 +++ b/net/mac80211/tx.c
13 @@ -3507,6 +3507,7 @@ struct sk_buff *ieee80211_tx_dequeue(str
14 ieee80211_tx_result r;
15 struct ieee80211_vif *vif = txq->vif;
18 spin_lock_bh(&fq->lock);
20 if (test_bit(IEEE80211_TXQ_STOP, &txqi->flags) ||
21 @@ -3523,11 +3524,12 @@ struct sk_buff *ieee80211_tx_dequeue(str
26 skb = fq_tin_dequeue(fq, tin, fq_tin_dequeue_func);
30 + spin_unlock_bh(&fq->lock);
32 hdr = (struct ieee80211_hdr *)skb->data;
33 info = IEEE80211_SKB_CB(skb);
35 @@ -3591,8 +3593,11 @@ begin:
37 skb = __skb_dequeue(&tx.skbs);
39 - if (!skb_queue_empty(&tx.skbs))
40 + if (!skb_queue_empty(&tx.skbs)) {
41 + spin_lock_bh(&fq->lock);
42 skb_queue_splice_tail(&tx.skbs, &txqi->frags);
43 + spin_unlock_bh(&fq->lock);
47 if (skb && skb_has_frag_list(skb) &&
48 @@ -3631,6 +3636,7 @@ begin:
51 IEEE80211_SKB_CB(skb)->control.vif = vif;
55 spin_unlock_bh(&fq->lock);