From: Jason Wang <jasowang@redhat.com>
To: Yongji Xie <xieyongji@bytedance.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
virtualization <virtualization@lists.linux-foundation.org>,
Christoph Hellwig <hch@lst.de>,
"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH v2 03/11] vdpa: Add set_irq_affinity callback in vdpa_config_ops
Date: Wed, 21 Dec 2022 11:20:20 +0800 [thread overview]
Message-ID: <CACGkMEvMCqvFwWYOd1U2Z8YXBkxSHK9QX8fWVLdU6oo9WWNRZQ@mail.gmail.com> (raw)
In-Reply-To: <CACycT3vP42dpq5NXFJ-Qua=MKsW9visq+mykS7H6i9gUcqo4NQ@mail.gmail.com>
On Tue, Dec 20, 2022 at 6:14 PM Yongji Xie <xieyongji@bytedance.com> wrote:
>
> On Tue, Dec 20, 2022 at 2:31 PM Jason Wang <jasowang@redhat.com> wrote:
> >
> > On Mon, Dec 19, 2022 at 3:12 PM Yongji Xie <xieyongji@bytedance.com> wrote:
> > >
> > > On Mon, Dec 19, 2022 at 2:06 PM Jason Wang <jasowang@redhat.com> wrote:
> > > >
> > > > On Mon, Dec 19, 2022 at 12:39 PM Yongji Xie <xieyongji@bytedance.com> wrote:
> > > > >
> > > > > On Fri, Dec 16, 2022 at 11:58 AM Jason Wang <jasowang@redhat.com> wrote:
> > > > > >
> > > > > > 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.
> > > > >
> > > > > I don't get why we need to do this in vhost-vDPA? Should this be done in VM?
> > > >
> > > > If I was not wrong, this tries to set affinity on the host instead of
> > > > the guest. More below.
> > > >
> > >
> > > Yes, it's host stuff. This is used by the virtio device driver to pass
> > > the irq affinity hint (tell which irq vectors don't need affinity
> > > management) to the irq affinity manager. In the VM case, it should
> > > only be related to the guest's virtio device driver and pci irq
> > > affinity manager. So I don't get why we need to do this in vhost-vDPA.
> >
> > It's not necessarily the VM, do we have the same requirement for
> > userspace (like DPDK) drivers?
> >
>
> IIUC the vhost-vdpa's irq callback just signals the eventfd. I didn't
> see how to use the irq affinity hint in vdpa device driver. The real
> irq callback should be called in DPDK internally.
I agree.
Thanks
>
> Thanks,
> Yongji
>
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
next prev parent reply other threads:[~2022-12-21 3:20 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20221205084127.535-1-xieyongji@bytedance.com>
[not found] ` <20221205084127.535-2-xieyongji@bytedance.com>
2022-12-06 8:18 ` [PATCH v2 01/11] genirq/affinity:: Export irq_create_affinity_masks() Christoph Hellwig
[not found] ` <CACycT3sXHGQt_V=rgwvEv4v8+oUaAOu1T=tWrKePdybMHagzng@mail.gmail.com>
2022-12-06 8:47 ` Christoph Hellwig
[not found] ` <CACycT3uk4FCswFj8VqqPDgdEM73iqMnYSL8j6DYxCiy1FNSvHQ@mail.gmail.com>
2022-12-07 5:56 ` Jason Wang
2022-12-19 7:33 ` Michael S. Tsirkin
[not found] ` <CACycT3utDJFZtWzqCUXJaqRjkCXPMTAi+VJd3g6dw25vWqaduw@mail.gmail.com>
2023-01-27 8:22 ` Michael S. Tsirkin
[not found] ` <CACycT3u=vULuZ9-ZakBjxmbu88iUb+xB2mHJUnHA_8SuUV7H4w@mail.gmail.com>
2023-02-13 11:59 ` Michael S. Tsirkin
[not found] ` <CACycT3uY1dfP=5d1go+POh7-J1tUMW+9RXi92KtcFJYMzq-bOQ@mail.gmail.com>
2023-02-13 18:53 ` Thomas Gleixner
[not found] ` <20221205084127.535-3-xieyongji@bytedance.com>
2022-12-16 3:52 ` [PATCH v2 02/11] vdpa: Add set/get_vq_affinity callbacks in vdpa_config_ops Jason Wang
[not found] ` <20221205084127.535-4-xieyongji@bytedance.com>
2022-12-16 3:58 ` [PATCH v2 03/11] vdpa: Add set_irq_affinity callback " Jason Wang
[not found] ` <CACycT3u237c2jHaYeoPQoXK1eb4FDOJJcc6_21N3m=aBHsDwFg@mail.gmail.com>
2022-12-19 6:06 ` Jason Wang
[not found] ` <CACycT3t1AVyDjZ-HzWPHxfhur=hh9aYW3=Fp7ML8YieBbwDa+Q@mail.gmail.com>
2022-12-20 6:31 ` Jason Wang
[not found] ` <CACycT3vP42dpq5NXFJ-Qua=MKsW9visq+mykS7H6i9gUcqo4NQ@mail.gmail.com>
2022-12-21 3:20 ` Jason Wang [this message]
[not found] ` <20221205084127.535-5-xieyongji@bytedance.com>
2022-12-16 3:59 ` [PATCH v2 04/11] vduse: Refactor allocation for vduse virtqueues Jason Wang
[not found] ` <20221205084127.535-6-xieyongji@bytedance.com>
2022-12-16 4:02 ` [PATCH v2 05/11] vduse: Introduce bound workqueue for irq injection Jason Wang
[not found] ` <CACycT3tyR0zTfTgE3BhL0GZqWAj2KDC0Q+tfm+rV=wbgHPOhFA@mail.gmail.com>
2022-12-20 6:27 ` Jason Wang
[not found] ` <CACycT3vMktY1g57NhRMnAD0_F45MxpM=730reN-U_qqaN=daDg@mail.gmail.com>
2022-12-21 3:19 ` Jason Wang
[not found] ` <20221205085846.741-1-xieyongji@bytedance.com>
2022-12-16 5:30 ` [PATCH v2 06/11] vduse: Support automatic irq callback affinity Jason Wang
[not found] ` <CACycT3vu0_xCG7SvdP-zkZkuOGdudx2apOwi3CZ4MOFSe-XAFg@mail.gmail.com>
2022-12-20 6:32 ` Jason Wang
[not found] ` <20221205090243.791-1-xieyongji@bytedance.com>
[not found] ` <20221205090243.791-2-xieyongji@bytedance.com>
2022-12-16 5:35 ` [PATCH v2 08/11] vduse: Add sysfs interface for " Jason Wang
[not found] ` <CACycT3sGf9-zvR_XGEJuPVQhLSp4zsiO1x7RZ5KHBKbE5Deu2Q@mail.gmail.com>
2022-12-20 6:29 ` Jason Wang
[not found] ` <20221205090243.791-3-xieyongji@bytedance.com>
2022-12-16 5:43 ` [PATCH v2 09/11] vduse: Add enable_irq_wq sysfs interface for virtqueues Jason Wang
[not found] ` <20221205090243.791-4-xieyongji@bytedance.com>
2022-12-16 5:49 ` [PATCH v2 10/11] vduse: Delay iova domain creation Jason Wang
[not found] ` <20221205090243.791-5-xieyongji@bytedance.com>
2022-12-16 6:02 ` [PATCH v2 11/11] vduse: Support specifying bounce buffer size via sysfs 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=CACGkMEvMCqvFwWYOd1U2Z8YXBkxSHK9QX8fWVLdU6oo9WWNRZQ@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).