linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Xie Yongji <xieyongji@bytedance.com>
Cc: mst@redhat.com, tglx@linutronix.de, hch@lst.de,
	virtualization@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 03/11] vdpa: Add set_irq_affinity callback in vdpa_config_ops
Date: Fri, 16 Dec 2022 11:58:15 +0800	[thread overview]
Message-ID: <CACGkMEvYpBz6wdOPFvRveT=0AO=g-nzaeJt3y99oqWDLHUs=qw@mail.gmail.com> (raw)
In-Reply-To: <20221205084127.535-4-xieyongji@bytedance.com>

On Mon, Dec 5, 2022 at 4:43 PM Xie Yongji <xieyongji@bytedance.com> wrote:
>
> This introduces set_irq_affinity callback in
> vdpa_config_ops so that vdpa device driver can
> get the interrupt affinity hint from the virtio
> device driver. The interrupt affinity hint would
> be needed by the interrupt affinity spreading
> mechanism.
>
> Signed-off-by: Xie Yongji <xieyongji@bytedance.com>
> ---
>  drivers/virtio/virtio_vdpa.c | 4 ++++
>  include/linux/vdpa.h         | 8 ++++++++
>  2 files changed, 12 insertions(+)
>
> diff --git a/drivers/virtio/virtio_vdpa.c b/drivers/virtio/virtio_vdpa.c
> index 08084b49e5a1..4731e4616ee0 100644
> --- a/drivers/virtio/virtio_vdpa.c
> +++ b/drivers/virtio/virtio_vdpa.c
> @@ -275,9 +275,13 @@ static int virtio_vdpa_find_vqs(struct virtio_device *vdev, unsigned int nvqs,
>         struct virtio_vdpa_device *vd_dev = to_virtio_vdpa_device(vdev);
>         struct vdpa_device *vdpa = vd_get_vdpa(vdev);
>         const struct vdpa_config_ops *ops = vdpa->config;
> +       struct irq_affinity default_affd = { 0 };
>         struct vdpa_callback cb;
>         int i, err, queue_idx = 0;
>
> +       if (ops->set_irq_affinity)
> +               ops->set_irq_affinity(vdpa, desc ? desc : &default_affd);

I wonder if we need to do this in vhost-vDPA. Or it's better to have a
default affinity by the vDPA parent itself.

(Looking at virtio-pci, it doesn't do something like this).

Thanks

> +
>         for (i = 0; i < nvqs; ++i) {
>                 if (!names[i]) {
>                         vqs[i] = NULL;
> diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h
> index 0ff6c9363356..482ff7d0206f 100644
> --- a/include/linux/vdpa.h
> +++ b/include/linux/vdpa.h
> @@ -256,6 +256,12 @@ struct vdpa_map_file {
>   *                             @vdev: vdpa device
>   *                             @idx: virtqueue index
>   *                             Returns the irq affinity mask
> + * @set_irq_affinity:          Pass the irq affinity hint from the virtio
> + *                             device driver to vdpa driver (optional).
> + *                             Needed by the interrupt affinity spreading
> + *                             mechanism.
> + *                             @vdev: vdpa device
> + *                             @desc: irq affinity hint
>   * @set_group_asid:            Set address space identifier for a
>   *                             virtqueue group (optional)
>   *                             @vdev: vdpa device
> @@ -344,6 +350,8 @@ struct vdpa_config_ops {
>                                const struct cpumask *cpu_mask);
>         const struct cpumask *(*get_vq_affinity)(struct vdpa_device *vdev,
>                                                  u16 idx);
> +       void (*set_irq_affinity)(struct vdpa_device *vdev,
> +                                struct irq_affinity *desc);
>
>         /* DMA ops */
>         int (*set_map)(struct vdpa_device *vdev, unsigned int asid,
> --
> 2.20.1
>


  reply	other threads:[~2022-12-16  3:59 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-05  8:41 [PATCH v2 00/11] VDUSE: Improve performance Xie Yongji
2022-12-05  8:41 ` [PATCH v2 01/11] genirq/affinity:: Export irq_create_affinity_masks() Xie Yongji
2022-12-06  8:18   ` Christoph Hellwig
2022-12-06  8:40     ` Yongji Xie
2022-12-06  8:47       ` Christoph Hellwig
2022-12-06  9:28         ` Yongji Xie
2022-12-07  5:56           ` Jason Wang
2022-12-19  7:33   ` Michael S. Tsirkin
2022-12-19  9:36     ` Yongji Xie
2023-01-27  8:22       ` Michael S. Tsirkin
2023-01-30 11:53         ` Yongji Xie
2023-02-13 11:59           ` Michael S. Tsirkin
2023-02-13 14:50             ` Yongji Xie
2023-02-13 18:53               ` Thomas Gleixner
2023-02-14  2:38                 ` Yongji Xie
2022-12-05  8:41 ` [PATCH v2 02/11] vdpa: Add set/get_vq_affinity callbacks in vdpa_config_ops Xie Yongji
2022-12-16  3:52   ` Jason Wang
2022-12-05  8:41 ` [PATCH v2 03/11] vdpa: Add set_irq_affinity callback " Xie Yongji
2022-12-16  3:58   ` Jason Wang [this message]
2022-12-19  4:38     ` Yongji Xie
2022-12-19  6:06       ` Jason Wang
2022-12-19  7:12         ` Yongji Xie
2022-12-20  6:31           ` Jason Wang
2022-12-20 10:14             ` Yongji Xie
2022-12-21  3:20               ` Jason Wang
2022-12-05  8:41 ` [PATCH v2 04/11] vduse: Refactor allocation for vduse virtqueues Xie Yongji
2022-12-16  3:59   ` Jason Wang
2022-12-05  8:41 ` [PATCH v2 05/11] vduse: Introduce bound workqueue for irq injection Xie Yongji
2022-12-16  4:02   ` Jason Wang
2022-12-19  5:04     ` Yongji Xie
2022-12-20  6:27       ` Jason Wang
2022-12-20 10:01         ` Yongji Xie
2022-12-21  3:19           ` Jason Wang
2022-12-05  8:58 ` [PATCH v2 06/11] vduse: Support automatic irq callback affinity Xie Yongji
2022-12-16  5:30   ` Jason Wang
2022-12-19  4:56     ` Yongji Xie
2022-12-20  6:32       ` Jason Wang
2022-12-20  8:21         ` Yongji Xie
2022-12-05  9:02 ` [PATCH v2 07/11] vduse: Support set/get_vq_affinity callbacks Xie Yongji
2022-12-05  9:02   ` [PATCH v2 08/11] vduse: Add sysfs interface for irq callback affinity Xie Yongji
2022-12-16  5:35     ` Jason Wang
2022-12-19  5:16       ` Yongji Xie
2022-12-20  6:29         ` Jason Wang
2022-12-20  8:24           ` Yongji Xie
2022-12-05  9:02   ` [PATCH v2 09/11] vduse: Add enable_irq_wq sysfs interface for virtqueues Xie Yongji
2022-12-16  5:43     ` Jason Wang
2022-12-19  6:39       ` Yongji Xie
2022-12-05  9:02   ` [PATCH v2 10/11] vduse: Delay iova domain creation Xie Yongji
2022-12-16  5:49     ` Jason Wang
2022-12-05  9:02   ` [PATCH v2 11/11] vduse: Support specifying bounce buffer size via sysfs Xie Yongji
2022-12-16  6:02     ` Jason Wang

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='CACGkMEvYpBz6wdOPFvRveT=0AO=g-nzaeJt3y99oqWDLHUs=qw@mail.gmail.com' \
    --to=jasowang@redhat.com \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=xieyongji@bytedance.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;
as well as URLs for NNTP newsgroup(s).