All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yongji Xie <xieyongji@bytedance.com>
To: Jason Wang <jasowang@redhat.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Christoph Hellwig <hch@lst.de>,
	virtualization <virtualization@lists.linux-foundation.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 02/11] vdpa: Add set/get_vq_affinity callbacks in vdpa_config_ops
Date: Fri, 17 Mar 2023 15:10:08 +0800	[thread overview]
Message-ID: <CACycT3v7kzJ5f+ENzP6d_Y=wyhL4z1uaSAJH+3keTyquTAKf5A@mail.gmail.com> (raw)
In-Reply-To: <319ece63-ac4f-db05-8a55-65ecad75e437@redhat.com>

On Thu, Mar 16, 2023 at 11:27 AM Jason Wang <jasowang@redhat.com> wrote:
>
>
> 在 2023/2/28 17:41, Xie Yongji 写道:
> > This introduces set/get_vq_affinity callbacks in
> > vdpa_config_ops to support interrupt affinity
> > management for vdpa device drivers.
> >
> > Signed-off-by: Xie Yongji <xieyongji@bytedance.com>
> > Acked-by: Jason Wang <jasowang@redhat.com>
> > ---
> >   drivers/virtio/virtio_vdpa.c | 28 ++++++++++++++++++++++++++++
> >   include/linux/vdpa.h         | 13 +++++++++++++
> >   2 files changed, 41 insertions(+)
> >
> > diff --git a/drivers/virtio/virtio_vdpa.c b/drivers/virtio/virtio_vdpa.c
> > index d7f5af62ddaa..f72696b4c1c2 100644
> > --- a/drivers/virtio/virtio_vdpa.c
> > +++ b/drivers/virtio/virtio_vdpa.c
> > @@ -337,6 +337,32 @@ static const char *virtio_vdpa_bus_name(struct virtio_device *vdev)
> >       return dev_name(&vdpa->dev);
> >   }
> >
> > +static int virtio_vdpa_set_vq_affinity(struct virtqueue *vq,
> > +                                    const struct cpumask *cpu_mask)
> > +{
> > +     struct virtio_vdpa_device *vd_dev = to_virtio_vdpa_device(vq->vdev);
> > +     struct vdpa_device *vdpa = vd_dev->vdpa;
> > +     const struct vdpa_config_ops *ops = vdpa->config;
> > +     unsigned int index = vq->index;
> > +
> > +     if (ops->set_vq_affinity)
> > +             return ops->set_vq_affinity(vdpa, index, cpu_mask);
> > +
> > +     return 0;
> > +}
> > +
> > +static const struct cpumask *
> > +virtio_vdpa_get_vq_affinity(struct virtio_device *vdev, int index)
> > +{
> > +     struct vdpa_device *vdpa = vd_get_vdpa(vdev);
> > +     const struct vdpa_config_ops *ops = vdpa->config;
> > +
> > +     if (ops->get_vq_affinity)
> > +             return ops->get_vq_affinity(vdpa, index);
> > +
> > +     return NULL;
> > +}
> > +
> >   static const struct virtio_config_ops virtio_vdpa_config_ops = {
> >       .get            = virtio_vdpa_get,
> >       .set            = virtio_vdpa_set,
> > @@ -349,6 +375,8 @@ static const struct virtio_config_ops virtio_vdpa_config_ops = {
> >       .get_features   = virtio_vdpa_get_features,
> >       .finalize_features = virtio_vdpa_finalize_features,
> >       .bus_name       = virtio_vdpa_bus_name,
> > +     .set_vq_affinity = virtio_vdpa_set_vq_affinity,
> > +     .get_vq_affinity = virtio_vdpa_get_vq_affinity,
> >   };
> >
> >   static void virtio_vdpa_release_dev(struct device *_d)
> > diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h
> > index 43f59ef10cc9..d61f369f9cd6 100644
> > --- a/include/linux/vdpa.h
> > +++ b/include/linux/vdpa.h
> > @@ -250,6 +250,15 @@ struct vdpa_map_file {
> >    *                          @vdev: vdpa device
> >    *                          Returns the iova range supported by
> >    *                          the device.
> > + * @set_vq_affinity:         Set the irq affinity of virtqueue (optional)
>
>
> Nit: it's better not mention IRQ here because the virtqueue notification
> is not necessarily backed on IRQ.
>

OK.

Thanks,
Yongji

  reply	other threads:[~2023-03-17  7:10 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-28  9:40 [PATCH v3 00/11] VDUSE: Improve performance Xie Yongji
2023-02-28  9:41 ` [PATCH v3 01/11] lib/group_cpus: Export group_cpus_evenly() Xie Yongji
2023-03-10  8:51   ` Michael S. Tsirkin
2023-03-10  8:51     ` Michael S. Tsirkin
2023-03-16  9:31   ` Jason Wang
2023-03-16  9:31     ` Jason Wang
2023-02-28  9:41 ` [PATCH v3 02/11] vdpa: Add set/get_vq_affinity callbacks in vdpa_config_ops Xie Yongji
2023-03-16  3:27   ` Jason Wang
2023-03-16  3:27     ` Jason Wang
2023-03-17  7:10     ` Yongji Xie [this message]
2023-02-28  9:41 ` [PATCH v3 03/11] vdpa: Add set_irq_affinity callback " Xie Yongji
2023-03-16  4:02   ` Jason Wang
2023-03-16  4:02     ` Jason Wang
2023-03-17  7:44     ` Yongji Xie
2023-03-20  9:31       ` Jason Wang
2023-03-20  9:31         ` Jason Wang
2023-03-20 11:17         ` Yongji Xie
2023-02-28  9:41 ` [PATCH v3 04/11] vduse: Refactor allocation for vduse virtqueues Xie Yongji
2023-02-28  9:41 ` [PATCH v3 05/11] vduse: Support automatic irq callback affinity Xie Yongji
2023-02-28 11:12   ` kernel test robot
2023-02-28 11:12     ` kernel test robot
2023-03-01  1:18   ` kernel test robot
2023-03-01  1:18     ` kernel test robot
2023-03-16  9:03   ` Jason Wang
2023-03-16  9:03     ` Jason Wang
2023-03-17  7:04     ` Yongji Xie
2023-02-28  9:41 ` [PATCH v3 06/11] vduse: Support set/get_vq_affinity callbacks Xie Yongji
2023-02-28  9:41 ` [PATCH v3 07/11] vduse: Add sysfs interface for irq callback affinity Xie Yongji
2023-02-28  9:41 ` [PATCH v3 08/11] vdpa: Add eventfd for the vdpa callback Xie Yongji
2023-03-16  9:25   ` Jason Wang
2023-03-16  9:25     ` Jason Wang
2023-03-16  9:40     ` Jason Wang
2023-03-16  9:40       ` Jason Wang
2023-03-17  6:57     ` Yongji Xie
2023-02-28  9:41 ` [PATCH v3 09/11] vduse: Signal interrupt's eventfd directly in vhost-vdpa case Xie Yongji
2023-03-16  9:30   ` Jason Wang
2023-03-16  9:30     ` Jason Wang
2023-03-17  7:01     ` Yongji Xie
2023-02-28  9:41 ` [PATCH v3 10/11] vduse: Delay iova domain creation Xie Yongji
2023-02-28  9:41 ` [PATCH v3 11/11] vduse: Support specifying bounce buffer size via sysfs Xie Yongji
2023-03-10  8:49 ` [PATCH v3 00/11] VDUSE: Improve performance Michael S. Tsirkin
2023-03-10  8:49   ` Michael S. Tsirkin
2023-03-10  9:41   ` Jason Wang
2023-03-10  9:41     ` 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='CACycT3v7kzJ5f+ENzP6d_Y=wyhL4z1uaSAJH+3keTyquTAKf5A@mail.gmail.com' \
    --to=xieyongji@bytedance.com \
    --cc=hch@lst.de \
    --cc=jasowang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=tglx@linutronix.de \
    --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.