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
6 Avoid rearming interrupt if napi_complete returns false
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>
12 drivers/net/ethernet/mediatek/mtk_eth_soc.c | 9 +++++----
13 1 file changed, 5 insertions(+), 4 deletions(-)
15 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
16 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
17 @@ -1555,8 +1555,8 @@ static int mtk_napi_tx(struct napi_struc
18 if (status & MTK_TX_DONE_INT)
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);
28 @@ -1589,8 +1589,9 @@ poll_again:
29 remain_budget -= rx_done;
32 - napi_complete(napi);
33 - mtk_rx_irq_enable(eth, MTK_RX_DONE_INT);
35 + if (napi_complete(napi))
36 + mtk_rx_irq_enable(eth, MTK_RX_DONE_INT);
38 return rx_done + budget - remain_budget;