Commit a17d3c3d authored by Kevin Hao's avatar Kevin Hao Committed by Jakub Kicinski
Browse files

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: default avatarKevin Hao <haokexin@gmail.com>
Link: https://patch.msgid.link/20260407-macb-napi-irqoff-v1-1-61bec60047d7@gmail.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 5ecbebc9
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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))