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>
This commit is contained in:
Felix Fietkau 2021-04-22 22:21:05 -07:00 committed by David S. Miller
parent 816ac3e6e6
commit 16769a8923
1 changed files with 5 additions and 4 deletions

View File

@ -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 @@ static int mtk_napi_rx(struct napi_struct *napi, int budget)
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;
}