ath9k: optimize waking tx queues, slightly improves performance under load
[openwrt/svn-archive/archive.git] / package / mac80211 / patches / 565-ath9k_optimize_queue_wake.patch
1 --- a/drivers/net/wireless/ath/ath9k/xmit.c
2 +++ b/drivers/net/wireless/ath/ath9k/xmit.c
3 @@ -121,13 +121,24 @@ static void ath_txq_unlock_complete(stru
4 {
5 struct sk_buff_head q;
6 struct sk_buff *skb;
7 + int qnum = txq->mac80211_qnum;
8 + bool wake = false;
9
10 __skb_queue_head_init(&q);
11 skb_queue_splice_init(&txq->complete_q, &q);
12 +
13 + if (txq->stopped && txq->pending_frames < ATH_MAX_QDEPTH) {
14 + txq->stopped = false;
15 + wake = true;
16 + }
17 +
18 spin_unlock_bh(&txq->axq_lock);
19
20 while ((skb = __skb_dequeue(&q)))
21 ieee80211_tx_status(sc->hw, skb);
22 +
23 + if (wake)
24 + ieee80211_wake_queue(sc->hw, qnum);
25 }
26
27 static void ath_tx_queue_tid(struct ath_txq *txq, struct ath_atx_tid *tid)
28 @@ -2037,11 +2048,6 @@ static void ath_tx_complete(struct ath_s
29 if (txq == sc->tx.txq_map[q]) {
30 if (WARN_ON(--txq->pending_frames < 0))
31 txq->pending_frames = 0;
32 -
33 - if (txq->stopped && txq->pending_frames < ATH_MAX_QDEPTH) {
34 - ieee80211_wake_queue(sc->hw, q);
35 - txq->stopped = false;
36 - }
37 }
38
39 __skb_queue_tail(&txq->complete_q, skb);