Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Jan 2009 19:48:19 +0300
From:      Eygene Ryabinkin <rea-fbsd@codelabs.ru>
To:        "Bruce M. Simpson" <bms@FreeBSD.org>
Cc:        Liran Liss <liranl@mellanox.co.il>, freebsd-net@freebsd.org, Oleg Kats <oleg@mellanox.co.il>, "'H.fazaeli'" <fazaeli@sepehrs.com>, Yony Yossef <yonyossef.lists@gmail.com>, Eitan Shefi <eitans@mellanox.co.il>, freebsd-questions@freebsd.org
Subject:   Re: howto determine network device unit number? device.hints?
Message-ID:  <+b/MqS4l8z9bOD9y4AZP70mtFL0@kjaK+/sQ5DW5981v71UogZJPf/0>
In-Reply-To: <496F4FD1.4080602@FreeBSD.org>
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>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
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 <driver>' and
'kldload <driver>' 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: <Intel(R) PRO/1000 Network Connection 6.9.6> 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: <Intel(R) PRO/1000 Network Connection 6.9.6> 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
    {_.-``-'         {_/            #



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?+b/MqS4l8z9bOD9y4AZP70mtFL0>