Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Jan 2009 17:44:56 +0000
From:      "Bruce M. Simpson" <bms@FreeBSD.org>
To:        rea-fbsd@codelabs.ru
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:  <496F7618.8050809@FreeBSD.org>
In-Reply-To: <%2Bb/MqS4l8z9bOD9y4AZP70mtFL0@kjaK%2B/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> <%2Bb/MqS4l8z9bOD9y4AZP70mtFL0@kjaK%2B/sQ5DW5981v71UogZJPf/0>

next in thread | previous in thread | raw e-mail | index | archive | help
Eygene Ryabinkin wrote:
> ...
> 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.
>   

BTW: Thanks for looking further at the software layer first.

VIM is a wee bit easier to use than a bus analyzer.

Most motherboards don't support PCI geographical addressing, so... I 
wager it's the network driver code which may be the source of the 
problem, based on your analysis!

If this code just doing a blind bump of an instance count and using that 
as a "unit number"... well, that's OK and expected for software virtual 
devices, but is counter-intuitive for something like hardware.

But I don't have any mtnic source, so this is pure speculation on my part.

> 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.
>   

Yup, that's right.

> 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.
>   

Hopefully he will chime in...

[bms does some google searching *before* he thinks about throwing his 
toys out of the pram at the Orignal.Poster.]

ding :-) [a light bulb above bms' head]

So... Yony. you're writing a driver.
Maybe there's a bug in it?
That's cool, dude.
Hope it's a nice card and you plan on sharing the sweets with the rest 
of the class. ;-)

But seriously, please mention that you are writing a driver in general 
questions you might ask about the whole system, otherwise, FreeBSD 
volunteers will run around going "Is core code broken?" and that's not 
so good for community stress levels as a whole.

with lemonade,
BMS



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?496F7618.8050809>