21e14ed1e5abe9e3878e7e006a57ce65feeaaf20
[openwrt/staging/jow.git] /
1 From 16769a8923fad5a5377253bcd76b0e0d64976c73 Mon Sep 17 00:00:00 2001
2 From: Felix Fietkau <nbd@nbd.name>
3 Date: Thu, 22 Apr 2021 22:21:05 -0700
4 Subject: [PATCH] net: ethernet: mtk_eth_soc: reduce unnecessary interrupts
5
6 Avoid rearming interrupt if napi_complete returns false
7
8 Signed-off-by: Felix Fietkau <nbd@nbd.name>
9 Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
10 Signed-off-by: David S. Miller <davem@davemloft.net>
11 ---
12 drivers/net/ethernet/mediatek/mtk_eth_soc.c | 9 +++++----
13 1 file changed, 5 insertions(+), 4 deletions(-)
14
15 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
16 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
17 @@ -1519,8 +1519,8 @@ static int mtk_napi_tx(struct napi_struc
18 if (status & MTK_TX_DONE_INT)
19 return budget;
20
21 - napi_complete(napi);
22 - mtk_tx_irq_enable(eth, MTK_TX_DONE_INT);
23 + if (napi_complete(napi))
24 + mtk_tx_irq_enable(eth, MTK_TX_DONE_INT);
25
26 return tx_done;
27 }
28 @@ -1553,8 +1553,9 @@ poll_again:
29 remain_budget -= rx_done;
30 goto poll_again;
31 }
32 - napi_complete(napi);
33 - mtk_rx_irq_enable(eth, MTK_RX_DONE_INT);
34 +
35 + if (napi_complete(napi))
36 + mtk_rx_irq_enable(eth, MTK_RX_DONE_INT);
37
38 return rx_done + budget - remain_budget;
39 }