From: Chris Wright Subject: Re: 8 NIC limit - patch - places limit at 32 Date: Wed, 6 Oct 2010 18:39:54 -0700 Message-ID: <20101007013954.GH18885@sequoia.sous-sol.org> References: <1286290127.19619.1398473465@webmail.messagingengine.com> <1286294888.11462.1398488135@webmail.messagingengine.com> <1286295603.7731.28.camel@x200> <1286343964.21446.1398603889@webmail.messagingengine.com> <4CAC719E.6060004@codemonkey.ws> <1286385112.6026.1398703073@webmail.messagingengine.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, linux_kvm@proinbox.com To: Anthony Liguori Return-path: Received: from sous-sol.org ([216.99.217.87]:56997 "EHLO sequoia.sous-sol.org" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1759838Ab0JGBmL (ORCPT ); Wed, 6 Oct 2010 21:42:11 -0400 Content-Disposition: inline In-Reply-To: <1286385112.6026.1398703073@webmail.messagingengine.com> Sender: kvm-owner@vger.kernel.org List-ID: * Anthony Liguori (anthony@codemonkey.ws) wrote: > BTW, using -device, it should be possible to add a very high number of > nics because you can specify the PCI address including a function. If > this doesn't Just Work today, we should make it work. Should work...test...mostly[1], but I don't actually know of any tools that make use of it. thanks, -chris [1] 40 worked, 48 caused guest kernel stack corruption, didn't dig in to see why yet. Here's my simple wrapper to build up the command line: QEMU=/home/chrisw/git/kvm/qemu-kvm/x86_64-softmmu/qemu-system-x86_64 BIOS=/home/chrisw/git/kvm/qemu-kvm/pc-bios DISK=/home/chrisw/disk-snap1.img SCRIPT=/home/chrisw/git/kvm/qemu-kvm/kvm/scripts/qemu-ifup unset NETARGS i=0 dev=4 func=0 max_dev=40 while [ $i -lt $max_dev ] do unset MULTIFUNC if [ $(($i + 1)) -lt $max_dev -a $func -eq 0 ]; then MULTIFUNC=",multifunction=on" fi NETARGS="${NETARGS} -netdev type=tap,id=netdev$i,script=$SCRIPT -device virtio-net-pci,mac=52:54:00:12:34:$(printf "%.2x\n" $i),netdev=netdev$i,bus=pci.0,addr=$dev.$func$MULTIFUNC" i=$(($i+1)) func=$(($func+1)) if [ $func -eq 8 ]; then func=0 dev=$(($dev+1)) fi done $QEMU -L $BIOS -m 1024 -drive file=$DISK,if=virtio,boot=on $NETARGS -vnc :0