Commit 0888dd4c authored by Pawel Wodkowski's avatar Pawel Wodkowski Committed by Daniel Verkamp
Browse files

vhost: add device type field



Change-Id: I848c8c5dcf837c11e052bb03cba962a843f28778
Signed-off-by: default avatarPawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/363088


Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent 3671543a
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -45,6 +45,10 @@

#define MAX_VHOST_VRINGS	256

enum spdk_vhost_dev_type {
	SPDK_VHOST_DEV_T_SCSI,
};

struct spdk_vhost_dev {
	struct rte_vhost_memory *mem;
	char *name;
@@ -54,6 +58,8 @@ struct spdk_vhost_dev {
	int32_t lcore;
	uint64_t cpumask;

	enum spdk_vhost_dev_type type;

	uint16_t num_queues;
	uint64_t negotiated_features;
	struct rte_vhost_vring virtqueue[MAX_VHOST_VRINGS] __attribute((aligned(SPDK_CACHE_LINE_SIZE)));
+2 −0
Original line number Diff line number Diff line
@@ -639,6 +639,8 @@ spdk_vhost_scsi_dev_construct(const char *name, uint64_t cpumask)
	vdev->cpumask = cpumask;
	vdev->lcore = -1;

	vdev->type = SPDK_VHOST_DEV_T_SCSI;

	rc = spdk_vhost_dev_register(vdev, &spdk_vhost_scsi_device_backend);
	if (rc < 0) {
		free(vdev->name);