Commit 1238cfb9 authored by Jim Harris's avatar Jim Harris
Browse files

vhost: use SPDK_VHOST_IOVS_MAX for scsi and blk

parent 8b5b1abe
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -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;

+2 −0
Original line number Diff line number Diff line
@@ -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,
+2 −5
Original line number Diff line number Diff line
@@ -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. */