From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tokarev Subject: Re: net packet storms with multiple NICs Date: Fri, 23 Oct 2009 20:57:00 +0400 Message-ID: <4AE1E05C.4050606@msgid.tls.msk.ru> References: <4AE1D903.5030709@msgid.tls.msk.ru> <20091023163339.GN2455@nerd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "qemu-devel@nongnu.org" , KVM list To: Andreas Plesner Jacobsen Return-path: Received: from isrv.corpit.ru ([81.13.33.159]:40193 "EHLO isrv.corpit.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752332AbZJWQ46 (ORCPT ); Fri, 23 Oct 2009 12:56:58 -0400 In-Reply-To: <20091023163339.GN2455@nerd.dk> Sender: kvm-owner@vger.kernel.org List-ID: Andreas Plesner Jacobsen wrote: > On Fri, Oct 23, 2009 at 08:25:39PM +0400, Michael Tokarev wrote: >> o why different -net guest -net host pairs are not getting different >> vlan= indexes by default, to stop the above-mentioned packet >> storms right away? I think it's a wise default to assign different >> pairs to different vlans, by counting -net host and -net guest >> sequences. > > I think the major issue is that the definition of a "pair" is when the > vlan-options match. There's no requirement to define the two after each > other. I mean something like this (rough approximation: int host_vlan_no = 0, guest_vlan_no = 0; while(parse_option()) { if (option == host-side-net) { if (!explicit_vlan) vlan = host_vlan_no; ++host_vlan_no; } if (option == guest-side-net) { if (!explicit_vlan) vlan = guest_vlan_no; ++guest_vlan_no; } } this way, consecutive host-side -net will receive consecutive vlan=NN, and consecutive guest-side -net also consecutive vlan=NN numbers. But having in mind Marc's reply I don't think it's necessary anymore. Thanks! /mjt