Skip to content

Commit

Permalink
r8169: don't try to disable interrupts if NAPI is scheduled already
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
hkallweit authored and kuba-moo committed Feb 6, 2021
1 parent 21c8597 commit 7274c41
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/net/ethernet/realtek/r8169_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 7274c41

Please sign in to comment.