From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Teddy Astie <teddy.astie@vates.tech>
Cc: xen-devel@lists.xenproject.org
Subject: Re: [RFC PATCH] xen: Introduce extra IRQ count domain creation parameter
Date: Tue, 20 May 2025 11:28:14 +0200 [thread overview]
Message-ID: <aCxLLlk-yLQZHZ1R@Mac.lan> (raw)
In-Reply-To: <9a746a8b2e9ee68a398795ecb5dcb53697aeece4.1747403245.git.teddy.astie@vates.tech>
On Fri, May 16, 2025 at 01:50:25PM +0000, Teddy Astie wrote:
> When doing PCI Passthrough with high-IRQ devices (e.g NVMe drives),
> the default limit may be unefficient as not all domains requires
> more IRQs.
>
> Introduce a new parameter to allow the toolstack to tune the IRQ
> count if more is required.
>
> Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
> ---
> 0 extra_irqs is meaningful, though I am not sure how to expose this
> special case.
You could introduce a new CDF flag to signal the contents of
extra_irqs is valid, or maybe use the top bit of the `extra_irqs`
field to signal the value is set?
> This of course wants libxl support next.
It would be nice if this could come together in a patch series.
> ---
> xen/common/domain.c | 8 +++++---
> xen/include/public/domctl.h | 3 +++
> 2 files changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/xen/common/domain.c b/xen/common/domain.c
> index abf1969e60..5c628962fc 100644
> --- a/xen/common/domain.c
> +++ b/xen/common/domain.c
> @@ -912,10 +912,12 @@ struct domain *domain_create(domid_t domid,
>
> #ifdef CONFIG_HAS_PIRQ
> if ( !is_hardware_domain(d) )
> - d->nr_pirqs = nr_static_irqs + extra_domU_irqs;
> + d->nr_pirqs = nr_static_irqs + config->extra_irqs ?: extra_domU_irqs;
> else
> - d->nr_pirqs = extra_hwdom_irqs ? nr_static_irqs + extra_hwdom_irqs
> - : arch_hwdom_irqs(d);
> + {
> + unsigned int extra_irqs = config->extra_irqs ?: extra_hwdom_irqs;
Newline.
> + d->nr_pirqs = extra_irqs ? nr_static_irqs + extra_irqs : arch_hwdom_irqs(d);
I think the above line is > 80 characters?
> + }
> d->nr_pirqs = min(d->nr_pirqs, nr_irqs);
>
> radix_tree_init(&d->pirq_tree);
> diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
> index 5b2063eed9..e4bb366c78 100644
> --- a/xen/include/public/domctl.h
> +++ b/xen/include/public/domctl.h
> @@ -121,6 +121,9 @@ struct xen_domctl_createdomain {
> /* CPU pool to use; specify 0 or a specific existing pool */
> uint32_t cpupool_id;
>
> + /* Additional IRQ for this guest. 0 to use Xen default value. */
> + uint32_t extra_irqs;
I think you need a domctl version bump, as the last one was done for
4.19.
Regards, Roger.
prev parent reply other threads:[~2025-05-20 9:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-16 13:50 [RFC PATCH] xen: Introduce extra IRQ count domain creation parameter Teddy Astie
2025-05-18 8:44 ` Jan Beulich
2025-05-20 9:28 ` Roger Pau Monné [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=aCxLLlk-yLQZHZ1R@Mac.lan \
--to=roger.pau@citrix.com \
--cc=teddy.astie@vates.tech \
--cc=xen-devel@lists.xenproject.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.