This commit introduced IFC operations for vdpa, which complys to
virtio_mdev and vhost_mdev interfaces, handles IFC VF
initialization, configuration and removal.
Signed-off-by: Zhu Lingshan <lingshan.zhu@xxxxxxxxx>
---
drivers/vhost/ifcvf/ifcvf_main.c | 605 +++++++++++++++++++++++++++++++++++++++
1 file changed, 605 insertions(+)
create mode 100644 drivers/vhost/ifcvf/ifcvf_main.c
diff --git a/drivers/vhost/ifcvf/ifcvf_main.c b/drivers/vhost/ifcvf/ifcvf_main.c
new file mode 100644
index 0000000..7165457
--- /dev/null
+++ b/drivers/vhost/ifcvf/ifcvf_main.c
@@ -0,0 +1,605 @@
+ for (i = 0; i < IFCVF_MAX_QUEUE_PAIRS * 2; i++) {
+ if (!vf->vring[i].ready) {
+ IFC_ERR(ifcvf->dev,
+ "Failed to start datapath, vring %d not ready.\n", i);
+ return -EINVAL;
+ }
+
+ if (!vf->vring[i].size) {
+ IFC_ERR(ifcvf->dev,
+ "Failed to start datapath, vring %d size is zero.\n", i);
+ return -EINVAL;
+ }
+
+ if (!vf->vring[i].desc || !vf->vring[i].avail ||
+ !vf->vring[i].used) {
+ IFC_ERR(ifcvf->dev,
+ "Failed to start datapath, "
+ "invaild value for vring %d desc,"
+ "avail_idx or usex_idx.\n", i);
Attachment:
signature.asc
Description: Message signed with OpenPGP