[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 01/22] virtio: right size for virtio_queue_get_avail_
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 01/22] virtio: right size for virtio_queue_get_avail_size |
Date: |
Thu, 24 Sep 2015 16:20:07 +0300 |
From: Pierre Morel <address@hidden>
Being working on dataplane I notice something strange:
virtio_queue_get_avail_size() used a 64bit size index
for the calculation of the available ring size.
It is quite strange but it did work with the old calculation
of the avail ring, at most with performance penalty,
and I wonder where I missed something.
This patch let use a 16bit size as defined in virtio_ring.h
Signed-off-by: Pierre Morel <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
hw/virtio/virtio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 0832db9..730c7f0 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -1460,7 +1460,7 @@ hwaddr virtio_queue_get_desc_size(VirtIODevice *vdev, int
n)
hwaddr virtio_queue_get_avail_size(VirtIODevice *vdev, int n)
{
return offsetof(VRingAvail, ring) +
- sizeof(uint64_t) * vdev->vq[n].vring.num;
+ sizeof(uint16_t) * vdev->vq[n].vring.num;
}
hwaddr virtio_queue_get_used_size(VirtIODevice *vdev, int n)
--
MST
- [Qemu-devel] [PULL 22/22] virtio-net: correctly drop truncated packets, (continued)
- [Qemu-devel] [PULL 22/22] virtio-net: correctly drop truncated packets, Michael S. Tsirkin, 2015/09/24
- [Qemu-devel] [PULL 20/22] virtio: introduce virtqueue_unmap_sg(), Michael S. Tsirkin, 2015/09/24
- [Qemu-devel] [PULL 14/22] vhost: introduce vhost_backend_get_vq_index method, Michael S. Tsirkin, 2015/09/24
- [Qemu-devel] [PULL 18/22] MAINTAINERS: add more devices to the PC section, Michael S. Tsirkin, 2015/09/24
- [Qemu-devel] [PULL 15/22] vhost-user: add multiple queue support, Michael S. Tsirkin, 2015/09/24
- [Qemu-devel] [PULL 17/22] intel_iommu: Add support for translation for devices behind bridges, Michael S. Tsirkin, 2015/09/24
- [Qemu-devel] [PULL 01/22] virtio: right size for virtio_queue_get_avail_size,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 16/22] vhost-user: add a new message to disable/enable a specific virt queue., Michael S. Tsirkin, 2015/09/24
- [Qemu-devel] [PULL 13/22] vhost-user: add VHOST_USER_GET_QUEUE_NUM message, Michael S. Tsirkin, 2015/09/24
- Re: [Qemu-devel] [PULL 00/22] virtio,pc features, fixes, Michael S. Tsirkin, 2015/09/24
- Re: [Qemu-devel] [PULL 00/22] virtio,pc features, fixes, Peter Maydell, 2015/09/24