[virtio] Remove queue size limit in legacy virtio
authorLadi Prosek <lprosek@redhat.com>
Fri, 16 Dec 2016 13:07:08 +0000 (14:07 +0100)
committerMichael Brown <mcb30@ipxe.org>
Sun, 22 Jan 2017 13:22:19 +0000 (13:22 +0000)
commitfba3b39900af52e695d59bc34f28bb8d22526ddb
tree6b2b6062085e52e545306937e48fcf6af5774cca
parentb782a56be725569fb68f92b81a01903d1652c5b0
[virtio] Remove queue size limit in legacy virtio

Virtio 0.9 implementation was limited to the maximum virtqueue size of
MAX_QUEUE_NUM and the virtio-net driver would fail to initialize on hosts
exceeding this limit.

This commit lifts the restriction by allocating the queue memory based on
the actual queue size instead of using a fixed maximum. Note that virtio
1.0 still uses the MAX_QUEUE_NUM constant to cap the size (unfortunately
this functionality is not available in virtio 0.9).

Signed-off-by: Ladi Prosek <lprosek@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/drivers/bus/virtio-pci.c
src/drivers/net/virtio-net.c
src/include/ipxe/virtio-pci.h
src/include/ipxe/virtio-ring.h