mt76: only schedule txqs from the tx tasklet
authorFelix Fietkau <nbd@nbd.name>
Wed, 13 Mar 2019 19:18:56 +0000 (20:18 +0100)
committerFelix Fietkau <nbd@nbd.name>
Wed, 1 May 2019 11:03:58 +0000 (13:03 +0200)
Reduces lock contention from the tx path and improves performance

Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/dma.c
drivers/net/wireless/mediatek/mt76/mt7603/dma.c
drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c
drivers/net/wireless/mediatek/mt76/tx.c

index e4a5b34915bfddd194b78f0fb31dc5eade142752..5c592566acbbf741b9ecae9de77dabd6cb93625c 100644 (file)
@@ -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);
 }
index f7e3566c96fd00b45332c8cb8e5e03c6de8aca79..27e2d9f905533566af87ca04b7506789aefead8d 100644 (file)
@@ -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);
 }
 
index 958b2a3e48786538ba8ad562ac5d0545d196c929..af308c0ef39538a195555e02067906e420a3dd16 100644 (file)
@@ -162,6 +162,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);
 }
 
index dd0c583ab5b13a7f05e598591c4965f248f10f3f..638b83903c56e6f890e1b5c2e640425d91d24e98 100644 (file)
@@ -595,7 +595,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);