Re: [PATCH net-next v9 4/4] net: rnpgbe: Add link status handling support
From: Simon Horman
Date: Thu Aug 20 2026 - 05:29:37 EST
On Thu, Aug 20, 2026 at 11:32:12AM +0800, Yibo Dong wrote:
...
> I will remove the unbounded drain loop and handle at most one mailbox
> request in each work-item invocation.
>
> For the dedicated mailbox MSI-X vector, the hard IRQ handler will increment
> an event sequence counter before queueing the mailbox work. The worker will
> compare this counter before and after handling one request; if another
> dedicated mailbox interrupt arrived while it was running, it will requeue
> itself and return, rather than continuing to drain in the same invocation.
This sounds reasonable. But it's probably worth mentioning that
synchronisation around the counter, as you describe, probably needs
something like smp_load_acquire/smp_store_release.
> For MSI and single-vector MSI-X operation, mailbox and data interrupts share
> a vector and cannot be distinguished in the hard IRQ handler. Those
> interrupts will only queue the worker; the worker verifies the firmware
> request counter before reading the mailbox, so data-only interrupts result
> in a coalesced empty check. They do not increment the mailbox event sequence
> counter.
>
> This bounds each work invocation while preserving mailbox events that arrive
> during processing.
> And cancel_work_sync() waits for at most one mailbox check rather than an
> unbounded drain loop. The worker does not requeue itself once the device is
> down.
> Would this approach be acceptable?
Yes, overall this sounds good to me.