From: Mingming Cao <mmc@linux.ibm.com>
To: netdev@vger.kernel.org
Cc: Mingming Cao <mmc@linux.ibm.com>,
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, willemb@google.com
Subject: [PATCH net-next v9 06/13] ibmveth: Add subordinate RX queue interrupt control
Date: Tue, 1 Dec 2026 11:02:09 -0800 [thread overview]
Message-ID: <20261201190216.62407-7-mmc@linux.ibm.com> (raw)
In-Reply-To: <20261201190216.62407-1-mmc@linux.ibm.com>
This is preparation for multi-queue (MQ) RX; nothing sets multi_queue
yet, so single-queue behavior does not change.
The RX interrupt handler masks the queue's interrupt and schedules
NAPI, and the poll unmasks it when done. Both go through
ibmveth_toggle_irq(), which only handles queue 0 with h_vio_signal().
A subordinate queue's interrupt is controlled with H_VIOCTL on the
hardware number H_REG_LOGICAL_LAN_QUEUE returned.
Keep that number in queue_hwirq[] and add the H_VIOCTL branch, so the
existing handler and poll can mask and unmask any queue. Mask each
subordinate queue as soon as its interrupt is mapped, so it cannot
fire before its NAPI is enabled; if that fails, open() fails.
Signed-off-by: Mingming Cao <mmc@linux.ibm.com>
---
drivers/net/ethernet/ibm/ibmveth.c | 32 +++++++++++++++++++++---------
drivers/net/ethernet/ibm/ibmveth.h | 4 ++++
2 files changed, 27 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net/ethernet/ibm/ibmveth.c
index 5783c0ce34a3..1a9499438930 100644
--- a/drivers/net/ethernet/ibm/ibmveth.c
+++ b/drivers/net/ethernet/ibm/ibmveth.c
@@ -402,8 +402,7 @@ ibmveth_cleanup_rx_resources(struct ibmveth_adapter *adapter)
* @queue_index: RX queue index
* @enable: true to unmask, false to mask
*
- * Only queue 0 exists for now. Its interrupt is the adapter's own, which
- * h_vio_signal() controls, so @queue_index is used only for logging.
+ * Queue 0 uses h_vio_signal(); subordinate queues use H_VIOCTL.
*
* Return: 0 on success, -EIO on failure
*/
@@ -414,8 +413,17 @@ ibmveth_toggle_irq(struct ibmveth_adapter *adapter, int queue_index,
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);
+ if (queue_index == 0)
+ h_rc = h_vio_signal(adapter->vdev->unit_address,
+ enable ? VIO_IRQ_ENABLE : VIO_IRQ_DISABLE);
+ else
+ h_rc = plpar_hcall_norets(H_VIOCTL,
+ adapter->vdev->unit_address,
+ enable ? H_ENABLE_VIO_INTERRUPT :
+ H_DISABLE_VIO_INTERRUPT,
+ adapter->queue_hwirq[queue_index],
+ 0, 0);
+
if (h_rc) {
dev_err_ratelimited(&adapter->netdev->dev,
"Failed to %s IRQ for queue %d, rc=0x%lx\n",
@@ -477,9 +485,9 @@ ibmveth_dispose_subordinate_irq_mappings(struct ibmveth_adapter *adapter)
* ibmveth_setup_rx_interrupts - Register IRQs and enable NAPI
* @adapter: ibmveth adapter structure
*
- * The queues must already be masked in PHYP, as they are before the LAN
- * is registered; this does not unmask them. The caller kicks NAPI, and
- * the first poll unmasks.
+ * The queues must already be masked in PHYP: queue 0 before the LAN is
+ * registered, the others as they are registered. This does not unmask
+ * them. The caller kicks NAPI, and the first poll unmasks.
*
* Return: 0 on success, negative error code on failure
*/
@@ -1328,7 +1336,8 @@ static void ibmveth_free_all_queues(struct ibmveth_adapter *adapter)
* H_FREE_LOGICAL_LAN.
*
* Return: 0 on success, -ENOMEM if the interrupt cannot be mapped,
- * -EIO if H_REG_LOGICAL_LAN_QUEUE fails
+ * -EIO if H_REG_LOGICAL_LAN_QUEUE fails or the interrupt
+ * cannot be masked
*/
static int ibmveth_register_rx_queue(struct ibmveth_adapter *adapter,
int queue_idx)
@@ -1371,7 +1380,12 @@ static int ibmveth_register_rx_queue(struct ibmveth_adapter *adapter,
adapter->queue_handle[queue_idx] = handle;
adapter->queue_irq[queue_idx] = virq;
- return 0;
+ adapter->queue_hwirq[queue_idx] = hwirq;
+
+ /* setup_rx_interrupts() expects every queue masked: until NAPI is
+ * enabled, the handler does not mask it.
+ */
+ return ibmveth_disable_irq(adapter, queue_idx);
}
/**
diff --git a/drivers/net/ethernet/ibm/ibmveth.h b/drivers/net/ethernet/ibm/ibmveth.h
index 34f57ad07a2f..398d3a862503 100644
--- a/drivers/net/ethernet/ibm/ibmveth.h
+++ b/drivers/net/ethernet/ibm/ibmveth.h
@@ -256,6 +256,10 @@ struct ibmveth_adapter {
/* Opaque PHYP cookie, 0 can be valid. Set only in multi_queue mode. */
u64 queue_handle[IBMVETH_MAX_RX_QUEUES];
unsigned int queue_irq[IBMVETH_MAX_RX_QUEUES];
+ /* PHYP interrupt number for H_VIOCTL, subordinate queues only;
+ * queue 0 uses h_vio_signal(), so entry 0 is never read.
+ */
+ unsigned long queue_hwirq[IBMVETH_MAX_RX_QUEUES];
bool multi_queue;
unsigned int num_rx_queues;
int rx_csum;
--
2.50.1 (Apple Git-155)
next prev parent reply other threads:[~2026-12-01 19:03 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 19:02 [PATCH net-next v9 00/13] ibmveth: Add multi-queue RX support Mingming Cao
2026-12-01 19:02 ` [PATCH net-next v9 01/13] ibmveth: Keep a buffer pool enabled after its allocation fails Mingming Cao
2026-12-01 19:02 ` [PATCH net-next v9 02/13] ibmveth: Keep TX statistics per queue Mingming Cao
2026-12-01 19:02 ` [PATCH net-next v9 03/13] powerpc/pseries: Add hcall numbers for multi-queue virtual ethernet Mingming Cao
2026-12-01 19:02 ` [PATCH net-next v9 04/13] ibmveth: Add RX queue handles Mingming Cao
2026-12-01 19:02 ` [PATCH net-next v9 05/13] ibmveth: Register subordinate RX queues Mingming Cao
2026-12-01 19:02 ` Mingming Cao [this message]
2026-12-01 19:02 ` [PATCH net-next v9 07/13] ibmveth: Add the MQ RX buffer submit hypercall Mingming Cao
2026-12-01 19:02 ` [PATCH net-next v9 08/13] ibmveth: Start every RX queue on open and resume Mingming Cao
2026-12-01 19:02 ` [PATCH net-next v9 09/13] ibmveth: Keep RX statistics per queue Mingming Cao
2026-12-01 19:02 ` [PATCH net-next v9 10/13] ibmveth: Keep rx_no_buffer across ifdown/up Mingming Cao
2026-12-01 19:02 ` [PATCH net-next v9 11/13] ibmveth: Report per-queue statistics through netdev_stat_ops Mingming Cao
2026-12-01 19:02 ` [PATCH net-next v9 12/13] ibmveth: Enable multi-queue RX Mingming Cao
2026-12-01 19:02 ` [PATCH net-next v9 13/13] ibmveth: Allow changing the RX queue count Mingming Cao
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=20261201190216.62407-7-mmc@linux.ibm.com \
--to=mmc@linux.ibm.com \
--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=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 \
--cc=willemb@google.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