On 02/14/2014 05:43 AM, Luke Gorrie wrote: > Howdy! > > Observation: virtio-net.c hard-codes the vring size to 256 buffers. > > Could this reasonably be made configurable, or would that be likely to > cause a problem? > > In Snabb Switch we are creating a 1:1 mapping between Virtio-net > descriptors and VMDq hardware receive descriptors. The VMDq queues > support 32768 buffers and I'd like to match this on the QEMU/Virtio-net > side -- or at least come close. > > Cheers! > -Luke > >
For PCI that seems to be hardcoded. For 'virtio-mmio' call to get QUEUE_NUM checks if vring.num != 0 and returns VIRTQUEUE_MAX_SIZE (1024). Later the guest writes VIRTIO_MMIO_QUEUE_NUM this new size (early on in probe) and virtio_queue_set_num() adjusts the vring_desc, avail, .. values accordingly. The PCI variant doesn't support write to VIRTIO_PCI_QUEUE_NUM. You might be able to try something like that adjusting max value. - Mario