67a7e3baed9f4a5494203cfbadfada781ecaf5fc
[openwrt/staging/981213.git] /
1 From 16ef670789b252b221700adc413497ed2f941d8a Mon Sep 17 00:00:00 2001
2 From: Felix Fietkau <nbd@nbd.name>
3 Date: Thu, 22 Apr 2021 22:20:59 -0700
4 Subject: [PATCH] net: ethernet: mtk_eth_soc: remove unnecessary TX queue stops
5
6 When running short on descriptors, only stop the queue for the netdev that
7 tx was attempted for. By the time something tries to send on the other
8 netdev, the ring might have some more room already.
9
10 Signed-off-by: Felix Fietkau <nbd@nbd.name>
11 Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
12 Signed-off-by: David S. Miller <davem@davemloft.net>
13 ---
14 drivers/net/ethernet/mediatek/mtk_eth_soc.c | 15 ++-------------
15 1 file changed, 2 insertions(+), 13 deletions(-)
16
17 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
18 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
19 @@ -1131,17 +1131,6 @@ static void mtk_wake_queue(struct mtk_et
20 }
21 }
22
23 -static void mtk_stop_queue(struct mtk_eth *eth)
24 -{
25 - int i;
26 -
27 - for (i = 0; i < MTK_MAC_COUNT; i++) {
28 - if (!eth->netdev[i])
29 - continue;
30 - netif_stop_queue(eth->netdev[i]);
31 - }
32 -}
33 -
34 static netdev_tx_t mtk_start_xmit(struct sk_buff *skb, struct net_device *dev)
35 {
36 struct mtk_mac *mac = netdev_priv(dev);
37 @@ -1162,7 +1151,7 @@ static netdev_tx_t mtk_start_xmit(struct
38
39 tx_num = mtk_cal_txd_req(skb);
40 if (unlikely(atomic_read(&ring->free_count) <= tx_num)) {
41 - mtk_stop_queue(eth);
42 + netif_stop_queue(dev);
43 netif_err(eth, tx_queued, dev,
44 "Tx Ring full when queue awake!\n");
45 spin_unlock(&eth->page_lock);
46 @@ -1188,7 +1177,7 @@ static netdev_tx_t mtk_start_xmit(struct
47 goto drop;
48
49 if (unlikely(atomic_read(&ring->free_count) <= ring->thresh))
50 - mtk_stop_queue(eth);
51 + netif_stop_queue(dev);
52
53 spin_unlock(&eth->page_lock);
54