1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Wed, 26 Aug 2020 16:55:54 +0200
3 Subject: [PATCH] net: ethernet: mtk_eth_soc: fix unnecessary tx queue
6 When running short on descriptors, only stop the queue for the netdev that tx
7 was attempted for. By the time the something tries to send on the other netdev,
8 the ring might have some more room already
10 Signed-off-by: Felix Fietkau <nbd@nbd.name>
13 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
14 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
15 @@ -1147,17 +1147,6 @@ static void mtk_wake_queue(struct mtk_et
19 -static void mtk_stop_queue(struct mtk_eth *eth)
23 - for (i = 0; i < MTK_MAC_COUNT; i++) {
24 - if (!eth->netdev[i])
26 - netif_stop_queue(eth->netdev[i]);
30 static int mtk_start_xmit(struct sk_buff *skb, struct net_device *dev)
32 struct mtk_mac *mac = netdev_priv(dev);
33 @@ -1178,7 +1167,7 @@ static int mtk_start_xmit(struct sk_buff
35 tx_num = mtk_cal_txd_req(skb);
36 if (unlikely(atomic_read(&ring->free_count) <= tx_num)) {
37 - mtk_stop_queue(eth);
38 + netif_stop_queue(dev);
39 netif_err(eth, tx_queued, dev,
40 "Tx Ring full when queue awake!\n");
41 spin_unlock(ð->page_lock);
42 @@ -1204,7 +1193,7 @@ static int mtk_start_xmit(struct sk_buff
45 if (unlikely(atomic_read(&ring->free_count) <= ring->thresh))
46 - mtk_stop_queue(eth);
47 + netif_stop_queue(dev);
49 spin_unlock(ð->page_lock);