summaryrefslogtreecommitdiffstats
path: root/hw/virtio.h
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2012-11-30 00:02:56 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2012-11-29 17:25:02 -0600
commite1f7b4812eab992de46c98b3726745afb042a7f0 (patch)
tree288ec43f0807224674026579208dc46748bcaf32 /hw/virtio.h
parent044d003db9b6a588be2c9d0ec9de694ba3848551 (diff)
downloadhqemu-e1f7b4812eab992de46c98b3726745afb042a7f0.zip
hqemu-e1f7b4812eab992de46c98b3726745afb042a7f0.tar.gz
virtio: limit avail bytes lookahead
Commit 0d8d7690850eb0cf2b2b60933cf47669a6b6f18f introduced a regression in virtio-net performance because it looks into the ring aggressively while we really only care about a single packet worth of buffers. Reported as bugzilla 1066055 in launchpad. To fix, add parameters limiting lookahead, and use in virtqueue_avail_bytes. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reported-by: Edivaldo de Araujo Pereira <edivaldoapereira@yahoo.com.br> Tested-by: Edivaldo de Araujo Pereira <edivaldoapereira@yahoo.com.br> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/virtio.h')
-rw-r--r--hw/virtio.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/virtio.h b/hw/virtio.h
index df8d0f7..7c17f7b 100644
--- a/hw/virtio.h
+++ b/hw/virtio.h
@@ -150,7 +150,8 @@ int virtqueue_pop(VirtQueue *vq, VirtQueueElement *elem);
int virtqueue_avail_bytes(VirtQueue *vq, unsigned int in_bytes,
unsigned int out_bytes);
void virtqueue_get_avail_bytes(VirtQueue *vq, unsigned int *in_bytes,
- unsigned int *out_bytes);
+ unsigned int *out_bytes,
+ unsigned max_in_bytes, unsigned max_out_bytes);
void virtio_notify(VirtIODevice *vdev, VirtQueue *vq);
OpenPOWER on IntegriCloud