From nobody@FreeBSD.org  Wed Apr 30 19:57:22 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A4CBE1065676
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 30 Apr 2008 19:57:22 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 8817A8FC18
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 30 Apr 2008 19:57:22 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m3UJug3H086822
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 30 Apr 2008 19:56:42 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m3UJug5Y086821;
	Wed, 30 Apr 2008 19:56:42 GMT
	(envelope-from nobody)
Message-Id: <200804301956.m3UJug5Y086821@www.freebsd.org>
Date: Wed, 30 Apr 2008 19:56:42 GMT
From: Matthew Pounsett <matt@conundrum.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: order of operations dependancy in bringing up lagg interface breaks at-boot configuration
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         123279
>Category:       kern
>Synopsis:       [lagg] order of operations dependancy in bringing up lagg interface breaks at-boot configuration
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    thompsa
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Apr 30 20:00:07 UTC 2008
>Closed-Date:    
>Last-Modified:  Sun May 11 16:10:00 UTC 2008
>Originator:     Matthew Pounsett
>Release:        6.3-RELEASE
>Organization:
>Environment:
FreeBSD  6.3-RELEASE FreeBSD 6.3-RELEASE #0: Wed Jan 16 04:45:45 UTC 2008 root@dessler.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP  i386


>Description:
There is an order of operations dependancy in successfully bringing up a lagg(4) interface which is not handled by the system boot process, making it impossible to configure a lagg interface at boot time using rc.conf.

The physical interfaces used in a lagg interface must be ifconfig'd up after the lagg interface is created and configured, otherwise the lagg interface silently fails to work.  Since the system boot configuration scripts seem to configure network interfaces in alphabetical order, this often means that the physical interfaces are configured before the lagg interface, preventing normal operation.


>How-To-Repeat:
The following configuration order is necessary to get a lagg interface with a vlan up and running:
# ifconfig lagg0 create
# ifconfig lagg0 up laggproto failover laggport bce0 laggport bce1
# ifconfig lagg0.811 create
# ifconfig lagg0.811 10.4.11.41/24
# ifconfig bce0 up
# ifconfig bce1 up

The following configuration order appears to work in that no errors are reported during configuration, but the lagg interface is unable to get packets out on the wire, or receive incoming packets:
# ifconfig bce0 up
# ifconfig bce1 up
# ifconfig lagg0 create
# ifconfig lagg0 up laggproto failover laggport bce0 laggport bce1
# ifconfig lagg0.811 create
# ifconfig lagg0.811 10.4.11.41/24

The following configuration in rc.conf appears to be the correct way to reproduce the above configuration steps, however the lagg interface behaves as the second example (broken), not the first:
cloned_interfaces="lagg0 lagg0.811"
ifconfig_lagg0="up laggproto failover laggport bce0 laggport bce1"
ifconfig_lagg0_811="10.4.11.41/24"
ifconfig_bce0="up"
ifconfig_bce1="up"


>Fix:
This is either a problem in the lagg driver (order of operations dependancy) or the system startup scripts (order of operations in /etc/rc.d/netif).  

If it is expected that physical interfaces must be configured after the lagg interface is defined, then the bug is in the system startup scripts which should have an exception to configure lagg interfaces before configuring physical interfaces.   If that order of operations limitation is not expected, then the bug is in the lagg driver.  I'm not in a good position to say which is the case, only that one or the other is broken.




>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->thompsa 
Responsible-Changed-By: thompsa 
Responsible-Changed-When: Wed Apr 30 21:24:20 UTC 2008 
Responsible-Changed-Why:  
I will have a look at this one. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=123279 

From: Matt <datahead4@gmail.com>
To: bug-followup@FreeBSD.org, matt@conundrum.com
Cc:  
Subject: Re: kern/123279: [lagg] order of operations dependancy in bringing up lagg interface breaks at-boot configuration
Date: Tue, 6 May 2008 08:39:27 -0500

 The solution proposed in the following mailing list posting works for
 me on 7.0-RELEASE i386.
 
 http://lists.freebsd.org/pipermail/freebsd-questions/2007-August/155158.html
 
 Matt

From: Matthew Pounsett <matt@conundrum.com>
To: bug-followup@FreeBSD.org, Matthew Pounsett <matt@conundrum.com>
Cc:  
Subject: Re: kern/123279: [lagg] order of operations dependancy in bringing up lagg interface breaks at-boot configuration
Date: Sun, 11 May 2008 11:37:15 -0400

 The changes suggested in that post for 7.0-CURRENT describe the way my  
 6.3-RELEASE system is already set up. 
   
>Unformatted:
