[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200617032947.6371-3-jasowang@redhat.com>
Date: Wed, 17 Jun 2020 11:29:45 +0800
From: Jason Wang <jasowang@...hat.com>
To: mst@...hat.com, jasowang@...hat.com,
virtualization@...ts.linux-foundation.org,
linux-kernel@...r.kernel.org
Cc: rob.miller@...adcom.com, lingshan.zhu@...el.com,
eperezma@...hat.com, lulu@...hat.com, shahafs@...lanox.com,
hanand@...inx.com, mhabets@...arflare.com, gdawar@...inx.com,
saugatm@...inx.com, vmireyno@...vell.com,
zhangweining@...jie.com.cn, eli@...lanox.com
Subject: [PATCH 2/4] vdpa_sim: implement get_iova_range bus operation
This patch implements get_iova_range method for vdpa_sim. Since
vdpa_sim is a software device, simply advertise a [0ULL, ~0ULL] range.
Signed-off-by: Jason Wang <jasowang@...hat.com>
---
drivers/vdpa/vdpa_sim/vdpa_sim.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c
index c7334cc65bb2..b3a6dc5b9984 100644
--- a/drivers/vdpa/vdpa_sim/vdpa_sim.c
+++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c
@@ -524,6 +524,16 @@ static u32 vdpasim_get_generation(struct vdpa_device *vdpa)
return vdpasim->generation;
}
+static struct vdpa_iova_range vdpasim_get_iova_range(struct vdpa_device *vdpa)
+{
+ struct vdpa_iova_range range;
+
+ range.start = 0ULL;
+ range.end = ~0ULL;
+
+ return range;
+}
+
static int vdpasim_set_map(struct vdpa_device *vdpa,
struct vhost_iotlb *iotlb)
{
@@ -597,6 +607,7 @@ static const struct vdpa_config_ops vdpasim_net_config_ops = {
.get_config = vdpasim_get_config,
.set_config = vdpasim_set_config,
.get_generation = vdpasim_get_generation,
+ .get_iova_range = vdpasim_get_iova_range,
.set_map = vdpasim_set_map,
.dma_map = vdpasim_dma_map,
.dma_unmap = vdpasim_dma_unmap,
--
2.20.1
Powered by blists - more mailing lists