diff options
author | Felix Fietkau <nbd@nbd.name> | 2021-04-23 08:21:05 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-04-23 23:31:58 +0300 |
commit | 16769a8923fad5a5377253bcd76b0e0d64976c73 (patch) | |
tree | 492b53042da97b74f54c589665f63eb83cbe0361 /drivers/net/ethernet/mediatek/mtk_eth_soc.c | |
parent | 816ac3e6e67bdd78d86226c6eb53619780750e92 (diff) | |
download | linux-16769a8923fad5a5377253bcd76b0e0d64976c73.tar.xz |
net: ethernet: mtk_eth_soc: reduce unnecessary interrupts
Avoid rearming interrupt if napi_complete returns false
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mediatek/mtk_eth_soc.c')
-rw-r--r-- | drivers/net/ethernet/mediatek/mtk_eth_soc.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c index 4735942ed283..e1792ccaedc3 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -1519,8 +1519,8 @@ static int mtk_napi_tx(struct napi_struct *napi, int budget) if (status & MTK_TX_DONE_INT) return budget; - napi_complete(napi); - mtk_tx_irq_enable(eth, MTK_TX_DONE_INT); + if (napi_complete(napi)) + mtk_tx_irq_enable(eth, MTK_TX_DONE_INT); return tx_done; } @@ -1553,8 +1553,9 @@ poll_again: remain_budget -= rx_done; goto poll_again; } - napi_complete(napi); - mtk_rx_irq_enable(eth, MTK_RX_DONE_INT); + + if (napi_complete(napi)) + mtk_rx_irq_enable(eth, MTK_RX_DONE_INT); return rx_done + budget - remain_budget; } |