qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [QA-virtio]:Why vring size is limited to 1024?


From: Michael S. Tsirkin
Subject: Re: [Qemu-devel] [QA-virtio]:Why vring size is limited to 1024?
Date: Tue, 30 Sep 2014 12:33:56 +0300

On Tue, Sep 30, 2014 at 04:36:00PM +0800, Zhangjie (HZ) wrote:
> Hi,
> There exits packets loss when we do packet forwarding in VM,
> especially when we use dpdk to do the forwarding. By enlarging vring
> can alleviate the problem.

I think this has to do with the fact that dpdk disables
checksum offloading, this has the side effect of disabling
segmentation offloading.

Please fix dpdk to support checksum offloading, and
I think the problem will go away.


> But now vring size is limited to 1024 as follows:
> VirtQueue *virtio_add_queue(VirtIODevice *vdev, int queue_size,
>                             void (*handle_output)(VirtIODevice *, VirtQueue 
> *))
> {
>       ...
>       if (i == VIRTIO_PCI_QUEUE_MAX || queue_size > VIRTQUEUE_MAX_SIZE)
>         abort();
> }
> ps:#define VIRTQUEUE_MAX_SIZE 1024
> I delete the judgement code, and set vring size to 2048,
> VM can be successfully started, and the network is ok too.
> So, Why vring size is limited to 1024 and what is the influence?
> 
> Thanks!

There are several reason for this limit.
First guest has to allocate descriptor buffer which is 16 * vring size.
With 1K size that is already 16K which might be tricky to
allocate contigiously if memory is fragmented when device is
added by hotplug.
The second issue is that we want to be able to implement
the device on top of linux kernel, and
a single descriptor might use all of
the virtqueue. In this case we wont to be able to pass the
descriptor directly to linux as a single iov, since
that is limited to 1K entries.

> -- 
> Best Wishes!
> Zhang Jie



reply via email to

[Prev in Thread] Current Thread [Next in Thread]