From owner-freebsd-questions@FreeBSD.ORG Thu Jan 15 16:48:24 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05EF81065673; Thu, 15 Jan 2009 16:48:24 +0000 (UTC) (envelope-from rea-fbsd@codelabs.ru) Received: from 0.mx.codelabs.ru (0.mx.codelabs.ru [144.206.177.45]) by mx1.freebsd.org (Postfix) with ESMTP id A279F8FC21; Thu, 15 Jan 2009 16:48:23 +0000 (UTC) (envelope-from rea-fbsd@codelabs.ru) DomainKey-Signature: a=rsa-sha1; q=dns; c=simple; s=one; d=codelabs.ru; h=Received:Date:From:To:Cc:Subject:Message-ID:Reply-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:Sender; b=oJ/hyQ9dsPXEdzllzhEOvTq9ELAhlfH7Uka3yq9sVXZCZXU5KskAOu7EeOXRbKR99GS8UtiejXbvDG+qN0oLq9Cnas+JYqezRIbS8ZcX6n7iW5djRnTt79OKH63wau6qMloHOLQ6IpF5jH3/q4qZ2NQ71hoW4i2MPGALq/UV40k=; Received: from phoenix.codelabs.ru (ppp91-76-14-132.pppoe.mtu-net.ru [91.76.14.132]) by 0.mx.codelabs.ru with esmtpsa (TLSv1:AES256-SHA:256) id 1LNVOH-0007In-U4; Thu, 15 Jan 2009 19:48:22 +0300 Date: Thu, 15 Jan 2009 19:48:19 +0300 From: Eygene Ryabinkin To: "Bruce M. Simpson" Message-ID: <+b/MqS4l8z9bOD9y4AZP70mtFL0@kjaK+/sQ5DW5981v71UogZJPf/0> References: <20def4870901140009y1f007108y92797d5f79ffac08@mail.gmail.com> <496E11B7.3010608@sepehrs.com> <000b01c9768e$745aa160$220f000a@mtl.com> <496EF30E.4010304@sepehrs.com> <000c01c976ec$87e040b0$220f000a@mtl.com> <496F34D2.7050605@FreeBSD.org> <496F4FD1.4080602@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <496F4FD1.4080602@FreeBSD.org> Sender: rea-fbsd@codelabs.ru X-Mailman-Approved-At: Thu, 15 Jan 2009 18:47:04 +0000 Cc: Liran Liss , freebsd-net@freebsd.org, Oleg Kats , "'H.fazaeli'" , Yony Yossef , Eitan Shefi , freebsd-questions@freebsd.org Subject: Re: howto determine network device unit number? device.hints? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: rea-fbsd@codelabs.ru List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 16:48:24 -0000 Bruce, good day. Thu, Jan 15, 2009 at 03:01:37PM +0000, Bruce M. Simpson wrote: > Bruce M. Simpson wrote: > > In your case I'm not sure why your two cards would flip order. Could > > it be how your BIOS and hardware set up the PCI IDSEL lines at boot? > > If this is the case on your system, then you really need to provide more > data about your hardware, i.e. motherboard, BIOS, vendor information > etc. as others point out. I wanted to stress only one point: simple 'kldunload ' and 'kldload ' makes devices to flip for Yony's case. This means that unless some PCI hotplug stuff is here (which I don't believe to be present, because no physical cards are touched and there is actually a small amount of PCI hotplug support in FreeBSD), no physical PCI devices get added or removed from the PCI child tree. It looks like that something goes wrong during the PCI tree reprobe on the driver module loading. Correct me if I am wrong, but pci_driver_added from /sys/pci/pci.c will invoke device_get_children() to get the list of the attached devices, and for PCI case the list should be static. Here is what I get for the 'kldload if_em' with verbose boot: ----- pci0: driver added found-> vendor=0x8086, dev=0x283e, revid=0x02 domain=0, bus=0, slot=31, func=3 class=0c-05-00, hdrtype=0x00, mfdev=0 cmdreg=0x0001, statreg=0x0280, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) intpin=c, irq=18 pci0:0:31:3: reprobing on driver added pci1: driver added pci2: driver added pci3: driver added pci4: driver added pci5: driver added found-> vendor=0x8086, dev=0x1010, revid=0x01 domain=0, bus=5, slot=3, func=0 class=02-00-00, hdrtype=0x00, mfdev=1 cmdreg=0x0017, statreg=0x0230, cachelnsz=8 (dwords) lattimer=0x40 (1920 ns), mingnt=0xff (63750 ns), maxlat=0x00 (0 ns) intpin=a, irq=16 powerspec 2 supports D0 D3 current D0 MSI supports 1 message, 64 bit pci0:5:3:0: reprobing on driver added em0: port 0xb880-0xb8bf mem 0xff7c0000-0xff7dffff irq 16 at device 3.0 on pci5 pcib5: em0 requested memory range 0xff7c0000-0xff7dffff: good pcib5: em0 requested I/O range 0xb880-0xb8bf: in range em0: [FILTER] em0: bpf attached em0: Ethernet address: NN:NN:NN:NN:NN:NN found-> vendor=0x8086, dev=0x1010, revid=0x01 domain=0, bus=5, slot=3, func=1 class=02-00-00, hdrtype=0x00, mfdev=1 cmdreg=0x0017, statreg=0x0230, cachelnsz=8 (dwords) lattimer=0x40 (1920 ns), mingnt=0xff (63750 ns), maxlat=0x00 (0 ns) intpin=b, irq=17 powerspec 2 supports D0 D3 current D0 MSI supports 1 message, 64 bit pci0:5:3:1: reprobing on driver added em1: port 0xbc00-0xbc3f mem 0xff7e0000-0xff7fffff irq 17 at device 3.1 on pci5 pcib5: em1 requested memory range 0xff7e0000-0xff7fffff: good pcib5: em1 requested I/O range 0xbc00-0xbc3f: in range em1: [FILTER] em1: bpf attached em1: Ethernet address: NN:NN:NN:NN:NN:NN ----- And this message is stable across repeated kldunload/kldload. I guess that when Yony will enable verbose boot and will show us kernel messages from two successive kldunload/kldload sequences, we will get some additional information about what's going on. -- Eygene _ ___ _.--. # \`.|\..----...-'` `-._.-'_.-'` # Remember that it is hard / ' ` , __.--' # to read the on-line manual )/' _/ \ `-_, / # while single-stepping the kernel. `-'" `"\_ ,_.-;_.-\_ ', fsc/as # _.-'_./ {_.' ; / # -- FreeBSD Developers handbook {_.-``-' {_/ #