From owner-freebsd-hackers@FreeBSD.ORG Fri Sep 7 15:07:05 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46D18106566C; Fri, 7 Sep 2012 15:07:05 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 1DE008FC08; Fri, 7 Sep 2012 15:07:04 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 3C736B945; Fri, 7 Sep 2012 11:07:04 -0400 (EDT) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Fri, 7 Sep 2012 10:48:39 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <504910CB.8050007@FreeBSD.org> In-Reply-To: <504910CB.8050007@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201209071048.39664.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 07 Sep 2012 11:07:04 -0400 (EDT) Cc: Navdeep Parhar Subject: Re: Order in which a driver attaches to devices X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Sep 2012 15:07:05 -0000 On Thursday, September 06, 2012 5:08:27 pm Navdeep Parhar wrote: > I have a system with multiple cards supported by cxgbe(4). When I build > a kernel with the driver compiled in, it attaches to the cards in a > different order from when it's loaded as a module. Why? The network > interfaces get re-ordered and this is quite annoying. Hmmmm. The boot time probe does a depth first walk of the PCI bus. This is what is suggested by PCI-SIG for enumerating PCI buses (and is normally how BIOSs walk the bus assigning bus numbers). The walk that is done at kldload time walks the 'pciX' bus devices in numerical order (rather than walking the tree). I suspect your BIOS is doing something weird and assigning bus numbers in a non-depth first ordering so that the two orderings are not consisent as they are on other machines. -- John Baldwin