All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Eli Cohen <elic@nvidia.com>
Cc: "mst@redhat.com" <mst@redhat.com>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>
Subject: Re: RFC: VDPA Interrupt vector distribution
Date: Mon, 30 Jan 2023 16:19:51 +0800	[thread overview]
Message-ID: <CACGkMEuTz4RVf0CA9y7sf7K3N1FbKrD6A=xC6JL7N+hzX5RLjw@mail.gmail.com> (raw)
In-Reply-To: <bc4136ed-abe0-dcc2-4dd9-31dcf3d8c179@nvidia.com>

Hi Eli:

On Mon, Jan 23, 2023 at 1:59 PM Eli Cohen <elic@nvidia.com> wrote:
>
> VDPA allows hardware drivers the propagate interrupts from the hardware
> directly to the vCPU used by the guest. In a typical implementation, the
> hardware driver will assign the interrupt vectors to the virtqueues and report
> this information back through the get_vq_irq() callback defined in
> struct vdpa_config_ops.
>
> Interrupt vectors could be a scarce resource and may be limited. For such
> cases, we can opt the administrator, through the vdpa tool, to set the policy
> defining how to distribute the available vectors amongst the data virtqueues.
>
> The following policies are proposed:
>
> 1. First comes first served. Assign a vector to each data virtqueue by the
>     virtqueue index. Virtqueues which could not be assigned a dedicated vector
>     would use the hardware driver to propagate interrupts using the available
>     callback mechanism.
>
>     vdpa dev add name vdpa0 mgmtdev pci/0000:86:00.2 int=all
>
>     This is the default mode and works even if "int=all" was not specified.
>
> 2. Use round robin distribution so virtqueues could share vectors.
>     vdpa dev add name vdpa0 mgmtdev pci/0000:86:00.2 int=all intmode=share
>
> 3. Assign vectors to RX virtqueues only.
> 3.1 Do not share vectors
>      vdpa dev add name vdpa0 mgmtdev pci/0000:86:00.2 int=rx
> 3.2 Share vectors
>      vdpa dev add name vdpa0 mgmtdev pci/0000:86:00.2 int=rx intmode=share
>
> 4. Assign vectors to TX virtqueues only. Can share or not, like rx.
> 5. Fail device creation if number of vectors cannot be fulfilled.
>     vdpa dev add name vdpa0 mgmtdev pci/0000:86:00.2 max_vq_pairs 8 int=rx intnum=8

I wonder:

1) how the administrator can know if there's sufficient resources for
one of the above policies.
2) how does the administrator know which policy is the best assuming
the resources are sufficient? (E.g vectors to RX only or vectors to TX
only)

If it requires a vendor specific way or knowledge, I believe it's
better to code them in:

1) the vDPA parent or
2) underlayer management tool or drivers

Thanks

>
>
>
>

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

       reply	other threads:[~2023-01-30  8:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bc4136ed-abe0-dcc2-4dd9-31dcf3d8c179@nvidia.com>
2023-01-30  8:19 ` Jason Wang [this message]
     [not found]   ` <23806cd9-ffde-778c-5fa5-b95bd1ff0b44@nvidia.com>
2023-01-30 11:34     ` RFC: VDPA Interrupt vector distribution Michael S. Tsirkin
     [not found]       ` <734e2553-199f-94eb-88d1-a642ec1c7490@nvidia.com>
2023-01-31  6:02         ` Jason Wang
2023-01-31  7:26         ` Michael S. Tsirkin

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='CACGkMEuTz4RVf0CA9y7sf7K3N1FbKrD6A=xC6JL7N+hzX5RLjw@mail.gmail.com' \
    --to=jasowang@redhat.com \
    --cc=elic@nvidia.com \
    --cc=mst@redhat.com \
    --cc=virtualization@lists.linux-foundation.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.