From: Stephen Hemminger Date: Mon, 9 Feb 2015 01:13:57 +0000 (+0800) Subject: virtio: remove redundant alignment field X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=9ffd50826f3ec8c9e23ff0bd3c35ce9f614c66c4;p=dpdk.git virtio: remove redundant alignment field Since vq_alignment is constant (always 4K), it does not need to be part of the vring struct. Signed-off-by: Stephen Hemminger Signed-off-by: Changchun Ouyang Acked-by: Huawei Xie --- diff --git a/lib/librte_pmd_virtio/virtio_ethdev.c b/lib/librte_pmd_virtio/virtio_ethdev.c index 3110349a42..b7f541a83b 100644 --- a/lib/librte_pmd_virtio/virtio_ethdev.c +++ b/lib/librte_pmd_virtio/virtio_ethdev.c @@ -294,7 +294,6 @@ int virtio_dev_queue_setup(struct rte_eth_dev *dev, vq->port_id = dev->data->port_id; vq->queue_id = queue_idx; vq->vq_queue_index = vtpci_queue_idx; - vq->vq_alignment = VIRTIO_PCI_VRING_ALIGN; vq->vq_nentries = vq_size; vq->vq_free_cnt = vq_size; diff --git a/lib/librte_pmd_virtio/virtio_rxtx.c b/lib/librte_pmd_virtio/virtio_rxtx.c index 5e660c1666..e4bcc8e3dc 100644 --- a/lib/librte_pmd_virtio/virtio_rxtx.c +++ b/lib/librte_pmd_virtio/virtio_rxtx.c @@ -257,7 +257,7 @@ virtio_dev_vring_start(struct virtqueue *vq, int queue_type) * Reinitialise since virtio port might have been stopped and restarted */ memset(vq->vq_ring_virt_mem, 0, vq->vq_ring_size); - vring_init(vr, size, ring_mem, vq->vq_alignment); + vring_init(vr, size, ring_mem, VIRTIO_PCI_VRING_ALIGN); vq->vq_used_cons_idx = 0; vq->vq_desc_head_idx = 0; vq->vq_avail_idx = 0; diff --git a/lib/librte_pmd_virtio/virtqueue.h b/lib/librte_pmd_virtio/virtqueue.h index fdeff200b9..130c1d0efc 100644 --- a/lib/librte_pmd_virtio/virtqueue.h +++ b/lib/librte_pmd_virtio/virtqueue.h @@ -138,8 +138,7 @@ struct virtqueue { uint8_t port_id; /**< Device port identifier. */ void *vq_ring_virt_mem; /**< linear address of vring*/ - int vq_alignment; - int vq_ring_size; + unsigned int vq_ring_size; phys_addr_t vq_ring_mem; /**< physical address of vring */ struct vring vq_ring; /**< vring keeping desc, used and avail */