From: Simon Horman <horms@kernel.org>
To: Gui-Dong Han <hanguidong02@gmail.com>
Cc: netdev@vger.kernel.org, linux-net-drivers@amd.com,
ecree.xilinx@gmail.com, linux-kernel@vger.kernel.org,
andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, baijiaju1990@gmail.com
Subject: Re: [PATCH] sfc: Use acquire/release for irq_soft_enabled
Date: Wed, 3 Jun 2026 13:06:03 +0100 [thread overview]
Message-ID: <20260603120603.GD3410996@horms.kernel.org> (raw)
In-Reply-To: <20260528092838.2099352-1-hanguidong02@gmail.com>
On Thu, May 28, 2026 at 05:28:38PM +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.
>
> 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.
>
> Fixes: d829118705f8 ("sfc: Rework IRQ enable/disable")
> Fixes: 8127d661e77f ("sfc: Add support for Solarflare SFC9100 family")
> Fixes: 5a6681e22c14 ("sfc: separate out SFC4000 ("Falcon") support into new sfc-falcon driver")
> Fixes: 51b35a454efd ("sfc: skeleton EF100 PF driver")
> Fixes: 6e173d3b4af9 ("sfc: Copy shared files needed for Siena (part 1)")
> Signed-off-by: Gui-Dong Han <hanguidong02@gmail.com>
> ---
> drivers/net/ethernet/sfc/ef10.c | 4 ++--
> drivers/net/ethernet/sfc/ef100_nic.c | 2 +-
> drivers/net/ethernet/sfc/efx_channels.c | 4 ++--
> drivers/net/ethernet/sfc/falcon/efx.c | 4 ++--
> drivers/net/ethernet/sfc/falcon/falcon.c | 2 +-
> drivers/net/ethernet/sfc/falcon/farch.c | 4 ++--
> drivers/net/ethernet/sfc/falcon/net_driver.h | 12 ++++++++++++
> drivers/net/ethernet/sfc/net_driver.h | 12 ++++++++++++
> drivers/net/ethernet/sfc/siena/efx_channels.c | 4 ++--
> drivers/net/ethernet/sfc/siena/farch.c | 4 ++--
> drivers/net/ethernet/sfc/siena/net_driver.h | 12 ++++++++++++
> 11 files changed, 50 insertions(+), 14 deletions(-)
I'm not sure if it would be worth breaking this up, say on a per-driver
basis. My main thinking here is that it might assist in backporting.
But, OTOH, I wonder if this should be targeted at net-next without
the Fixes tag - can this manifest in an actual bug that effects users?
FTR, there is an Ai-generated review of this patch available on sashiko.dev.
However, I believe that all the issues flagged there are pre-existing and
can be examined in the context of possible follow-up. I do not believe they
should block progress of this patch.
Overall, this looks good to me.
Reviewed-by: Simon Horman <horms@kernel.org>
next prev parent reply other threads:[~2026-06-03 12:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-28 9:28 [PATCH] sfc: Use acquire/release for irq_soft_enabled Gui-Dong Han
2026-06-03 12:06 ` Simon Horman [this message]
2026-06-03 12:47 ` Gui-Dong Han
2026-06-03 18:20 ` Jakub Kicinski
2026-06-03 20:28 ` Edward Cree
2026-06-03 23:52 ` Jakub Kicinski
2026-06-04 2:17 ` Gui-Dong Han
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260603120603.GD3410996@horms.kernel.org \
--to=horms@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=baijiaju1990@gmail.com \
--cc=davem@davemloft.net \
--cc=ecree.xilinx@gmail.com \
--cc=edumazet@google.com \
--cc=hanguidong02@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-net-drivers@amd.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.