Skip to contentSkip to conversation

r8169: don't try to disable interrupts if NAPI is scheduled already

PATCH Applied Heiner Kallweit 2 participants 2 messages Feb 5, 2021 – Feb 6, 2021

Subsystems (3)
lore
Share & tools
lore

Heiner Kallweit

author maintainer
#0 lore raw

PATCH 1/1 r8169: don't try to disable interrupts if NAPI is scheduled already

There's no benefit in trying to disable interrupts if NAPI is scheduled already. This allows us to save a PCI write in this case.

---
 drivers/net/ethernet/realtek/r8169_main.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/ethernet/realtek/r8169_main.c +4 -2
index eb4c2e678..c15c285a0 100644
@@ -4544,8 +4544,10 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
 		rtl_schedule_task(tp, RTL_FLAG_TASK_RESET_PENDING);
 	}
 
-	rtl_irq_disable(tp);
-	napi_schedule(&tp->napi);
+	if (napi_schedule_prep(&tp->napi)) {
+		rtl_irq_disable(tp);
+		__napi_schedule(&tp->napi);
+	}
 out:
 	rtl_ack_events(tp, status);
 
Signature · 1 line
2.30.0
#1 lore raw
This patch was applied to netdev/net-next.git (refs/heads/master):

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

Quoted 7 lines · On Fri, 5 Feb 2021 22:48:53 +0100 you wrote:

There's no benefit in trying to disable interrupts if NAPI is scheduled already. This allows us to save a PCI write in this case.

---
 drivers/net/ethernet/realtek/r8169_main.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Here is the summary with links:
- [net-next] r8169: don't try to disable interrupts if NAPI is scheduled already

    https://git.kernel.org/netdev/net-next/c/7274c4147afb

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html