[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DM8PR12MB5400537E96A63AD16F1C118CABC09@DM8PR12MB5400.namprd12.prod.outlook.com>
Date: Sun, 15 Jan 2023 11:06:55 +0000
From: Eli Cohen <elic@...dia.com>
To: Jason Wang <jasowang@...hat.com>, "mst@...hat.com" <mst@...hat.com>
CC: "gdawar@....com" <gdawar@....com>,
"virtualization@...ts.linux-foundation.org"
<virtualization@...ts.linux-foundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"tanuj.kamde@....com" <tanuj.kamde@....com>
Subject: RE: [PATCH 3/5] virtio-vdpa: support per vq dma device
> From: Jason Wang <jasowang@...hat.com>
> Sent: Wednesday, 11 January 2023 8:28
> To: mst@...hat.com; jasowang@...hat.com
> Cc: Eli Cohen <elic@...dia.com>; gdawar@....com;
> virtualization@...ts.linux-foundation.org; linux-kernel@...r.kernel.org;
> tanuj.kamde@....com
> Subject: [PATCH 3/5] virtio-vdpa: support per vq dma device
>
> This patch adds the support of per vq dma device for virito-vDPA. vDPA
> parents then are allowed to use different DMA devices. This is useful
> for the parents that have software or emulated virtqueues.
>
> Signed-off-by: Jason Wang <jasowang@...hat.com>
Reviewed-by: Eli Cohen <elic@...dia.com>
Tested-by: <elic@...dia.com>
> ---
> drivers/virtio/virtio_vdpa.c | 13 ++++++++++---
> 1 file changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/virtio/virtio_vdpa.c b/drivers/virtio/virtio_vdpa.c
> index 9670cc79371d..d7f5af62ddaa 100644
> --- a/drivers/virtio/virtio_vdpa.c
> +++ b/drivers/virtio/virtio_vdpa.c
> @@ -135,6 +135,7 @@ virtio_vdpa_setup_vq(struct virtio_device *vdev,
> unsigned int index,
> {
> struct virtio_vdpa_device *vd_dev = to_virtio_vdpa_device(vdev);
> struct vdpa_device *vdpa = vd_get_vdpa(vdev);
> + struct device *dma_dev;
> const struct vdpa_config_ops *ops = vdpa->config;
> struct virtio_vdpa_vq_info *info;
> struct vdpa_callback cb;
> @@ -175,9 +176,15 @@ virtio_vdpa_setup_vq(struct virtio_device *vdev,
> unsigned int index,
>
> /* Create the vring */
> align = ops->get_vq_align(vdpa);
> - vq = vring_create_virtqueue(index, max_num, align, vdev,
> - true, may_reduce_num, ctx,
> - virtio_vdpa_notify, callback, name);
> +
> + if (ops->get_vq_dma_dev)
> + dma_dev = ops->get_vq_dma_dev(vdpa, index);
> + else
> + dma_dev = vdpa_get_dma_dev(vdpa);
> + vq = vring_create_virtqueue_dma(index, max_num, align, vdev,
> + true, may_reduce_num, ctx,
> + virtio_vdpa_notify, callback,
> + name, dma_dev);
> if (!vq) {
> err = -ENOMEM;
> goto error_new_virtqueue;
> --
> 2.25.1
Powered by blists - more mailing lists