2022-02-24 21:41:31

by Gautam Dawar

[permalink] [raw]
Subject: [RFC PATCH v2 07/19] vdpa: introduce config operations for associating ASID to a virtqueue group

This patch introduces a new bus operation to allow the vDPA bus driver
to associate an ASID to a virtqueue group.

Signed-off-by: Jason Wang <[email protected]>
Signed-off-by: Gautam Dawar <[email protected]>
---
include/linux/vdpa.h | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h
index de22ca1a8ef3..7386860c3995 100644
--- a/include/linux/vdpa.h
+++ b/include/linux/vdpa.h
@@ -239,6 +239,12 @@ struct vdpa_map_file {
* @vdev: vdpa device
* Returns the iova range supported by
* the device.
+ * @set_group_asid: Set address space identifier for a
+ * virtqueue group
+ * @vdev: vdpa device
+ * @group: virtqueue group
+ * @asid: address space id for this group
+ * Returns integer: success (0) or error (< 0)
* @set_map: Set device memory mapping (optional)
* Needed for device that using device
* specific DMA translation (on-chip IOMMU)
@@ -321,6 +327,10 @@ struct vdpa_config_ops {
u64 iova, u64 size, u64 pa, u32 perm, void *opaque);
int (*dma_unmap)(struct vdpa_device *vdev, unsigned int asid,
u64 iova, u64 size);
+ int (*set_group_asid)(struct vdpa_device *vdev, unsigned int group,
+ unsigned int asid);
+
+

/* Free device resources */
void (*free)(struct vdpa_device *vdev);
--
2.25.0


2022-03-04 11:54:01

by Eugenio Perez Martin

[permalink] [raw]
Subject: Re: [RFC PATCH v2 07/19] vdpa: introduce config operations for associating ASID to a virtqueue group

On Thu, Feb 24, 2022 at 10:25 PM Gautam Dawar <[email protected]> wrote:
>
> This patch introduces a new bus operation to allow the vDPA bus driver
> to associate an ASID to a virtqueue group.
>
> Signed-off-by: Jason Wang <[email protected]>
> Signed-off-by: Gautam Dawar <[email protected]>
> ---
> include/linux/vdpa.h | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h
> index de22ca1a8ef3..7386860c3995 100644
> --- a/include/linux/vdpa.h
> +++ b/include/linux/vdpa.h
> @@ -239,6 +239,12 @@ struct vdpa_map_file {
> * @vdev: vdpa device
> * Returns the iova range supported by
> * the device.
> + * @set_group_asid: Set address space identifier for a
> + * virtqueue group
> + * @vdev: vdpa device
> + * @group: virtqueue group
> + * @asid: address space id for this group
> + * Returns integer: success (0) or error (< 0)
> * @set_map: Set device memory mapping (optional)
> * Needed for device that using device
> * specific DMA translation (on-chip IOMMU)
> @@ -321,6 +327,10 @@ struct vdpa_config_ops {
> u64 iova, u64 size, u64 pa, u32 perm, void *opaque);
> int (*dma_unmap)(struct vdpa_device *vdev, unsigned int asid,
> u64 iova, u64 size);
> + int (*set_group_asid)(struct vdpa_device *vdev, unsigned int group,
> + unsigned int asid);
> +
> +

Nit again, and Jason's patch already contained these, but I think
these two blank lines are introduced unintentionally.

>
> /* Free device resources */
> void (*free)(struct vdpa_device *vdev);
> --
> 2.25.0
>

2022-03-04 20:15:56

by Gautam Dawar

[permalink] [raw]
Subject: RE: [RFC PATCH v2 07/19] vdpa: introduce config operations for associating ASID to a virtqueue group

-----Original Message-----
From: Eugenio Perez Martin <[email protected]>
Sent: Friday, March 4, 2022 3:25 PM
To: Gautam Dawar <[email protected]>
Cc: Gautam Dawar <[email protected]>; Martin Petrus Hubertus Habets <[email protected]>; Harpreet Singh Anand <[email protected]>; Tanuj Murlidhar Kamde <[email protected]>; Jason Wang <[email protected]>; Michael S. Tsirkin <[email protected]>; Zhu Lingshan <[email protected]>; Stefano Garzarella <[email protected]>; Xie Yongji <[email protected]>; Eli Cohen <[email protected]>; Si-Wei Liu <[email protected]>; Parav Pandit <[email protected]>; Longpeng <[email protected]>; virtualization <[email protected]>; [email protected]; kvm list <[email protected]>; [email protected]
Subject: Re: [RFC PATCH v2 07/19] vdpa: introduce config operations for associating ASID to a virtqueue group

On Thu, Feb 24, 2022 at 10:25 PM Gautam Dawar <[email protected]> wrote:
>
> This patch introduces a new bus operation to allow the vDPA bus driver
> to associate an ASID to a virtqueue group.
>
> Signed-off-by: Jason Wang <[email protected]>
> Signed-off-by: Gautam Dawar <[email protected]>
> ---
> include/linux/vdpa.h | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h index
> de22ca1a8ef3..7386860c3995 100644
> --- a/include/linux/vdpa.h
> +++ b/include/linux/vdpa.h
> @@ -239,6 +239,12 @@ struct vdpa_map_file {
> * @vdev: vdpa device
> * Returns the iova range supported by
> * the device.
> + * @set_group_asid: Set address space identifier for a
> + * virtqueue group
> + * @vdev: vdpa device
> + * @group: virtqueue group
> + * @asid: address space id for this group
> + * Returns integer: success (0) or error (< 0)
> * @set_map: Set device memory mapping (optional)
> * Needed for device that using device
> * specific DMA translation (on-chip IOMMU)
> @@ -321,6 +327,10 @@ struct vdpa_config_ops {
> u64 iova, u64 size, u64 pa, u32 perm, void *opaque);
> int (*dma_unmap)(struct vdpa_device *vdev, unsigned int asid,
> u64 iova, u64 size);
> + int (*set_group_asid)(struct vdpa_device *vdev, unsigned int group,
> + unsigned int asid);
> +
> +

Nit again, and Jason's patch already contained these, but I think these two blank lines are introduced unintentionally.
[GD>>] Will fix this in the next revision.

>
> /* Free device resources */
> void (*free)(struct vdpa_device *vdev);
> --
> 2.25.0
>