mt76: introduce q->stopped parameter
Introduce mt76_queue stopped parameter in order to run ieee80211_wake_queue only when mac80211 queues have been previously stopped and avoid to disable interrupts when it is not necessary Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
parent
4177c5d942
commit
cd44bc40a1
|
@ -180,7 +180,10 @@ mt76_dma_tx_cleanup(struct mt76_dev *dev, enum mt76_txq_id qid, bool flush)
|
|||
else
|
||||
mt76_dma_sync_idx(dev, q);
|
||||
|
||||
wake = wake && qid < IEEE80211_NUM_ACS && q->queued < q->ndesc - 8;
|
||||
wake = wake && q->stopped &&
|
||||
qid < IEEE80211_NUM_ACS && q->queued < q->ndesc - 8;
|
||||
if (wake)
|
||||
q->stopped = false;
|
||||
|
||||
if (!q->queued)
|
||||
wake_up(&dev->tx_wait);
|
||||
|
|
|
@ -126,6 +126,7 @@ struct mt76_queue {
|
|||
int ndesc;
|
||||
int queued;
|
||||
int buf_size;
|
||||
bool stopped;
|
||||
|
||||
u8 buf_offset;
|
||||
u8 hw_idx;
|
||||
|
|
|
@ -289,8 +289,11 @@ mt76_tx(struct mt76_dev *dev, struct ieee80211_sta *sta,
|
|||
dev->queue_ops->tx_queue_skb(dev, q, skb, wcid, sta);
|
||||
dev->queue_ops->kick(dev, q);
|
||||
|
||||
if (q->queued > q->ndesc - 8)
|
||||
if (q->queued > q->ndesc - 8 && !q->stopped) {
|
||||
ieee80211_stop_queue(dev->hw, skb_get_queue_mapping(skb));
|
||||
q->stopped = true;
|
||||
}
|
||||
|
||||
spin_unlock_bh(&q->lock);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mt76_tx);
|
||||
|
|
|
@ -655,7 +655,11 @@ static void mt76u_tx_tasklet(unsigned long data)
|
|||
spin_lock_bh(&q->lock);
|
||||
}
|
||||
mt76_txq_schedule(dev, q);
|
||||
wake = i < IEEE80211_NUM_ACS && q->queued < q->ndesc - 8;
|
||||
|
||||
wake = q->stopped && q->queued < q->ndesc - 8;
|
||||
if (wake)
|
||||
q->stopped = false;
|
||||
|
||||
if (!q->queued)
|
||||
wake_up(&dev->tx_wait);
|
||||
|
||||
|
|
Loading…
Reference in a new issue