mt76: testmode: add a limit for queued tx_frames packets
authorFelix Fietkau <nbd@nbd.name>
Tue, 8 Sep 2020 17:12:22 +0000 (19:12 +0200)
committerFelix Fietkau <nbd@nbd.name>
Thu, 24 Sep 2020 16:10:17 +0000 (18:10 +0200)
This avoids running out of available tx tokens

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

index f6fd515..a38abb6 100644 (file)
@@ -33,7 +33,8 @@ void mt76_testmode_tx_pending(struct mt76_dev *dev)
 
        spin_lock_bh(&q->lock);
 
-       while (td->tx_pending > 0 && q->queued < q->ndesc / 2) {
+       while (td->tx_pending > 0 && td->tx_queued - td->tx_done < 1000 &&
+              q->queued < q->ndesc / 2) {
                int ret;
 
                ret = dev->queue_ops->tx_queue_skb(dev, qid, skb_get(skb), wcid, NULL);