The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Yibo Dong <dong100@mucse.com>
Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, vadim.fedorenko@linux.dev,
	u.kleine-koenig@baylibre.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, yaojun@mucse.com
Subject: Re: [PATCH net-next v9 4/4] net: rnpgbe: Add link status handling support
Date: Thu, 20 Aug 2026 10:29:22 +0100	[thread overview]
Message-ID: <20260820092922.GX265046@horms.kernel.org> (raw)
In-Reply-To: <0B1894BBE93DB8F9+20260820033212.GD2730731@nic-Precision-5820-Tower>

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.

      reply	other threads:[~2026-08-20  9:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-14 11:13 [PATCH net-next v9 0/4] net: rnpgbe: Add TX/RX and link status support Dong Yibo
2026-08-14 11:13 ` [PATCH net-next v9 1/4] net: rnpgbe: Add interrupt handling Dong Yibo
2026-08-18 10:59   ` Simon Horman
2026-08-19  6:42     ` Yibo Dong
2026-08-14 11:13 ` [PATCH net-next v9 2/4] net: rnpgbe: Add basic TX packet transmission support Dong Yibo
2026-08-18 11:03   ` Simon Horman
2026-08-19  8:49     ` Yibo Dong
2026-08-19 11:09       ` Simon Horman
2026-08-14 11:13 ` [PATCH net-next v9 3/4] net: rnpgbe: Add RX packet reception support Dong Yibo
2026-08-18 11:15   ` Simon Horman
2026-08-19  9:42     ` Yibo Dong
2026-08-14 11:13 ` [PATCH net-next v9 4/4] net: rnpgbe: Add link status handling support Dong Yibo
2026-08-18 12:04   ` Simon Horman
2026-08-20  3:32     ` Yibo Dong
2026-08-20  9:29       ` Simon Horman [this message]

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=20260820092922.GX265046@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=dong100@mucse.com \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=u.kleine-koenig@baylibre.com \
    --cc=vadim.fedorenko@linux.dev \
    --cc=yaojun@mucse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox