From: Yibo Dong <dong100@mucse.com>
To: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, danishanwar@ti.com,
horms@kernel.org, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org, yaojun@mucse.com
Subject: Re: [PATCH net-next v3 1/4] net: rnpgbe: Add interrupt handling
Date: Fri, 8 May 2026 11:06:40 +0800 [thread overview]
Message-ID: <B1A8B62336166017+20260508030640.GA201293@nic-Precision-5820-Tower> (raw)
In-Reply-To: <5e9b15c7-5db4-408e-a5bc-75fe5752ed74@linux.dev>
On Thu, May 07, 2026 at 01:30:55PM +0100, Vadim Fedorenko wrote:
> On 07/05/2026 09:15, Dong Yibo wrote:
> > Add comprehensive interrupt handling for the RNPGBE driver:
> > - Implement msi-x/msi interrupt configuration and management
> > - Create library functions for interrupt registration and cleanup
> >
> > This infrastructure enables proper interrupt handling for the
> > RNPGBE driver.
> >
>
> [...]
>
> > +/**
> > + * rnpgbe_set_interrupt_capability - Set MSI-X or MSI if supported
> > + * @mucse: pointer to private structure
> > + *
> > + * Attempt to configure the interrupts using the best available
> > + * capabilities of the hardware.
> > + *
> > + * @return: 0 on success, negative on failure
> > + **/
> > +static int rnpgbe_set_interrupt_capability(struct mucse *mucse)
> > +{
> > + int v_budget;
> > +
> > + v_budget = min_t(int, mucse->num_tx_queues, mucse->num_rx_queues);
> > + v_budget = min_t(int, v_budget, MAX_Q_VECTORS);
>
> these 2 lines can be simplified to
>
> min3(mucse->num_tx_queues, mucse->num_rx_queues, MAX_Q_VECTORS);
>
Got it, I will update this.
> > + v_budget = min_t(int, v_budget, num_online_cpus());
> > + /* add one vector for mbx */> + v_budget += 1;
> > + v_budget = pci_alloc_irq_vectors(mucse->pdev, 1, v_budget,
> > + PCI_IRQ_MSI | PCI_IRQ_MSIX);
> > + if (v_budget < 0)
> > + return v_budget;
> > +
> > + if (mucse->pdev->msix_enabled) {
> > + /* q_vector not include mbx */
> > + if (v_budget > 1) {
> > + mucse->flags |= M_FLAG_MSIX_EN;
> > + mucse->num_q_vectors = v_budget - 1;
> > + } else {
> > + mucse->flags |= M_FLAG_MSIX_SINGLE_EN;
> > + mucse->num_q_vectors = 1;
> > + }
> > + } else {
> > + /* msi use only 1 irq */
> > + mucse->num_q_vectors = 1;
> > + mucse->flags |= M_FLAG_MSI_EN;
> > + }
>
> How will it work in case it's only 1 vector allocated? AFAIU, you need at
> least 2 irq vectors - 1 for queue processing, another one for mbx.
>
Mbx and tx/rx irq share 1 irq. And in fact, Hw only support 1 msi irq.
Just like ixgbe_intr in intel drivers.
> > +
> > + return 0;
> > +}
>
Thanks for your feedback.
next prev parent reply other threads:[~2026-05-08 3:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-07 8:15 [PATCH net-next v3 0/4] net: rnpgbe: Add TX/RX and link status support Dong Yibo
2026-05-07 8:15 ` [PATCH net-next v3 1/4] net: rnpgbe: Add interrupt handling Dong Yibo
2026-05-07 12:30 ` Vadim Fedorenko
2026-05-08 3:06 ` Yibo Dong [this message]
2026-05-07 8:15 ` [PATCH net-next v3 2/4] net: rnpgbe: Add basic TX packet transmission support Dong Yibo
2026-05-07 8:15 ` [PATCH net-next v3 3/4] net: rnpgbe: Add RX packet reception support Dong Yibo
2026-05-07 8:15 ` [PATCH net-next v3 4/4] net: rnpgbe: Add link status handling support Dong Yibo
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=B1A8B62336166017+20260508030640.GA201293@nic-Precision-5820-Tower \
--to=dong100@mucse.com \
--cc=andrew+netdev@lunn.ch \
--cc=danishanwar@ti.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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