vdpa_sim: implement get_iova_range()
This implements a sample get_iova_range() for the simulator which advertise [0, ULLONG_MAX] as the valid range. Signed-off-by: Jason Wang <jasowang@redhat.com> Link: https://lore.kernel.org/r/20201023090043.14430-4-jasowang@redhat.com Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
committed by
Michael S. Tsirkin
parent
1b48dc03e5
commit
70a62fce26
@@ -574,6 +574,16 @@ static u32 vdpasim_get_generation(struct vdpa_device *vdpa)
|
|||||||
return vdpasim->generation;
|
return vdpasim->generation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static struct vdpa_iova_range vdpasim_get_iova_range(struct vdpa_device *vdpa)
|
||||||
|
{
|
||||||
|
struct vdpa_iova_range range = {
|
||||||
|
.first = 0ULL,
|
||||||
|
.last = ULLONG_MAX,
|
||||||
|
};
|
||||||
|
|
||||||
|
return range;
|
||||||
|
}
|
||||||
|
|
||||||
static int vdpasim_set_map(struct vdpa_device *vdpa,
|
static int vdpasim_set_map(struct vdpa_device *vdpa,
|
||||||
struct vhost_iotlb *iotlb)
|
struct vhost_iotlb *iotlb)
|
||||||
{
|
{
|
||||||
@@ -657,6 +667,7 @@ static const struct vdpa_config_ops vdpasim_net_config_ops = {
|
|||||||
.get_config = vdpasim_get_config,
|
.get_config = vdpasim_get_config,
|
||||||
.set_config = vdpasim_set_config,
|
.set_config = vdpasim_set_config,
|
||||||
.get_generation = vdpasim_get_generation,
|
.get_generation = vdpasim_get_generation,
|
||||||
|
.get_iova_range = vdpasim_get_iova_range,
|
||||||
.dma_map = vdpasim_dma_map,
|
.dma_map = vdpasim_dma_map,
|
||||||
.dma_unmap = vdpasim_dma_unmap,
|
.dma_unmap = vdpasim_dma_unmap,
|
||||||
.free = vdpasim_free,
|
.free = vdpasim_free,
|
||||||
@@ -683,6 +694,7 @@ static const struct vdpa_config_ops vdpasim_net_batch_config_ops = {
|
|||||||
.get_config = vdpasim_get_config,
|
.get_config = vdpasim_get_config,
|
||||||
.set_config = vdpasim_set_config,
|
.set_config = vdpasim_set_config,
|
||||||
.get_generation = vdpasim_get_generation,
|
.get_generation = vdpasim_get_generation,
|
||||||
|
.get_iova_range = vdpasim_get_iova_range,
|
||||||
.set_map = vdpasim_set_map,
|
.set_map = vdpasim_set_map,
|
||||||
.free = vdpasim_free,
|
.free = vdpasim_free,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user