From 688d708a43dd8e4488b429ddeab68e72b598ba6e Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 13 Mar 2019 20:18:56 +0100 Subject: [PATCH] mt76: only schedule txqs from the tx tasklet Reduces lock contention from the tx path and improves performance Signed-off-by: Felix Fietkau --- dma.c | 2 -- mt7603/dma.c | 2 ++ mt76x02_mmio.c | 3 +++ tx.c | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dma.c b/dma.c index fe0aec74..ce34af31 100644 --- a/dma.c +++ b/dma.c @@ -205,8 +205,6 @@ mt76_dma_tx_cleanup(struct mt76_dev *dev, enum mt76_txq_id qid, bool flush) spin_unlock_bh(&q->lock); - if (!flush) - mt76_txq_schedule(dev, qid); if (wake) ieee80211_wake_queue(dev->hw, qid); } diff --git a/mt7603/dma.c b/mt7603/dma.c index f7e3566c..27e2d9f9 100644 --- a/mt7603/dma.c +++ b/mt7603/dma.c @@ -145,6 +145,8 @@ mt7603_tx_tasklet(unsigned long data) for (i = MT_TXQ_MCU; i >= 0; i--) mt76_queue_tx_cleanup(dev, i, false); + mt76_txq_schedule_all(&dev->mt76); + mt7603_irq_enable(dev, MT_INT_TX_DONE_ALL); } diff --git a/mt76x02_mmio.c b/mt76x02_mmio.c index 6cc307d9..74edd3af 100644 --- a/mt76x02_mmio.c +++ b/mt76x02_mmio.c @@ -211,6 +211,9 @@ static void mt76x02_tx_tasklet(unsigned long data) mt76_queue_tx_cleanup(dev, i, false); mt76x02_mac_poll_tx_status(dev, false); + + mt76_txq_schedule_all(&dev->mt76); + mt76x02_irq_enable(dev, MT_INT_TX_DONE_ALL); } diff --git a/tx.c b/tx.c index 534ad9fb..60bbb656 100644 --- a/tx.c +++ b/tx.c @@ -594,7 +594,7 @@ void mt76_wake_tx_queue(struct ieee80211_hw *hw, struct ieee80211_txq *txq) if (!test_bit(MT76_STATE_RUNNING, &dev->state)) return; - mt76_txq_schedule(dev, txq->ac); + tasklet_schedule(&dev->tx_tasklet); } EXPORT_SYMBOL_GPL(mt76_wake_tx_queue);