From: netdev-bot+sashiko@kernel.org
To: mmc@linux.ibm.com
Cc: netdev@vger.kernel.org, maddy@linux.ibm.com, mpe@ellerman.id.au,
npiggin@gmail.com, chleroy@kernel.org, ritesh.list@gmail.com,
sshegde@linux.ibm.com, nnac123@linux.ibm.com,
andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org,
kuba@kernel.org, pabeni@redhat.com,
linuxppc-dev@lists.ozlabs.org, horms@kernel.org,
davemarq@linux.ibm.com, haren@linux.ibm.com,
ricklind@linux.ibm.com, bjking1@linux.ibm.com,
shaik.abdulla1@ibm.com
Subject: Re: [PATCH net-next 4/8] ibmveth: Refactor RX interrupt control for MQ RX queues
Date: Mon, 23 Nov 2026 01:06:08 +0000 [thread overview]
Message-ID: <179539596806.3135.11806601454673648074@kernel.org> (raw)
In-Reply-To: <20261119000711.18093-5-mmc@linux.ibm.com>
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The kernel-doc for the new IRQ helpers promises a per-queue mask,
but the code always masks the whole adapter.
- [Low] The kernel-doc of ibmveth_setup_rx_interrupts() says it "Leaves
the queues masked in PHYP; the caller kicks NAPI, and the first poll…
- [Low] The comment added in ibmveth_poll() says "Mask before queueing,
as schedule_rx_queue() does", but no function by that name exists.
--
ibmveth: Refactor RX interrupt control for MQ RX queues
This moves ibmveth RX IRQ and NAPI setup, teardown and PHYP masking into
helpers that take a queue index, and uses the queue's NAPI as the IRQ
cookie. It adds queue_irq[] and moves napi_enable() after request_irq().
In close(), the IRQ is now freed before H_FREE_LOGICAL_LAN.
> diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net/ethernet/ibm/ibmveth.c
> index 20273240d8fea..ab5df17940042 100644
> --- a/drivers/net/ethernet/ibm/ibmveth.c
> +++ b/drivers/net/ethernet/ibm/ibmveth.c
> @@ -330,6 +330,150 @@ ibmveth_cleanup_rx_resources(struct ibmveth_adapter *adapter)
> }
> }
>
> +/**
> + * ibmveth_toggle_irq - Mask or unmask one RX queue's interrupt in PHYP
> + * @adapter: ibmveth adapter structure
> + * @queue_index: RX queue index
> + * @enable: true to unmask, false to mask
> + *
> + * Return: 0 on success, -EIO on failure
> + */
> +static int
> +ibmveth_toggle_irq(struct ibmveth_adapter *adapter, int queue_index,
> + bool enable)
> +{
> + const char *action = enable ? "enable" : "disable";
> + unsigned long h_rc;
> +
> + h_rc = h_vio_signal(adapter->vdev->unit_address,
> + enable ? VIO_IRQ_ENABLE : VIO_IRQ_DISABLE);
[Severity: Low]
The kernel-doc says this masks "one RX queue's interrupt". The
ibmveth_disable_irq() and ibmveth_enable_irq() wrappers and
ibmveth_schedule_rx_queue() also describe a per-queue mask. Is that
accurate?
h_vio_signal() takes only the unit address and a mode:
arch/powerpc/include/asm/vio.h:
#define h_vio_signal(ua, mode) \
plpar_hcall_norets(H_VIO_SIGNAL, ua, mode)
So queue_index only reaches the dev_err_ratelimited() message, and every
call masks or unmasks the whole adapter.
With num_rx_queues > 1, the per-queue loops in
ibmveth_cleanup_rx_interrupts() would send the same adapter-wide hcall
once per queue. The unmask in ibmveth_poll() after napi_complete_done():
rc = ibmveth_enable_irq(adapter, 0);
would also re-arm the interrupt for queues whose NAPI is still scheduled.
Also, only queue_irq[0] gets set (in ibmveth_open()), but
ibmveth_setup_rx_interrupts() and ibmveth_cleanup_rx_interrupts() loop
over num_rx_queues.
IBMVETH_MAX_RX_QUEUES and IBMVETH_DEFAULT_RX_QUEUES are still 1U here and
at the end of the series, so nothing changes at runtime today.
Could the kernel-doc say the mask is adapter-wide? Or would real
multi-queue masking need a different firmware mechanism, such as the
per sub-CRQ H_VIOCTL control that ibmvnic uses?
> + if (h_rc) {
> + dev_err_ratelimited(&adapter->netdev->dev,
> + "Failed to %s IRQ for queue %d, rc=0x%lx\n",
> + action, queue_index, h_rc);
> + return -EIO;
> + }
> + return 0;
> +}
[ ... ]
> +/**
> + * ibmveth_setup_rx_interrupts - Register IRQs and enable NAPI
> + * @adapter: ibmveth adapter structure
> + *
> + * Leaves the queues masked in PHYP; the caller kicks NAPI, and the first
> + * poll unmasks.
> + *
> + * Return: 0 on success, negative error code on failure
> + */
> +static int
> +ibmveth_setup_rx_interrupts(struct ibmveth_adapter *adapter)
> +{
> + struct net_device *netdev = adapter->netdev;
> + int i, rc, num = adapter->num_rx_queues;
> +
> + for (i = 0; i < num; i++) {
> + rc = request_irq(adapter->queue_irq[i], ibmveth_interrupt,
> + 0, netdev->name, &adapter->napi[i]);
> + if (rc) {
[ ... ]
> + }
> +
> + for (i = 0; i < num; i++)
> + napi_enable(&adapter->napi[i]);
[Severity: Low]
Both this kernel-doc and the commit message ("napi_enable() moves to after
request_irq(), with PHYP still masked") say the queues are left masked.
The function itself only calls request_irq() and napi_enable(). Does it
depend on a precondition that the caller has to provide but that is not
documented?
The only mask is the earlier one in ibmveth_open(). Its return value is
ignored, and H_REGISTER_LOGICAL_LAN runs after it. On the kexec retry
path, H_FREE_LOGICAL_LAN and a second register also run:
ibmveth_open() {
...
adapter->queue_irq[0] = netdev->irq;
ibmveth_disable_irq(adapter, 0);
lpar_rc = ibmveth_register_logical_lan(adapter, rxq_desc, mac_address);
...
}
Suppose that hcall failed, or PHYP is unmasked again by the time
request_irq() runs. An interrupt arriving before napi_enable() would go
through:
ibmveth_interrupt()
ibmveth_schedule_rx_queue()
napi_schedule_prep() fails because NAPI is still disabled
and return IRQ_HANDLED without masking. The queue would stay unmasked
until the later ibmveth_schedule_rx_queue(adapter, 0) kick in
ibmveth_open().
In the old order, napi_enable() ran before request_irq(), so the first
interrupt masked PHYP itself. I couldn't tell from the code whether PHYP
can reset the interrupt mode during register/free, so this may only be a
documentation issue.
Should the precondition be documented? Alternatively, could
ibmveth_setup_rx_interrupts() do the mask itself and check the result?
[ ... ]
> @@ -1902,18 +2025,17 @@ static int ibmveth_poll(struct napi_struct *napi, int budget)
> /* We think we are done - reenable interrupts,
> * then check once more to make sure we are done.
> */
> - lpar_rc = h_vio_signal(adapter->vdev->unit_address, VIO_IRQ_ENABLE);
> - if (WARN_ON(lpar_rc != H_SUCCESS)) {
> + rc = ibmveth_enable_irq(adapter, 0);
> + if (rc) {
> schedule_work(&adapter->work);
> goto out;
> }
>
> - /* Mask before queueing, as ibmveth_interrupt() does: a threaded
> + /* Mask before queueing, as schedule_rx_queue() does: a threaded
> * NAPI can start polling, and unmask, as soon as it is queued.
> */
[Severity: Low]
This isn't a bug, but the comment names schedule_rx_queue(), and there is
no function with that name. Should it be ibmveth_schedule_rx_queue()?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261119000711.18093-1-mmc%40linux.ibm.com
next prev parent reply other threads:[~2026-11-23 1:06 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 0:07 [PATCH net-next 0/8] ibmveth: prepare the RX path for multi-queue Mingming Cao
2026-11-19 0:07 ` [PATCH net-next 1/8] ibmveth: Prepare MQ RX adapter data structures Mingming Cao
2026-11-19 0:07 ` [PATCH net-next 2/8] ibmveth: Refactor RX resource allocation for MQ RX bring-up Mingming Cao
2026-11-23 1:06 ` netdev-bot+sashiko
2026-11-19 0:07 ` [PATCH net-next 3/8] ibmveth: Refactor buffer pool management for per-queue MQ RX Mingming Cao
2026-11-19 0:07 ` [PATCH net-next 4/8] ibmveth: Refactor RX interrupt control for MQ RX queues Mingming Cao
2026-11-23 1:06 ` netdev-bot+sashiko [this message]
2026-11-19 0:07 ` [PATCH net-next 5/8] ibmveth: Refactor TX resource allocation in open/close paths Mingming Cao
2026-11-23 1:06 ` netdev-bot+sashiko
2026-11-19 0:07 ` [PATCH net-next 6/8] ibmveth: Add RX queue register helpers for MQ Mingming Cao
2026-11-23 1:06 ` netdev-bot+sashiko
2026-11-19 0:07 ` [PATCH net-next 7/8] ibmveth: Pass the RX queue index through replenish and poll Mingming Cao
2026-11-23 1:06 ` netdev-bot+sashiko
2026-11-19 0:07 ` [PATCH net-next 8/8] ibmveth: Split RX poll into per-slot helpers for MQ Mingming Cao
2026-11-23 1:06 ` netdev-bot+sashiko
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=179539596806.3135.11806601454673648074@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=bjking1@linux.ibm.com \
--cc=chleroy@kernel.org \
--cc=davem@davemloft.net \
--cc=davemarq@linux.ibm.com \
--cc=edumazet@kernel.org \
--cc=haren@linux.ibm.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=mmc@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=netdev@vger.kernel.org \
--cc=nnac123@linux.ibm.com \
--cc=npiggin@gmail.com \
--cc=pabeni@redhat.com \
--cc=ricklind@linux.ibm.com \
--cc=ritesh.list@gmail.com \
--cc=shaik.abdulla1@ibm.com \
--cc=sshegde@linux.ibm.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