2021-04-24 00:19:22 +00:00
|
|
|
From 16769a8923fad5a5377253bcd76b0e0d64976c73 Mon Sep 17 00:00:00 2001
|
2020-10-24 19:14:16 +00:00
|
|
|
From: Felix Fietkau <nbd@nbd.name>
|
2021-04-24 00:19:22 +00:00
|
|
|
Date: Thu, 22 Apr 2021 22:21:05 -0700
|
|
|
|
Subject: [PATCH] net: ethernet: mtk_eth_soc: reduce unnecessary interrupts
|
2020-10-24 19:14:16 +00:00
|
|
|
|
2021-04-24 00:19:22 +00:00
|
|
|
Avoid rearming interrupt if napi_complete returns false
|
2020-10-24 19:14:16 +00:00
|
|
|
|
|
|
|
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
2021-04-24 00:19:22 +00:00
|
|
|
Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
|
|
|
|
Signed-off-by: David S. Miller <davem@davemloft.net>
|
2020-10-24 19:14:16 +00:00
|
|
|
---
|
2021-04-24 00:19:22 +00:00
|
|
|
drivers/net/ethernet/mediatek/mtk_eth_soc.c | 9 +++++----
|
|
|
|
1 file changed, 5 insertions(+), 4 deletions(-)
|
2020-10-24 19:14:16 +00:00
|
|
|
|
|
|
|
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
|
|
|
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
2022-06-22 15:58:33 +00:00
|
|
|
@@ -1554,8 +1554,8 @@ static int mtk_napi_tx(struct napi_struc
|
2020-10-24 19:14:16 +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;
|
|
|
|
}
|
2022-06-22 15:58:33 +00:00
|
|
|
@@ -1588,8 +1588,9 @@ poll_again:
|
2020-10-24 19:14:16 +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;
|
|
|
|
}
|