2020-09-04 16:30:07 +00:00
|
|
|
From: Felix Fietkau <nbd@nbd.name>
|
|
|
|
Date: Fri, 4 Sep 2020 18:14:05 +0200
|
|
|
|
Subject: [PATCH] net: ethernet: mtk_eth_soc: avoid rearming interrupt if
|
|
|
|
napi_complete returns false
|
|
|
|
|
|
|
|
Reduces unnecessary interrupts
|
|
|
|
|
|
|
|
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
|
|
---
|
|
|
|
|
|
|
|
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
|
|
|
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
2021-06-03 18:46:59 +00:00
|
|
|
@@ -1536,8 +1536,8 @@ static int mtk_napi_tx(struct napi_struc
|
2020-09-04 16:30:07 +00:00
|
|
|
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;
|
|
|
|
}
|
2021-06-03 18:46:59 +00:00
|
|
|
@@ -1570,8 +1570,9 @@ poll_again:
|
2020-09-04 16:30:07 +00:00
|
|
|
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;
|
|
|
|
}
|