diff --git a/lib/vhost/vhost_blk.c b/lib/vhost/vhost_blk.c index 682fe26d2..01749c7d0 100644 --- a/lib/vhost/vhost_blk.c +++ b/lib/vhost/vhost_blk.c @@ -45,8 +45,6 @@ #include "vhost_internal.h" #include "vhost_iommu.h" -#define VHOST_BLK_IOVS_MAX 128 - struct spdk_vhost_blk_task { struct spdk_bdev_io *bdev_io; struct spdk_vhost_blk_dev *bvdev; @@ -56,7 +54,7 @@ struct spdk_vhost_blk_task { uint32_t length; uint16_t iovcnt; - struct iovec iovs[VHOST_BLK_IOVS_MAX]; + struct iovec iovs[SPDK_VHOST_IOVS_MAX]; }; struct spdk_vhost_blk_dev { @@ -322,7 +320,7 @@ no_bdev_vdev_worker(void *arg) { struct spdk_vhost_blk_dev *bvdev = arg; struct rte_vhost_vring *vq = &bvdev->vdev.virtqueue[0]; - struct iovec iovs[VHOST_BLK_IOVS_MAX]; + struct iovec iovs[SPDK_VHOST_IOVS_MAX]; uint32_t length; uint16_t iovcnt, req_idx; diff --git a/lib/vhost/vhost_internal.h b/lib/vhost/vhost_internal.h index 41369514f..3bc999ab2 100644 --- a/lib/vhost/vhost_internal.h +++ b/lib/vhost/vhost_internal.h @@ -59,6 +59,8 @@ #define SPDK_VHOST_SCSI_CTRLR_MAX_DEVS 8 +#define SPDK_VHOST_IOVS_MAX 128 + enum spdk_vhost_dev_type { SPDK_VHOST_DEV_T_SCSI, SPDK_VHOST_DEV_T_BLK, diff --git a/lib/vhost/vhost_scsi.c b/lib/vhost/vhost_scsi.c index b97ac6f58..22b196de5 100644 --- a/lib/vhost/vhost_scsi.c +++ b/lib/vhost/vhost_scsi.c @@ -71,9 +71,6 @@ #define VIRTIO_SCSI_EVENTQ 1 #define VIRTIO_SCSI_REQUESTQ 2 -/* Allocated iovec buffer len */ -#define SPDK_VHOST_SCSI_IOVS_LEN 128 - struct spdk_vhost_scsi_dev { struct spdk_vhost_dev vdev; struct spdk_scsi_dev *scsi_dev[SPDK_VHOST_SCSI_CTRLR_MAX_DEVS]; @@ -88,7 +85,7 @@ struct spdk_vhost_scsi_dev { struct spdk_vhost_scsi_task { struct spdk_scsi_task scsi; - struct iovec iovs[SPDK_VHOST_SCSI_IOVS_LEN]; + struct iovec iovs[SPDK_VHOST_IOVS_MAX]; union { struct virtio_scsi_cmd_resp *resp; @@ -478,7 +475,7 @@ task_data_setup(struct spdk_vhost_scsi_task *task, struct spdk_vhost_dev *vdev = &task->svdev->vdev; struct vring_desc *desc = spdk_vhost_vq_get_desc(task->vq, task->req_idx); struct iovec *iovs = task->iovs; - uint16_t iovcnt = 0, iovcnt_max = SPDK_VHOST_SCSI_IOVS_LEN; + uint16_t iovcnt = 0, iovcnt_max = SPDK_VHOST_IOVS_MAX; uint32_t len = 0; /* Sanity check. First descriptor must be readable and must have next one. */