Re: [PATCH] sfc: Use acquire/release for irq_soft_enabled

From: Jakub Kicinski

Date: Wed Jun 03 2026 - 14:22:06 EST


On Thu, 28 May 2026 17:28:38 +0800 Gui-Dong Han wrote:
> irq_soft_enabled is a lockless gate for interrupt handlers. When clear,
> handlers must only acknowledge interrupts and must not touch channel state.
>
> Channel reallocation disables this gate, swaps and initializes channel
> pointers, frees old channels, and then enables the gate again. READ_ONCE()
> does not provide an acquire barrier, so an IRQ handler can observe the gate
> as enabled while still seeing stale channel pointers or channel state.
>
> Use release stores when updating the gate and acquire loads in interrupt
> handlers before touching channels. Keep the existing smp_wmb() after gate
> updates, preserving the current ordering with event queue start and stop.

Why are you keeping the smp_wmb() tho? You don't have to repeat what
the patch does. The goal of the commit message is to explain the why.

Ed, WDYT?

Please don't repost this until someone from Solarflare/AMD comments.

> Add small helpers to document the ordering and avoid repeating barrier
> comments at every caller. Without the comments, checkpatch warns about
> memory barriers without comments.
--
pw-bot: cr