public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* 8 NIC limit
@ 2010-10-05 14:48 linux_kvm
  2010-10-05 15:24 ` Dustin Kirkland
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: linux_kvm @ 2010-10-05 14:48 UTC (permalink / raw)
  To: kvm

Hello list:

I'm working on a project that calls for the creation of a firewall in
KVM.
While adding a 20-interface trunk of virtio adapters to bring in a dual
10GB bond, I've discovered an 8 NIC limit in QEMU.

I found the following thread in the list archives detailing a similar
problem:
http://kerneltrap.org/mailarchive/linux-kvm/2009/1/29/4848304

It includes a patch for the file qemu/net.h to allow 24 NICs:
https://bugs.launchpad.net/ubuntu/+source/qemu-kvm">qemu-kvm/+bug/595873/+attachment/1429544/+files/max_nics.patch

In my case I want to attach 29, and have simply changed line 8 to 30
from 24.

This will be the first patch I've ever had to do, and so far my internet
search yields results that don't seem to apply.

Would someone like to recommend a pertinent tutorial?

Many thanks

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: 8 NIC limit
  2010-10-05 14:48 8 NIC limit linux_kvm
@ 2010-10-05 15:24 ` Dustin Kirkland
       [not found]   ` <1286294888.11462.1398488135@webmail.messagingengine.com>
  2010-10-05 15:57 ` 8 NIC limit Markus Armbruster
  2010-10-05 16:43 ` Brian Jackson
  2 siblings, 1 reply; 8+ messages in thread
From: Dustin Kirkland @ 2010-10-05 15:24 UTC (permalink / raw)
  To: linux_kvm; +Cc: kvm, qemu-devel

On Tue, Oct 5, 2010 at 7:48 AM,  <linux_kvm@proinbox.com> wrote:
> Hello list:
>
> I'm working on a project that calls for the creation of a firewall in
> KVM.
> While adding a 20-interface trunk of virtio adapters to bring in a dual
> 10GB bond, I've discovered an 8 NIC limit in QEMU.
>
> I found the following thread in the list archives detailing a similar
> problem:
> http://kerneltrap.org/mailarchive/linux-kvm/2009/1/29/4848304
>
> It includes a patch for the file qemu/net.h to allow 24 NICs:
> https://bugs.launchpad.net/ubuntu/+source/qemu-kvm">qemu-kvm/+bug/595873/+attachment/1429544/+files/max_nics.patch
>
> In my case I want to attach 29, and have simply changed line 8 to 30
> from 24.
>
> This will be the first patch I've ever had to do, and so far my internet
> search yields results that don't seem to apply.
>
> Would someone like to recommend a pertinent tutorial?

Hi there,

I commented on the original bug in Launchpad.  We're willing and able
to carry the patch against qemu-kvm in Ubuntu, I just asked that the
reporter at least submit the patch upstream for discussion.  I don't
see where that has happened yet.  It's a trivial patch to submit.
Please note in that bug a pointer to the mailing list thread, if you
start one.

To your specific question, different communities have different
requirements on patch submission, so you do need to consult each
community.  A good place to start might be the
Documentation/SubmittingPatches how-to in the kernel tree:
 * http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob_plain;f=Documentation/SubmittingPatches;hb=HEAD

In this case, I think you're going to want to send your patch to the
qemu-devel (on CC) mailing list (perhaps in addition to sending it
here, to the kvm list).

:-Dustin

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: 8 NIC limit
  2010-10-05 14:48 8 NIC limit linux_kvm
  2010-10-05 15:24 ` Dustin Kirkland
@ 2010-10-05 15:57 ` Markus Armbruster
  2010-10-05 16:20   ` linux_kvm
  2010-10-05 16:43 ` Brian Jackson
  2 siblings, 1 reply; 8+ messages in thread
From: Markus Armbruster @ 2010-10-05 15:57 UTC (permalink / raw)
  To: linux_kvm; +Cc: kvm

linux_kvm@proinbox.com writes:

> Hello list:
>
> I'm working on a project that calls for the creation of a firewall in
> KVM.
> While adding a 20-interface trunk of virtio adapters to bring in a dual
> 10GB bond, I've discovered an 8 NIC limit in QEMU.

Have you tried creating NICs with -device?  The limit shouldn't apply
there.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: 8 NIC limit
  2010-10-05 15:57 ` 8 NIC limit Markus Armbruster
@ 2010-10-05 16:20   ` linux_kvm
  0 siblings, 0 replies; 8+ messages in thread
From: linux_kvm @ 2010-10-05 16:20 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: KVM mailing list

> Have you tried creating NICs with -device?

I'm not sure what that is, will look into it, thanks.

I'm using ProxmoxVE, and currently add them via a web interface.

Someone happens to host a screenshot of that part here:
http://c-nergy.be/blog/wp-content/uploads/Proxmox_Net2.png

On Tue, 05 Oct 2010 17:57 +0200, "Markus Armbruster" <armbru@redhat.com>
wrote:
> linux_kvm@proinbox.com writes:
> 
> > Hello list:
> >
> > I'm working on a project that calls for the creation of a firewall in
> > KVM.
> > While adding a 20-interface trunk of virtio adapters to bring in a dual
> > 10GB bond, I've discovered an 8 NIC limit in QEMU.
> 
> Have you tried creating NICs with -device?  The limit shouldn't apply
> there.
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: 8 NIC limit
  2010-10-05 14:48 8 NIC limit linux_kvm
  2010-10-05 15:24 ` Dustin Kirkland
  2010-10-05 15:57 ` 8 NIC limit Markus Armbruster
@ 2010-10-05 16:43 ` Brian Jackson
  2 siblings, 0 replies; 8+ messages in thread
From: Brian Jackson @ 2010-10-05 16:43 UTC (permalink / raw)
  To: linux_kvm; +Cc: kvm

  On 10/5/2010 9:48 AM, linux_kvm@proinbox.com wrote:
> Hello list:
>
> I'm working on a project that calls for the creation of a firewall in
> KVM.
> While adding a 20-interface trunk of virtio adapters to bring in a dual
> 10GB bond, I've discovered an 8 NIC limit in QEMU.
>
> I found the following thread in the list archives detailing a similar
> problem:
> http://kerneltrap.org/mailarchive/linux-kvm/2009/1/29/4848304
>
> It includes a patch for the file qemu/net.h to allow 24 NICs:
> https://bugs.launchpad.net/ubuntu/+source/qemu-kvm">qemu-kvm/+bug/595873/+attachment/1429544/+files/max_nics.patch
>
> In my case I want to attach 29, and have simply changed line 8 to 30
> from 24.


I'd guess you'll bump into a pci device number limit (I believe it is 32 
at the moment).


> This will be the first patch I've ever had to do, and so far my internet
> search yields results that don't seem to apply.
>
> Would someone like to recommend a pertinent tutorial?
>
> Many thanks
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: 8 NIC limit - patch - places limit at 32
       [not found]     ` <1286295603.7731.28.camel@x200>
@ 2010-10-06  5:46       ` linux_kvm
       [not found]         ` <4CAC719E.6060004@codemonkey.ws>
  0 siblings, 1 reply; 8+ messages in thread
From: linux_kvm @ 2010-10-06  5:46 UTC (permalink / raw)
  To: Dustin Kirkland; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 99 bytes --]

Attached is a patch that allows qemu to have up to 32 NICs, without
using the qdev -device method.

[-- Attachment #2: max_nics.patch --]
[-- Type: application/octet-stream, Size: 225 bytes --]

--- a/net.h	2010-02-26 03:34:00.000000000 +0100
+++ b/net.h.my	2010-06-10 18:48:53.215317795 +0200
@@ -119,7 +119,7 @@
 
 /* NIC info */
 
-#define MAX_NICS 8
+#define MAX_NICS 32 
 enum {
 	NIC_NVECTORS_UNSPECIFIED = -1
 };

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: 8 NIC limit - patch - places limit at 32
       [not found]         ` <4CAC719E.6060004@codemonkey.ws>
@ 2010-10-06 17:11           ` linux_kvm
  2010-10-07  1:39             ` Chris Wright
  0 siblings, 1 reply; 8+ messages in thread
From: linux_kvm @ 2010-10-06 17:11 UTC (permalink / raw)
  To: Anthony Liguori

It's 8 otherwise- and after the patch is applied, it still only goes to
28 for some reason.
28's acceptable for my needs, so I'll step aside from here & leave it to
the experts.

As for the new -device method, that's all fine & good but AFAIK it's not
implemented on my platform, so this was the answer.

On Wed, 06 Oct 2010 07:54 -0500, "Anthony Liguori"
<anthony@codemonkey.ws> wrote:
> On 10/06/2010 12:46 AM, linux_kvm@proinbox.com wrote:
> > Attached is a patch that allows qemu to have up to 32 NICs, without
> > using the qdev -device method.
> >    
> 
> I'd rather there be no fixed limit and we validate that when add fails 
> because there isn't a TCP slot available, we do the right thing.
> 
> 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.
> 
> Regards,
> 
> Anthony Liguori
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: 8 NIC limit - patch - places limit at 32
  2010-10-06 17:11           ` linux_kvm
@ 2010-10-07  1:39             ` Chris Wright
  0 siblings, 0 replies; 8+ messages in thread
From: Chris Wright @ 2010-10-07  1:39 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: kvm, linux_kvm

* 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-10-07  1:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-05 14:48 8 NIC limit linux_kvm
2010-10-05 15:24 ` Dustin Kirkland
     [not found]   ` <1286294888.11462.1398488135@webmail.messagingengine.com>
     [not found]     ` <1286295603.7731.28.camel@x200>
2010-10-06  5:46       ` 8 NIC limit - patch - places limit at 32 linux_kvm
     [not found]         ` <4CAC719E.6060004@codemonkey.ws>
2010-10-06 17:11           ` linux_kvm
2010-10-07  1:39             ` Chris Wright
2010-10-05 15:57 ` 8 NIC limit Markus Armbruster
2010-10-05 16:20   ` linux_kvm
2010-10-05 16:43 ` Brian Jackson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox