X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fvhost_blk%2Fvhost_blk.h;h=540998eb1bef20fe06d192b9025f50819dd4cec0;hb=35a7fe80c29446eab49ffd7e81a4f610fd1f98ce;hp=c968eee05e24f5df3c3e6a676465ff953576c20b;hpb=39f59f37ee410bbc43e88b3595108d9e2cffc132;p=dpdk.git diff --git a/examples/vhost_blk/vhost_blk.h b/examples/vhost_blk/vhost_blk.h index c968eee05e..540998eb1b 100644 --- a/examples/vhost_blk/vhost_blk.h +++ b/examples/vhost_blk/vhost_blk.h @@ -30,21 +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 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]; @@ -66,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 */ @@ -83,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;