X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fvhost_blk%2Fvhost_blk.h;h=540998eb1bef20fe06d192b9025f50819dd4cec0;hb=01863b9d2354c6738581c68fbc5cda84b30862d8;hp=17258d284b74595591c3adb23cf3163acd063ccf;hpb=be848992298b7a64a161487600a4070e52b9d26d;p=dpdk.git diff --git a/examples/vhost_blk/vhost_blk.h b/examples/vhost_blk/vhost_blk.h index 17258d284b..540998eb1b 100644 --- a/examples/vhost_blk/vhost_blk.h +++ b/examples/vhost_blk/vhost_blk.h @@ -30,23 +30,23 @@ struct vring_packed_desc { #endif struct vhost_blk_queue { - struct rte_vhost_vring vq; - struct rte_vhost_ring_inflight inflight_vq; + struct rte_vhost_vring vring; + struct rte_vhost_ring_inflight inflight_ring; + uint16_t last_avail_idx; uint16_t last_used_idx; + uint16_t id; + bool avail_wrap_counter; bool used_wrap_counter; + bool packed_ring; + + struct vhost_blk_task *tasks; }; #define NUM_OF_BLK_QUEUES 1 -#define min(a, b) (((a) < (b)) ? (a) : (b)) - struct vhost_block_dev { - /** ID for vhost library. */ - int vid; - /** Queues for the block device */ - struct vhost_blk_queue queues[NUM_OF_BLK_QUEUES]; /** Unique name for this block device. */ char name[64]; @@ -68,8 +68,10 @@ struct vhost_block_dev { struct vhost_blk_ctrlr { uint8_t started; - uint8_t packed_ring; - uint8_t need_restart; + /** ID for vhost library. */ + int vid; + /** Queues for the block device */ + struct vhost_blk_queue queues[NUM_OF_BLK_QUEUES]; /** Only support 1 LUN for the example */ struct vhost_block_dev *bdev; /** VM memory region */ @@ -85,31 +87,20 @@ enum blk_data_dir { }; struct vhost_blk_task { - uint8_t readtype; uint8_t req_idx; - uint16_t head_idx; - uint16_t last_idx; + uint16_t chain_num; uint16_t inflight_idx; uint16_t buffer_id; uint32_t dxfer_dir; uint32_t data_len; - struct virtio_blk_outhdr *req; + struct virtio_blk_outhdr *req; volatile uint8_t *status; - struct iovec iovs[VHOST_BLK_MAX_IOVS]; uint32_t iovs_cnt; - struct vring_packed_desc *desc_packed; - struct vring_desc *desc_split; - struct rte_vhost_vring *vq; - struct vhost_block_dev *bdev; - struct vhost_blk_ctrlr *ctrlr; -}; -struct inflight_blk_task { - struct vhost_blk_task blk_task; - struct rte_vhost_inflight_desc_packed *inflight_desc; - struct rte_vhost_inflight_info_packed *inflight_packed; + struct vhost_blk_queue *vq; + struct vhost_blk_ctrlr *ctrlr; }; extern struct vhost_blk_ctrlr *g_vhost_ctrlr;