[PATCH 2/5] vdpa: introduce get_vq_dma_device()

Jason Wang posted 5 patches 2 years, 8 months ago
There is a newer version of this series
[PATCH 2/5] vdpa: introduce get_vq_dma_device()
Posted by Jason Wang 2 years, 8 months ago
This patch introduces a new method to query the dma device that is use
for a specific virtqueue.

Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 include/linux/vdpa.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h
index 6d0f5e4e82c2..3ec13aee35f5 100644
--- a/include/linux/vdpa.h
+++ b/include/linux/vdpa.h
@@ -282,6 +282,11 @@ struct vdpa_map_file {
  *				@iova: iova to be unmapped
  *				@size: size of the area
  *				Returns integer: success (0) or error (< 0)
+ * @get_vq_dma_dev:		Get the dma device for a specific
+ *				virtqueue (optional)
+ *				@vdev: vdpa device
+ *				@idx: virtqueue index
+ *				Returns pointer to structure device or error (NULL)
  * @free:			Free resources that belongs to vDPA (optional)
  *				@vdev: vdpa device
  */
@@ -341,6 +346,7 @@ struct vdpa_config_ops {
 			 u64 iova, u64 size);
 	int (*set_group_asid)(struct vdpa_device *vdev, unsigned int group,
 			      unsigned int asid);
+	struct device *(*get_vq_dma_dev)(struct vdpa_device *vdev, u16 idx);
 
 	/* Free device resources */
 	void (*free)(struct vdpa_device *vdev);
-- 
2.25.1
RE: [PATCH 2/5] vdpa: introduce get_vq_dma_device()
Posted by Eli Cohen 2 years, 8 months ago
> From: Jason Wang <jasowang@redhat.com>
> Sent: Wednesday, 11 January 2023 8:28
> To: mst@redhat.com; jasowang@redhat.com
> Cc: Eli Cohen <elic@nvidia.com>; gdawar@amd.com;
> virtualization@lists.linux-foundation.org; linux-kernel@vger.kernel.org;
> tanuj.kamde@amd.com
> Subject: [PATCH 2/5] vdpa: introduce get_vq_dma_device()
> 
> This patch introduces a new method to query the dma device that is use
> for a specific virtqueue.
> 
> Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Eli Cohen <elic@nvidia.com>
Tested-by: <elic@nvidia.com>
> ---
>  include/linux/vdpa.h | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h
> index 6d0f5e4e82c2..3ec13aee35f5 100644
> --- a/include/linux/vdpa.h
> +++ b/include/linux/vdpa.h
> @@ -282,6 +282,11 @@ struct vdpa_map_file {
>   *				@iova: iova to be unmapped
>   *				@size: size of the area
>   *				Returns integer: success (0) or error (< 0)
> + * @get_vq_dma_dev:		Get the dma device for a specific
> + *				virtqueue (optional)
> + *				@vdev: vdpa device
> + *				@idx: virtqueue index
> + *				Returns pointer to structure device or error
> (NULL)
>   * @free:			Free resources that belongs to vDPA
> (optional)
>   *				@vdev: vdpa device
>   */
> @@ -341,6 +346,7 @@ struct vdpa_config_ops {
>  			 u64 iova, u64 size);
>  	int (*set_group_asid)(struct vdpa_device *vdev, unsigned int group,
>  			      unsigned int asid);
> +	struct device *(*get_vq_dma_dev)(struct vdpa_device *vdev, u16 idx);
> 
>  	/* Free device resources */
>  	void (*free)(struct vdpa_device *vdev);
> --
> 2.25.1