From: Heiner Kallweit Date: Fri, 5 Feb 2021 21:48:53 +0000 (+0100) Subject: r8169: don't try to disable interrupts if NAPI is scheduled already X-Git-Tag: v5.12-rc1~200^2~129 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7274c4147afb;p=thirdparty%2Flinux.git 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 Link: https://lore.kernel.org/r/78c7f2fb-9772-1015-8c1d-632cbdff253f@gmail.com Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c index 7b053a1f6d599..04231585ef79a 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);