vhost: add device type field
Change-Id: I848c8c5dcf837c11e052bb03cba962a843f28778 Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com> Reviewed-on: https://review.gerrithub.io/363088 Reviewed-by: Jim Harris <james.r.harris@intel.com> Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
parent
3671543a5b
commit
0888dd4cc6
@ -45,6 +45,10 @@
|
|||||||
|
|
||||||
#define MAX_VHOST_VRINGS 256
|
#define MAX_VHOST_VRINGS 256
|
||||||
|
|
||||||
|
enum spdk_vhost_dev_type {
|
||||||
|
SPDK_VHOST_DEV_T_SCSI,
|
||||||
|
};
|
||||||
|
|
||||||
struct spdk_vhost_dev {
|
struct spdk_vhost_dev {
|
||||||
struct rte_vhost_memory *mem;
|
struct rte_vhost_memory *mem;
|
||||||
char *name;
|
char *name;
|
||||||
@ -54,6 +58,8 @@ struct spdk_vhost_dev {
|
|||||||
int32_t lcore;
|
int32_t lcore;
|
||||||
uint64_t cpumask;
|
uint64_t cpumask;
|
||||||
|
|
||||||
|
enum spdk_vhost_dev_type type;
|
||||||
|
|
||||||
uint16_t num_queues;
|
uint16_t num_queues;
|
||||||
uint64_t negotiated_features;
|
uint64_t negotiated_features;
|
||||||
struct rte_vhost_vring virtqueue[MAX_VHOST_VRINGS] __attribute((aligned(SPDK_CACHE_LINE_SIZE)));
|
struct rte_vhost_vring virtqueue[MAX_VHOST_VRINGS] __attribute((aligned(SPDK_CACHE_LINE_SIZE)));
|
||||||
|
@ -639,6 +639,8 @@ spdk_vhost_scsi_dev_construct(const char *name, uint64_t cpumask)
|
|||||||
vdev->cpumask = cpumask;
|
vdev->cpumask = cpumask;
|
||||||
vdev->lcore = -1;
|
vdev->lcore = -1;
|
||||||
|
|
||||||
|
vdev->type = SPDK_VHOST_DEV_T_SCSI;
|
||||||
|
|
||||||
rc = spdk_vhost_dev_register(vdev, &spdk_vhost_scsi_device_backend);
|
rc = spdk_vhost_dev_register(vdev, &spdk_vhost_scsi_device_backend);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
free(vdev->name);
|
free(vdev->name);
|
||||||
|
Loading…
Reference in New Issue
Block a user