From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: [PATCH V4 00/22] Multiqueue virtio-net Date: Thu, 31 Jan 2013 16:36:12 +0200 Message-ID: <20130131143612.GA13347@redhat.com> References: <1359544361-5089-1-git-send-email-jasowang@redhat.com> <20130131142149.GA13106@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org, blauwirbel@gmail.com, shajnocz@redhat.com, krkumar2@in.ibm.com, kvm@vger.kernel.org, mprivozn@redhat.com, rusty@rustcorp.com.au, gaowanlong@cn.fujitsu.com, jwhan@filewood.snu.ac.kr, shiyer@redhat.com To: Jason Wang Return-path: Received: from mx1.redhat.com ([209.132.183.28]:62015 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753980Ab3AaOcW (ORCPT ); Thu, 31 Jan 2013 09:32:22 -0500 Content-Disposition: inline In-Reply-To: <20130131142149.GA13106@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Jan 31, 2013 at 04:21:49PM +0200, Michael S. Tsirkin wrote: > On Wed, Jan 30, 2013 at 07:12:19PM +0800, Jason Wang wrote: > > Hello all: > > > > This seires is an update of last version of multiqueue virtio-net support. > > > > This series tries to brings multiqueue support to virtio-net through a > > multiqueue support tap backend and multiple vhost threads. > > > > Patch 1 converts bitfield in TAPState to bool. Patch 2 replace assert(0) with > > abort() in tap. > > > > To support this, multiqueue nic support were added to qemu. This is done by > > introducing an array of NetClientStates in NICState, and make each pair of peers > > to be an queue of the nic. This is done in patch 3-9. > > > > Tap were also converted to be able to create a multiple queue > > backend. Currently, only linux support this by issuing TUNSETIFF N times with > > the same device name to create N queues. Each fd returned by TUNSETIFF were a > > queue supported by kernel. Three new command lines were introduced, "queues" > > were used to tell how many queues will be created by qemu; "fds" were used to > > pass multiple pre-created tap file descriptors to qemu; "vhostfds" were used to > > pass multiple pre-created vhost descriptors to qemu. This is done in patch 10-15. > > > > A method of deleting a queue and queue_index were also introduce for virtio, > > this is done in patch 16-17. > > > > Vhost were also changed to support multiqueue by introducing a start vq index > > which tracks the first virtqueue that will be used by vhost instead of the > > assumption that the vhost always use virtqueue from index 0. This is done in > > patch 18. > > > > The last part is the multiqueue userspace changes, this is done in patch 19-22. > > > > With this changes, user could start a multiqueue virtio-net device through > > > > ./qemu -netdev tap,id=hn0,queues=2,vhost=on -device virtio-net-pci,netdev=hn0 > > > > Management tools such as libvirt can pass multiple pre-created fds/vhostfds through > > > > ./qemu -netdev tap,id=hn0,fds=X:Y,vhostfds=M:N -device virtio-net-pci,netdev=hn0 > > > > For the one who wants to try, a git tree is available at: > > git://github.com/jasowang/qemu.git > > > > Changes from V3: > > - convert bitfield to bool in TAPState (Blue) > > - use abort() instead of assert(0) in tap code (Blue) > > - rebase to the latest > > - fix a bug that breaks the non-tap network > > This conflicts with the pull request I sent, in partucular this adds a > layout assumption. In the hope this will accelerate things, I did a > rebase and a trivial test with single queue only and it seems ok: > > git://github.com/mstsirkin/qemu.git pci > > There were some warnings about whitespace at EOF but > otherwise seems ok. Pushed to my pci branch on kernel.org too. > -- > MST