mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Xie Yongji <xieyongji@bytedance.com>,
	mst@redhat.com, tglx@linutronix.de, hch@lst.de
Cc: virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 08/11] vdpa: Add eventfd for the vdpa callback
Date: Tue, 28 Mar 2023 14:17:50 +0800	[thread overview]
Message-ID: <e928b283-709d-c632-a294-c95b60d813ce@redhat.com> (raw)
In-Reply-To: <20230323053043.35-9-xieyongji@bytedance.com>


在 2023/3/23 13:30, Xie Yongji 写道:
> Add eventfd for the vdpa callback so that user
> can signal it directly instead of triggering the
> callback. It will be used for vhost-vdpa case.
>
> Signed-off-by: Xie Yongji <xieyongji@bytedance.com>


Acked-by: Jason Wang <jasowang@redhat.com>

Thanks


> ---
>   drivers/vhost/vdpa.c         | 2 ++
>   drivers/virtio/virtio_vdpa.c | 1 +
>   include/linux/vdpa.h         | 6 ++++++
>   3 files changed, 9 insertions(+)
>
> diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
> index 7be9d9d8f01c..9cd878e25cff 100644
> --- a/drivers/vhost/vdpa.c
> +++ b/drivers/vhost/vdpa.c
> @@ -599,9 +599,11 @@ static long vhost_vdpa_vring_ioctl(struct vhost_vdpa *v, unsigned int cmd,
>   		if (vq->call_ctx.ctx) {
>   			cb.callback = vhost_vdpa_virtqueue_cb;
>   			cb.private = vq;
> +			cb.trigger = vq->call_ctx.ctx;
>   		} else {
>   			cb.callback = NULL;
>   			cb.private = NULL;
> +			cb.trigger = NULL;
>   		}
>   		ops->set_vq_cb(vdpa, idx, &cb);
>   		vhost_vdpa_setup_vq_irq(v, idx);
> diff --git a/drivers/virtio/virtio_vdpa.c b/drivers/virtio/virtio_vdpa.c
> index f3826f42b704..2a095f37f26b 100644
> --- a/drivers/virtio/virtio_vdpa.c
> +++ b/drivers/virtio/virtio_vdpa.c
> @@ -196,6 +196,7 @@ virtio_vdpa_setup_vq(struct virtio_device *vdev, unsigned int index,
>   	/* Setup virtqueue callback */
>   	cb.callback = callback ? virtio_vdpa_virtqueue_cb : NULL;
>   	cb.private = info;
> +	cb.trigger = NULL;
>   	ops->set_vq_cb(vdpa, index, &cb);
>   	ops->set_vq_num(vdpa, index, virtqueue_get_vring_size(vq));
>   
> diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h
> index e52c9a37999c..0372b2e3d38a 100644
> --- a/include/linux/vdpa.h
> +++ b/include/linux/vdpa.h
> @@ -13,10 +13,16 @@
>    * struct vdpa_calllback - vDPA callback definition.
>    * @callback: interrupt callback function
>    * @private: the data passed to the callback function
> + * @trigger: the eventfd for the callback (Optional).
> + *           When it is set, the vDPA driver must guarantee that
> + *           signaling it is functional equivalent to triggering
> + *           the callback. Then vDPA parent can signal it directly
> + *           instead of triggering the callback.
>    */
>   struct vdpa_callback {
>   	irqreturn_t (*callback)(void *data);
>   	void *private;
> +	struct eventfd_ctx *trigger;
>   };
>   
>   /**


  reply	other threads:[~2023-03-28  6:23 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-23  5:30 [PATCH v4 00/11] VDUSE: Improve performance Xie Yongji
2023-03-23  5:30 ` [PATCH v4 01/11] lib/group_cpus: Export group_cpus_evenly() Xie Yongji
2023-04-04 18:20   ` Michael S. Tsirkin
2023-03-23  5:30 ` [PATCH v4 02/11] vdpa: Add set/get_vq_affinity callbacks in vdpa_config_ops Xie Yongji
2023-03-23  5:30 ` [PATCH v4 03/11] virtio-vdpa: Support interrupt affinity spreading mechanism Xie Yongji
2023-03-24  6:27   ` Jason Wang
2023-03-24  9:12     ` Michael S. Tsirkin
2023-03-28  6:12       ` Jason Wang
2023-03-28  3:03     ` Yongji Xie
2023-03-28  3:14       ` Jason Wang
2023-03-28  3:33         ` Yongji Xie
2023-03-28  3:44           ` Jason Wang
2023-03-28  4:04             ` Yongji Xie
2023-03-28  6:07               ` Jason Wang
2023-03-23  5:30 ` [PATCH v4 04/11] vduse: Refactor allocation for vduse virtqueues Xie Yongji
2023-03-23  5:30 ` [PATCH v4 05/11] vduse: Support set_vq_affinity callback Xie Yongji
2023-03-28  6:14   ` Jason Wang
2023-03-23  5:30 ` [PATCH v4 06/11] vduse: Support get_vq_affinity callback Xie Yongji
2023-03-28  6:15   ` Jason Wang
2023-03-23  5:30 ` [PATCH v4 07/11] vduse: Add sysfs interface for irq callback affinity Xie Yongji
2023-03-28  6:16   ` Jason Wang
2023-03-23  5:30 ` [PATCH v4 08/11] vdpa: Add eventfd for the vdpa callback Xie Yongji
2023-03-28  6:17   ` Jason Wang [this message]
2023-03-23  5:30 ` [PATCH v4 09/11] vduse: Signal vq trigger eventfd directly if possible Xie Yongji
2023-03-23  5:30 ` [PATCH v4 10/11] vduse: Delay iova domain creation Xie Yongji
2023-03-23  5:30 ` [PATCH v4 11/11] vduse: Support specifying bounce buffer size via sysfs Xie Yongji

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=e928b283-709d-c632-a294-c95b60d813ce@redhat.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

all inboxes | Powered by JetHome®