WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] PATCH: default number of netloop devices to number of ne

To: Eric Schwartz <eric.schwartz@xxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] PATCH: default number of netloop devices to number of network devices
From: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Date: Fri, 26 Oct 2007 10:02:04 +0100
Delivery-date: Fri, 26 Oct 2007 02:02:59 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <4720E2AB.3090307@xxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcgXruCaHzCbXIOiEdyi6gAX8io7RQ==
Thread-topic: [Xen-devel] PATCH: default number of netloop devices to number of network devices
User-agent: Microsoft-Entourage/11.3.6.070618
The loopback device is deprecated in xen-unstable (not needed any more) and
this isn't really critical enough for 3.1.2.

 -- Keir

On 25/10/07 19:38, "Eric Schwartz" <eric.schwartz@xxxxxx> wrote:

> Right now, unless specifically overridden, loopback_init() in
> drivers/xen/netback/loopback.c creates 4 netloop devices.  If your
> default network device is eth4 or higher, you're out of luck creating a
> xenbrN device with /etc/xen/scripts/network-bridge unless you explicitly
> set netloop.nloopbacks to something higher.  This patch attempts to set
> a more reasonable default: the number of network devices that exist, as
> reported by dev_get_by_index().
> 
> This isn't a perfect solution-- in particular, there will generally be a
> few more devices than there are physical network devices, but looking
> around and consulting with Paul Moore (netlabel maintainer), there
> doesn't seem to be a good way to tell real network devices from pseudo
> ones.  My initial attempt at a patch checked tmp->name for whether it
> began with 'eth', but it's completely reasonable to have network devices
> named anything-- an old laptop used to have its wireless interface named
> 'ath0', for instance, and another used 'wlan0'.  So while this approach
> may waste a little bit of memory, at module load time, we can ensure
> that no matter how many devices you have in your system, at least at
> boot time, you can create that many xenbrN devices.
> 
> Signed-off-by: Eric Schwartz <eric.schwartz@xxxxxx>
> 
> -=Eric
> --- linux-2.6.18.ia64/drivers/xen/netback/loopback.c.old 2007-10-25
> 13:05:30.716516696 -0400
> +++ linux-2.6.18.ia64/drivers/xen/netback/loopback.c 2007-10-25
> 14:14:07.835744809 -0400
> @@ -298,9 +298,18 @@
>  static int __init loopback_init(void)
>  {
> int i, err = 0;
> + struct net_device *tmp;
>  
> - if (nloopbacks == -1)
> -  nloopbacks = is_initial_xendomain() ? 4 : 0;
> + if (nloopbacks == -1) {
> +  nloopbacks = 0;
> +
> +  if (is_initial_xendomain()) {
> +   for(i = 1; tmp = dev_get_by_index(i); i++) {
> +    nloopbacks++;
> +    dev_put(tmp);
> +   } 
> +  } 
> + }
>  
> for (i = 0; i < nloopbacks; i++)
> if ((err = make_loopback(i)) != 0)
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>