From 794b2533deb6269f51744332c642f6442aba74f7 Mon Sep 17 00:00:00 2001 From: Darek Stojaczyk Date: Mon, 8 Apr 2019 23:14:17 +0200 Subject: [PATCH] virtio: shrink the process-local virtqueue structure We used to ceil the size of the vring structure to the nearest cache line boundary. That's how the original DPDK implementation behaved, but I can't find a reason for this. This patch gets rid of the ceiling. Change-Id: Iaa40fdb79c60252237901f77023ff2f9e580eece Signed-off-by: Darek Stojaczyk Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450549 Tested-by: SPDK CI Jenkins Reviewed-by: Ben Walker Reviewed-by: Changpeng Liu --- lib/virtio/virtio.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/virtio/virtio.c b/lib/virtio/virtio.c index 73e4d7b92..b936c4f05 100644 --- a/lib/virtio/virtio.c +++ b/lib/virtio/virtio.c @@ -139,9 +139,7 @@ virtio_init_queue(struct virtio_dev *dev, uint16_t vtpci_queue_idx) return -EINVAL; } - size = RTE_ALIGN_CEIL(sizeof(*vq) + - vq_size * sizeof(struct vq_desc_extra), - RTE_CACHE_LINE_SIZE); + size = sizeof(*vq) + vq_size * sizeof(struct vq_desc_extra); vq = spdk_dma_zmalloc(size, RTE_CACHE_LINE_SIZE, NULL); if (vq == NULL) {