summaryrefslogtreecommitdiff
path: root/examples/vhost_scsi
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2018-01-02 09:31:36 +0000
committerFerruh Yigit <ferruh.yigit@intel.com>2018-01-16 18:47:49 +0100
commit6c299bb7322fc7c506389a951a2500a92ba9253e (patch)
tree4eaebf70f1d62df5d3271b5b3119f3896595666d /examples/vhost_scsi
parent413a8fee30ad56e2ac64014b99338165c8b85a0d (diff)
downloaddpdk-6c299bb7322fc7c506389a951a2500a92ba9253e.zip
dpdk-6c299bb7322fc7c506389a951a2500a92ba9253e.tar.gz
dpdk-6c299bb7322fc7c506389a951a2500a92ba9253e.tar.xz
vhost: introduce vring call API
Users of librte_vhost currently implement the vring call operation themselves. Each caller performs the operation slightly differently. This patch introduces a new librte_vhost API called rte_vhost_vring_call() that performs the operation so that vhost-user applications don't have to duplicate it. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com> Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
Diffstat (limited to 'examples/vhost_scsi')
-rw-r--r--examples/vhost_scsi/vhost_scsi.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/vhost_scsi/vhost_scsi.c b/examples/vhost_scsi/vhost_scsi.c
index 38f5d82..da01ad3 100644
--- a/examples/vhost_scsi/vhost_scsi.c
+++ b/examples/vhost_scsi/vhost_scsi.c
@@ -81,7 +81,7 @@ descriptor_is_wr(struct vring_desc *cur_desc)
}
static void
-submit_completion(struct vhost_scsi_task *task)
+submit_completion(struct vhost_scsi_task *task, uint32_t q_idx)
{
struct rte_vhost_vring *vq;
struct vring_used *used;
@@ -102,7 +102,7 @@ submit_completion(struct vhost_scsi_task *task)
/* Send an interrupt back to the guest VM so that it knows
* a completion is ready to be processed.
*/
- eventfd_write(vq->callfd, (eventfd_t)1);
+ rte_vhost_vring_call(task->bdev->vid, q_idx);
}
static void
@@ -234,7 +234,7 @@ process_requestq(struct vhost_scsi_ctrlr *ctrlr, uint32_t q_idx)
task->resp->status = 0;
task->resp->resid = 0;
}
- submit_completion(task);
+ submit_completion(task, q_idx);
rte_free(task);
}
}