]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: macb: Use napi_schedule_irqoff() in IRQ handler
authorKevin Hao <haokexin@gmail.com>
Tue, 7 Apr 2026 00:45:39 +0000 (08:45 +0800)
committerJakub Kicinski <kuba@kernel.org>
Fri, 10 Apr 2026 03:17:31 +0000 (20:17 -0700)
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 <haokexin@gmail.com>
Link: https://patch.msgid.link/20260407-macb-napi-irqoff-v1-1-61bec60047d7@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/cadence/macb_main.c

index d9716c56f705b63d897e7346f25e28387618f234..a12aa21244e83bc7f905a972a924eb6442aaeec7 100644 (file)
@@ -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))