[Qemu-devel] [PATCH 09/10] virtio: read avail_idx from VQ only when necessary

2016-01-31 Thread Paolo Bonzini
From: Vincenzo Maffione The virtqueue_pop() implementation needs to check if the avail ring contains some pending buffers. To perform this check, it is not always necessary to fetch the avail_idx in the VQ memory, which is expensive. This patch introduces a shadow variable tracking avail_idx and

Re: [Qemu-devel] [PATCH 09/10] virtio: read avail_idx from VQ only when necessary

2016-01-21 Thread Vincenzo Maffione
2016-01-19 19:48 GMT+01:00 Paolo Bonzini : > > > On 19/01/2016 17:54, Michael S. Tsirkin wrote: >> On Fri, Jan 15, 2016 at 01:41:57PM +0100, Paolo Bonzini wrote: >>> From: Vincenzo Maffione >>> >>> The virtqueue_pop() implementation needs to check if the avail ring >>> contains some pending buffer

Re: [Qemu-devel] [PATCH 09/10] virtio: read avail_idx from VQ only when necessary

2016-01-20 Thread Cornelia Huck
On Tue, 19 Jan 2016 19:48:42 +0100 Paolo Bonzini wrote: > >> @@ -1579,6 +1595,7 @@ int virtio_load(VirtIODevice *vdev, QEMUFile *f, int > >> version_id) > >> return -1; > >> } > >> vdev->vq[i].used_idx = vring_used_idx(&vdev->vq[i]); > >> +v

Re: [Qemu-devel] [PATCH 09/10] virtio: read avail_idx from VQ only when necessary

2016-01-19 Thread Paolo Bonzini
On 19/01/2016 17:54, Michael S. Tsirkin wrote: > On Fri, Jan 15, 2016 at 01:41:57PM +0100, Paolo Bonzini wrote: >> From: Vincenzo Maffione >> >> The virtqueue_pop() implementation needs to check if the avail ring >> contains some pending buffers. To perform this check, it is not >> always necess

Re: [Qemu-devel] [PATCH 09/10] virtio: read avail_idx from VQ only when necessary

2016-01-19 Thread Michael S. Tsirkin
On Fri, Jan 15, 2016 at 01:41:57PM +0100, Paolo Bonzini wrote: > From: Vincenzo Maffione > > The virtqueue_pop() implementation needs to check if the avail ring > contains some pending buffers. To perform this check, it is not > always necessary to fetch the avail_idx in the VQ memory, which is >

Re: [Qemu-devel] [PATCH 09/10] virtio: read avail_idx from VQ only when necessary

2016-01-19 Thread Cornelia Huck
On Fri, 15 Jan 2016 13:41:57 +0100 Paolo Bonzini wrote: > From: Vincenzo Maffione > > The virtqueue_pop() implementation needs to check if the avail ring > contains some pending buffers. To perform this check, it is not > always necessary to fetch the avail_idx in the VQ memory, which is > expe

[Qemu-devel] [PATCH 09/10] virtio: read avail_idx from VQ only when necessary

2016-01-15 Thread Paolo Bonzini
From: Vincenzo Maffione The virtqueue_pop() implementation needs to check if the avail ring contains some pending buffers. To perform this check, it is not always necessary to fetch the avail_idx in the VQ memory, which is expensive. This patch introduces a shadow variable tracking avail_idx and