From: Kevin Hao Date: Tue, 7 Apr 2026 00:45:39 +0000 (+0800) Subject: net: macb: Use napi_schedule_irqoff() in IRQ handler X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a17d3c3d0cb2827eaa87c43e748095e21f8cc1ab;p=thirdparty%2Fkernel%2Flinux.git net: macb: Use napi_schedule_irqoff() in IRQ handler For non-PREEMPT_RT kernels, the IRQ handler runs with interrupts disabled, allowing the use of napi_schedule_irqoff() to save a pair of local_irq_{save,restore} operations. For PREEMPT_RT kernels, napi_schedule_irqoff() behaves identically to napi_schedule(). Signed-off-by: Kevin Hao Link: https://patch.msgid.link/20260407-macb-napi-irqoff-v1-1-61bec60047d7@gmail.com Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index d9716c56f705b..a12aa21244e83 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -2149,7 +2149,7 @@ static irqreturn_t macb_interrupt(int irq, void *dev_id) */ queue_writel(queue, IDR, bp->rx_intr_mask); macb_queue_isr_clear(bp, queue, MACB_BIT(RCOMP)); - napi_schedule(&queue->napi_rx); + napi_schedule_irqoff(&queue->napi_rx); } if (status & (MACB_BIT(TCOMP) | @@ -2162,7 +2162,7 @@ static irqreturn_t macb_interrupt(int irq, void *dev_id) wmb(); // ensure softirq can see update } - napi_schedule(&queue->napi_tx); + napi_schedule_irqoff(&queue->napi_tx); } if (unlikely(status & MACB_INT_MISC_FLAGS))