提交 3f1b623a 编写于 作者: J Jason Wang 提交者: Michael S. Tsirkin

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: NJason Wang <jasowang@redhat.com>
Link: https://lore.kernel.org/r/20201023090043.14430-2-jasowang@redhat.comSigned-off-by: NMichael S. Tsirkin <mst@redhat.com>
上级 88a0d60c
...@@ -52,6 +52,16 @@ struct vdpa_device { ...@@ -52,6 +52,16 @@ struct vdpa_device {
int nvqs; int nvqs;
}; };
/**
* vDPA IOVA range - the IOVA range support by the device
* @first: start of the IOVA range
* @last: end of the IOVA range
*/
struct vdpa_iova_range {
u64 first;
u64 last;
};
/** /**
* vDPA_config_ops - operations for configuring a vDPA device. * vDPA_config_ops - operations for configuring a vDPA device.
* Note: vDPA device drivers are required to implement all of the * Note: vDPA device drivers are required to implement all of the
...@@ -151,6 +161,10 @@ struct vdpa_device { ...@@ -151,6 +161,10 @@ struct vdpa_device {
* @get_generation: Get device config generation (optional) * @get_generation: Get device config generation (optional)
* @vdev: vdpa device * @vdev: vdpa device
* Returns u32: device generation * Returns u32: device generation
* @get_iova_range: Get supported iova range (optional)
* @vdev: vdpa device
* Returns the iova range supported by
* the device.
* @set_map: Set device memory mapping (optional) * @set_map: Set device memory mapping (optional)
* Needed for device that using device * Needed for device that using device
* specific DMA translation (on-chip IOMMU) * specific DMA translation (on-chip IOMMU)
...@@ -216,6 +230,7 @@ struct vdpa_config_ops { ...@@ -216,6 +230,7 @@ struct vdpa_config_ops {
void (*set_config)(struct vdpa_device *vdev, unsigned int offset, void (*set_config)(struct vdpa_device *vdev, unsigned int offset,
const void *buf, unsigned int len); const void *buf, unsigned int len);
u32 (*get_generation)(struct vdpa_device *vdev); u32 (*get_generation)(struct vdpa_device *vdev);
struct vdpa_iova_range (*get_iova_range)(struct vdpa_device *vdev);
/* DMA ops */ /* DMA ops */
int (*set_map)(struct vdpa_device *vdev, struct vhost_iotlb *iotlb); int (*set_map)(struct vdpa_device *vdev, struct vhost_iotlb *iotlb);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册