From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34101) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WEOXP-00062d-06 for qemu-devel@nongnu.org; Fri, 14 Feb 2014 14:35:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WEOXB-0007qw-Pg for qemu-devel@nongnu.org; Fri, 14 Feb 2014 14:35:02 -0500 Received: from mailout4.w2.samsung.com ([211.189.100.14]:10954 helo=usmailout4.samsung.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WEOXB-0007qs-M9 for qemu-devel@nongnu.org; Fri, 14 Feb 2014 14:34:49 -0500 Received: from uscpsbgex4.samsung.com (u125.gpu85.samsung.co.kr [203.254.195.125]) by usmailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N10007BI3Q0TR90@usmailout4.samsung.com> for qemu-devel@nongnu.org; Fri, 14 Feb 2014 14:34:48 -0500 (EST) Message-id: <52FE6FCC.5070802@samsung.com> Date: Fri, 14 Feb 2014 11:34:36 -0800 From: Mario Smarduch MIME-version: 1.0 References: In-reply-to: Content-type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: 7bit Subject: Re: [Qemu-devel] Make virtio-net.c ring size configurable? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luke Gorrie Cc: "snabb-devel@googlegroups.com" , qemu-devel 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