Skip to content

Commit 70a62fc

Browse files
jasowangmstsirkin
authored andcommitted
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>
1 parent 1b48dc0 commit 70a62fc

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

drivers/vdpa/vdpa_sim/vdpa_sim.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,16 @@ static u32 vdpasim_get_generation(struct vdpa_device *vdpa)
574574
return vdpasim->generation;
575575
}
576576

577+
static struct vdpa_iova_range vdpasim_get_iova_range(struct vdpa_device *vdpa)
578+
{
579+
struct vdpa_iova_range range = {
580+
.first = 0ULL,
581+
.last = ULLONG_MAX,
582+
};
583+
584+
return range;
585+
}
586+
577587
static int vdpasim_set_map(struct vdpa_device *vdpa,
578588
struct vhost_iotlb *iotlb)
579589
{
@@ -657,6 +667,7 @@ static const struct vdpa_config_ops vdpasim_net_config_ops = {
657667
.get_config = vdpasim_get_config,
658668
.set_config = vdpasim_set_config,
659669
.get_generation = vdpasim_get_generation,
670+
.get_iova_range = vdpasim_get_iova_range,
660671
.dma_map = vdpasim_dma_map,
661672
.dma_unmap = vdpasim_dma_unmap,
662673
.free = vdpasim_free,
@@ -683,6 +694,7 @@ static const struct vdpa_config_ops vdpasim_net_batch_config_ops = {
683694
.get_config = vdpasim_get_config,
684695
.set_config = vdpasim_set_config,
685696
.get_generation = vdpasim_get_generation,
697+
.get_iova_range = vdpasim_get_iova_range,
686698
.set_map = vdpasim_set_map,
687699
.free = vdpasim_free,
688700
};

0 commit comments

Comments
 (0)