summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2021-02-06 00:48:53 +0300
committerJakub Kicinski <kuba@kernel.org>2021-02-07 02:12:39 +0300
commit7274c4147afbf46f45b8501edbdad6da8cd013b9 (patch)
tree49cef7e21b1aa1d185ae86da7aa770844ffc6b9c
parent21c85974aab7211619d39364990427af543c88ac (diff)
downloadlinux-7274c4147afbf46f45b8501edbdad6da8cd013b9.tar.xz
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. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Link: https://lore.kernel.org/r/78c7f2fb-9772-1015-8c1d-632cbdff253f@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r--drivers/net/ethernet/realtek/r8169_main.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index 7b053a1f6d59..04231585ef79 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -4549,8 +4549,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);