From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NtoiN-0004xI-86 for qemu-devel@nongnu.org; Mon, 22 Mar 2010 16:59:11 -0400 Received: from [199.232.76.173] (port=49764 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NtoiM-0004xA-Pb for qemu-devel@nongnu.org; Mon, 22 Mar 2010 16:59:10 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NtoiK-0001gJ-GE for qemu-devel@nongnu.org; Mon, 22 Mar 2010 16:59:10 -0400 Received: from mail-fx0-f221.google.com ([209.85.220.221]:59935) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NtoiK-0001gD-4A for qemu-devel@nongnu.org; Mon, 22 Mar 2010 16:59:08 -0400 Received: by fxm21 with SMTP id 21so2228727fxm.2 for ; Mon, 22 Mar 2010 13:59:06 -0700 (PDT) Message-ID: <4BA7DA12.7050308@codemonkey.ws> Date: Mon, 22 Mar 2010 15:58:58 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCHv6 08/11] vhost: vhost net support References: <057ffaff8c6520537b8f0cc0647bb291862d3456.1268823114.git.mst@redhat.com> In-Reply-To: <057ffaff8c6520537b8f0cc0647bb291862d3456.1268823114.git.mst@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: amit.shah@redhat.com, quintela@redhat.com, qemu-devel@nongnu.org, kraxel@redhat.com On 03/17/2010 06:08 AM, Michael S. Tsirkin wrote: > This adds vhost net device support in qemu. Will be tied to tap device > and virtio by following patches. Raw backend is currently missing, > will be worked on/submitted separately. > > Signed-off-by: Michael S. Tsirkin > --- > Makefile.target | 2 + > configure | 37 +++ > hw/vhost.c | 711 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ > hw/vhost.h | 48 ++++ > hw/vhost_net.c | 195 +++++++++++++++ > hw/vhost_net.h | 19 ++ > 6 files changed, 1012 insertions(+), 0 deletions(-) > create mode 100644 hw/vhost.c > create mode 100644 hw/vhost.h > create mode 100644 hw/vhost_net.c > create mode 100644 hw/vhost_net.h > > diff --git a/Makefile.target b/Makefile.target > index 004a703..ea5207c 100644 > --- a/Makefile.target > +++ b/Makefile.target > @@ -176,6 +176,8 @@ obj-y = vl.o async.o monitor.o pci.o pci_host.o pcie_host.o machine.o gdbstub.o > # need to fix this properly > obj-y += virtio-blk.o virtio-balloon.o virtio-net.o virtio-pci.o virtio-serial-bus.o > obj-y += event_notifier.o > +obj-y += vhost_net.o > +obj-$(CONFIG_VHOST_NET) += vhost.o > obj-y += rwhandler.o > obj-$(CONFIG_KVM) += kvm.o kvm-all.o > obj-$(CONFIG_ISA_MMIO) += isa_mmio.o > diff --git a/configure b/configure > index d728799..93015e3 100755 > --- a/configure > +++ b/configure > @@ -263,6 +263,7 @@ vnc_tls="" > vnc_sasl="" > xen="" > linux_aio="" > +vhost_net="" > > gprof="no" > debug_tcg="no" > @@ -651,6 +652,10 @@ for opt do > ;; > --enable-docs) docs="yes" > ;; > + --disable-vhost-net) vhost_net="no" > + ;; > + --enable-vhost-net) vhost_net="yes" > + ;; > *) echo "ERROR: unknown option $opt"; show_help="yes" > ;; > esac > @@ -806,6 +811,8 @@ echo " --disable-blobs disable installing provided firmware blobs" > echo " --kerneldir=PATH look for kernel includes in PATH" > echo " --enable-docs enable documentation build" > echo " --disable-docs disable documentation build" > +echo " --disable-vhost-net disable vhost-net acceleration support" > +echo " --enable-vhost-net enable vhost-net acceleration support" > echo "" > echo "NOTE: The object files are built at the place where configure is launched" > exit 1 > @@ -1498,6 +1505,32 @@ EOF > fi > > ########################################## > +# test for vhost net > + > +if test "$vhost_net" != "no"; then > + if test "$kvm" != "no"; then > + cat> $TMPC< + #include > + int main(void) { return 0; } > +EOF > + if compile_prog "$kvm_cflags" "" ; then > + vhost_net=yes > + else > + if "$vhost_net" == "yes" ; then > + feature_not_found "vhost-net" > + fi > + vhost_net=no > + fi > + else > + if "$vhost_net" == "yes" ; then > + echo -e "NOTE: vhost-net feature requires KVM (--enable-kvm)." > + feature_not_found "vhost-net" > + fi > The indent is quite a bit off here but more importantly, if "$vhost_net" == "yes" is not a valid shell command. Instead, it ought to be: if test "$vhost_net" = "yes" ; then And likewise for the earlier check. I'll fold this fix into your series unless you'd like to respin for some reason. Regards, Anthony Liguori+ cpu_physical_memory_set_dirty(addr + bit * VHOST_LOG_PAGE);