diff options
| author | Vincenzo Maffione <v.maffione@gmail.com> | 2016-01-31 11:29:05 +0100 |
|---|---|---|
| committer | Michael S. Tsirkin <mst@redhat.com> | 2016-02-06 20:44:08 +0200 |
| commit | be1fea9bc286f64c6c995bb0d7145a0b738aeddb (patch) | |
| tree | 2d826fa348b8eb71203dfb15ae4fb00aedb55edb /scripts/qapi-commands.py | |
| parent | b796fcd1bf2978aed15748db04e054f34789e9eb (diff) | |
| download | focaccia-qemu-be1fea9bc286f64c6c995bb0d7145a0b738aeddb.tar.gz focaccia-qemu-be1fea9bc286f64c6c995bb0d7145a0b738aeddb.zip | |
virtio: read avail_idx from VQ only when necessary
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 modifies virtio_queue_empty() to access avail_idx in physical memory only when necessary. Signed-off-by: Vincenzo Maffione <v.maffione@gmail.com> Message-Id: <b617d6459902773d9f4ab843bfaca764f5af8eda.1450218353.git.v.maffione@gmail.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'scripts/qapi-commands.py')
0 files changed, 0 insertions, 0 deletions