vhost/nvme: fix the compliation issue with internal vhost library

For the NVMe interface virtualization, we are developing the
MUSER as the replacement for vhost_nvme target, before the
MUSER solution be merged to SPDK, here we still maintain
vhost_nvme for the coming 20.04 release.

Change-Id: Ife117474330bf9e3fab1071dae2beb0f6897dff8
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1936
Community-CI: Mellanox Build Bot
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Changpeng Liu 2020-04-20 04:36:35 -04:00 committed by Tomasz Zawadzki
parent d09be67d3f
commit 55fe098f9d

View File

@ -247,14 +247,22 @@ spdk_vhost_nvme_get_queue_head(struct spdk_vhost_nvme_dev *nvme, uint32_t offset
return 0; return 0;
} }
static void *
vhost_nvme_gpa_to_vva(void *priv, uint64_t addr, uint64_t len)
{
struct spdk_vhost_session *vsession = priv;
return vhost_gpa_to_vva(vsession, addr, len);
}
static int static int
spdk_vhost_nvme_map_prps(struct spdk_vhost_nvme_dev *nvme, struct spdk_nvme_cmd *cmd, spdk_vhost_nvme_map_prps(struct spdk_vhost_nvme_dev *nvme, struct spdk_nvme_cmd *cmd,
struct spdk_vhost_nvme_task *task, uint32_t len) struct spdk_vhost_nvme_task *task, uint32_t len)
{ {
int err; int err;
err = spdk_nvme_map_prps(nvme->session, cmd, task->iovs, len, 4096, err = spdk_nvme_map_prps(nvme->vsession, cmd, task->iovs, len, 4096,
vhost_gpa_to_vva); vhost_nvme_gpa_to_vva);
if (spdk_unlikely(err < 0)) { if (spdk_unlikely(err < 0)) {
return err; return err;
} }
@ -1069,7 +1077,7 @@ spdk_vhost_nvme_start(struct spdk_vhost_session *vsession)
return -1; return -1;
} }
return vhost_session_send_event(pg, vsession, spdk_vhost_nvme_start_cb, return vhost_session_send_event(vsession, spdk_vhost_nvme_start_cb,
3, "start session"); 3, "start session");
} }
@ -1204,7 +1212,8 @@ spdk_vhost_nvme_write_config_json(struct spdk_vhost_dev *vdev, struct spdk_json_
spdk_json_write_named_object_begin(w, "params"); spdk_json_write_named_object_begin(w, "params");
spdk_json_write_named_string(w, "ctrlr", nvme->vdev.name); spdk_json_write_named_string(w, "ctrlr", nvme->vdev.name);
spdk_json_write_named_uint32(w, "io_queues", nvme->num_io_queues); spdk_json_write_named_uint32(w, "io_queues", nvme->num_io_queues);
spdk_json_write_named_string(w, "cpumask", spdk_cpuset_fmt(&nvme->vdev.cpumask)); spdk_json_write_named_string(w, "cpumask",
spdk_cpuset_fmt(spdk_thread_get_cpumask(nvme->vdev.thread)));
spdk_json_write_object_end(w); spdk_json_write_object_end(w);
spdk_json_write_object_end(w); spdk_json_write_object_end(w);