Skip to content

Commit 3f1b623

Browse files
jasowangmstsirkin
authored andcommitted
vdpa: introduce config op to get valid iova range
This patch introduce a config op to get valid iova range from the vDPA device. Signed-off-by: Jason Wang <jasowang@redhat.com> Link: https://lore.kernel.org/r/20201023090043.14430-2-jasowang@redhat.com Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
1 parent 88a0d60 commit 3f1b623

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

include/linux/vdpa.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,16 @@ struct vdpa_device {
5252
int nvqs;
5353
};
5454

55+
/**
56+
* vDPA IOVA range - the IOVA range support by the device
57+
* @first: start of the IOVA range
58+
* @last: end of the IOVA range
59+
*/
60+
struct vdpa_iova_range {
61+
u64 first;
62+
u64 last;
63+
};
64+
5565
/**
5666
* vDPA_config_ops - operations for configuring a vDPA device.
5767
* Note: vDPA device drivers are required to implement all of the
@@ -151,6 +161,10 @@ struct vdpa_device {
151161
* @get_generation: Get device config generation (optional)
152162
* @vdev: vdpa device
153163
* Returns u32: device generation
164+
* @get_iova_range: Get supported iova range (optional)
165+
* @vdev: vdpa device
166+
* Returns the iova range supported by
167+
* the device.
154168
* @set_map: Set device memory mapping (optional)
155169
* Needed for device that using device
156170
* specific DMA translation (on-chip IOMMU)
@@ -216,6 +230,7 @@ struct vdpa_config_ops {
216230
void (*set_config)(struct vdpa_device *vdev, unsigned int offset,
217231
const void *buf, unsigned int len);
218232
u32 (*get_generation)(struct vdpa_device *vdev);
233+
struct vdpa_iova_range (*get_iova_range)(struct vdpa_device *vdev);
219234

220235
/* DMA ops */
221236
int (*set_map)(struct vdpa_device *vdev, struct vhost_iotlb *iotlb);

0 commit comments

Comments
 (0)