[RFC 21/27] vhost: add VDUSE callback for IRQ injection
Xia, Chenbo
chenbo.xia at intel.com
Tue May 9 07:33:54 CEST 2023
> -----Original Message-----
> From: Maxime Coquelin <maxime.coquelin at redhat.com>
> Sent: Friday, March 31, 2023 11:43 PM
> To: dev at dpdk.org; david.marchand at redhat.com; Xia, Chenbo
> <chenbo.xia at intel.com>; mkp at redhat.com; fbl at redhat.com;
> jasowang at redhat.com; Liang, Cunming <cunming.liang at intel.com>; Xie, Yongji
> <xieyongji at bytedance.com>; echaudro at redhat.com; eperezma at redhat.com;
> amorenoz at redhat.com
> Cc: Maxime Coquelin <maxime.coquelin at redhat.com>
> Subject: [RFC 21/27] vhost: add VDUSE callback for IRQ injection
>
> This patch implements the VDUSE callback for kicking
> virtqueues.
>
> Signed-off-by: Maxime Coquelin <maxime.coquelin at redhat.com>
> ---
> lib/vhost/vduse.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/lib/vhost/vduse.c b/lib/vhost/vduse.c
> index ff4c9e72f1..afa8a39498 100644
> --- a/lib/vhost/vduse.c
> +++ b/lib/vhost/vduse.c
> @@ -32,6 +32,12 @@
> (1ULL << VIRTIO_F_IN_ORDER) | \
> (1ULL << VIRTIO_F_IOMMU_PLATFORM))
>
> +static int
> +vduse_inject_irq(struct virtio_net *dev, struct vhost_virtqueue *vq)
> +{
> + return ioctl(dev->vduse_dev_fd, VDUSE_VQ_INJECT_IRQ, &vq->index);
> +}
> +
> static void
> vduse_iotlb_remove_notify(uint64_t addr, uint64_t offset, uint64_t size)
> {
> @@ -96,6 +102,7 @@ vduse_iotlb_miss(struct virtio_net *dev, uint64_t iova,
> uint8_t perm __rte_unuse
> static struct vhost_backend_ops vduse_backend_ops = {
> .iotlb_miss = vduse_iotlb_miss,
> .iotlb_remove_notify = vduse_iotlb_remove_notify,
> + .inject_irq = vduse_inject_irq,
> };
>
> int
> --
> 2.39.2
Reviewed-by: Chenbo Xia <chenbo.xia at intel.com>
More information about the dev
mailing list