From: "Julian Calaby" <julian.calaby@gmail.com>
To: "Rob Landley" <rob@landley.net>
Cc: "Theodore Tso" <tytso@mit.edu>,
"James Bottomley" <James.Bottomley@steeleye.com>,
"Matthew Wilcox" <matthew@wil.cx>,
linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org,
"Jens Axboe" <axboe@suse.de>,
"Suparna Bhattacharya" <suparna@in.ibm.com>,
"Nick Piggin" <piggin@cyberone.com.au>
Subject: Re: What still uses the block layer?
Date: Tue, 16 Oct 2007 09:49:04 +1000 [thread overview]
Message-ID: <646765f40710151649o490c4e61y99864e16bba490bc@mail.gmail.com> (raw)
In-Reply-To: <200710151511.29748.rob@landley.net>
[adding back CCs which were dropped because I'm stupid - sorry!]
On 10/16/07, Rob Landley <rob@landley.net> wrote:
> On Monday 15 October 2007 5:27:55 am Julian Calaby wrote:
> > On 10/15/07, Rob Landley <rob@landley.net> wrote:
> > > On Monday 15 October 2007 4:06:20 am Julian Calaby wrote:
> > > > On 10/15/07, Rob Landley <rob@landley.net> wrote:
> > > > > I note that the eth0 and eth1 names are dynamically assigned on a
> > > > > first come first serve basis (like scsi). This never causes me a
> > > > > problem because the driver loading order is constant, and once you
> > > > > figure out that eth0 is gigabit and eth1 is the 80211g it _stays_
> > > > > that way across reboots, reliably. Yeah, it's a heuristic. Hands up
> > > > > everybody relying on such a heuristic in the real world.
> > > >
> > > > Umm, not quite, from my experiences with pre-production wireless
> > > > drivers, (another story, another time) fancy stuff is being done in
> > > > udev to make sure that your gigabit card is always assigned to eth0.
> > >
> > > I remember building a 2.4 kernel, statically linking in all the drivers,
> > > and getting the ethernet devices showing up in a reliable order for
> > > years. Where does the need for fancy stuff come in?
> >
> > I remember that too. In fact, I have had no issues with network card
> > enumeration order, outside my own inexperience and stupidity.
> >
> > However, this sort of thing is needed now because of the various types
> > of hotpluggable networking devices, e.g. USB 802.11 cards, USB
> > ethernet cards, PCMCIA, etc.
>
> I thought the strategy was just to scan the hotpluggable busses after the
> non-hotpluggable busses.
My (practical) experience is that I couldn't guarantee which card was
which. (I remember once where it changed over a kernel re-compile) So
my solution, before Debian's persistent naming scheme appeared, was to
check it after every new kernel and make sure my config matched up
with the names of the physical interfaces.
> > And yes, PCMCIA worked fine for ages, but
> > usually you'd never have more than one PCMCIA network card.
>
> Still don't, but presumably the slots are scanned in a reliable order so if
> the cards are always present on bootup in the same slots, they'd stay in that
> order.
Well, yes and no. My gut feeling is that it's probed like PCI cards
are. They're initialised when the drivers are loaded, and not before,
as such, there are no guarantees which card will be initialised first.
- and anyway, what happens if you plug them in in a different order?
> > Personally, I use 2 different usb network cards, and I'm quite
> > comforted to know that the 802.11a one is always wlan0, and the
> > 802.11b/g one is always wlan1.
>
> So if I have a USB 100baseT adapter, and I boot with it plugged in, it'll
> potentially come before my built-in wireless card due to ordering based on
> device type?
Ok, firstly the 100baseT adapter will be named something like ethX,
the wireless card will most likely be named something like wlanX.
Now let's say your laptop has a built in ethernet card.
So, we'll assume a modular kernel, with the module "usbnet" for the
usb card and "e100" for the onboard card:
If the "usbnet" module is loaded first, then initially, according to
the kernel, the usb card will be eth0 and the built in one eth1.
Now let's assume that, on the PCI bus, the USB controller is in a
lower slot number than the network card. (highly likely, given that
the network card is most likely external to the chipset of the laptop)
It's pretty likely that the USB controller will have it's module
loaded first, before the built in network card. At this point, it'll
send out hotplug events for all it's children (root hubs, etc.) and
eventually an event will be sent out for the usb network card. Now, at
this point, it's impossible to say which one will claim eth0 first.
Now, in my case, with my two wireless cards, what happens if I plug
the 802.11b/g one in first? If this fancy renaming didn't happen, it'd
end up with the name wlan0 and, hence, try to connect to the network
which the 802.11a one is supposed to connect to.
This is not a good thing.
I also have to make the point that this has been happening all over
the kernel, well before I started using it. Video4Linux and DVB
devices can be USB, and the order the /dev/videoX nodes appear in is
determined by the plugging order. IRDA cards, sound cards, usb
devices, framebuffers, mice, keyboards, loopback devices, etc. all
have the same "issue". (and annoyingly, they all have different ways
of getting around it, or not)
And to make one final point, getting right back to the initial parts
of the discussion, at the end of the day, your SATA disk, IDE disk,
USB disk and the CF card in your camera are all mass storage devices -
they all work in a fairly similar way. You want to mount filesystems
from all of them, and when you run low level tools, like parted or
whatever, you want them all to behave in the same way. If the kernel
abstract away the nastinesses of talking SATA, IDE, USB mass storage,
or CF - and hence, make them all behave in the same, standard, way,
why the hell not?
Thanks,
--
Julian Calaby
Email: julian.calaby@gmail.com
next prev parent reply other threads:[~2007-10-15 23:49 UTC|newest]
Thread overview: 93+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-12 1:11 Rob Landley
2007-10-13 22:05 ` Matthew Wilcox
2007-10-14 5:54 ` David Newall
2007-10-14 17:46 ` Stefan Richter
2007-10-14 22:35 ` Tilman Schmidt
2007-10-14 23:36 ` Rob Landley
2007-10-15 1:23 ` Neil Brown
2007-10-15 5:44 ` Stefan Richter
2007-10-15 9:26 ` Rob Landley
2007-10-15 16:08 ` Matthew Wilcox
2007-10-15 17:10 ` Stefan Richter
2007-10-16 3:06 ` david
2007-10-16 5:56 ` Stefan Richter
2007-10-16 10:19 ` Alan Cox
2007-10-16 19:54 ` david
2007-10-16 19:54 ` Matthew Wilcox
2007-10-16 20:18 ` Stefan Richter
2007-10-16 20:34 ` Theodore Tso
2007-10-16 20:56 ` Stefan Richter
2007-10-16 20:55 ` david
2007-10-16 21:49 ` Alan Cox
2007-10-17 9:48 ` Gabor Gombas
2007-10-17 17:23 ` Stefan Richter
2007-10-17 21:04 ` david
2007-10-15 20:29 ` Wilfried Klaebe
2007-10-14 22:24 ` James Bottomley
2007-10-14 23:45 ` Rob Landley
2007-10-15 1:45 ` Theodore Tso
2007-10-15 8:04 ` Rob Landley
2007-10-15 9:06 ` Julian Calaby
2007-10-15 10:08 ` Rob Landley
2007-10-15 17:33 ` Greg KH
2007-10-16 2:54 ` david
2007-10-16 4:04 ` Matthew Wilcox
2007-10-16 4:11 ` Arjan van de Ven
2007-10-16 4:15 ` david
2007-10-16 4:21 ` Greg KH
2007-10-16 5:00 ` david
[not found] ` <646765f40710150327i78519a0fvaea7a83d5975b180@mail.gmail.com>
[not found] ` <200710151511.29748.rob@landley.net>
2007-10-15 23:49 ` Julian Calaby [this message]
2007-10-15 10:32 ` Loïc Grenié
2007-10-15 21:09 ` Rob Landley
2007-10-15 11:19 ` Neil Brown
2007-10-15 21:34 ` Rob Landley
2007-10-15 21:46 ` Jeff Garzik
2007-10-15 22:01 ` Alan Cox
2007-10-15 23:41 ` Neil Brown
2007-10-16 2:12 ` david
2007-10-15 13:21 ` Theodore Tso
2007-10-15 13:29 ` Alan Cox
2007-10-15 13:35 ` Theodore Tso
2007-10-15 17:44 ` Jeff Garzik
2007-10-15 14:46 ` Douglas Gilbert
2007-10-16 2:51 ` david
2007-10-15 13:37 ` OOM killer gripe (was Re: What still uses the block layer?) Nick Piggin
2007-10-15 9:52 ` Rob Landley
2007-10-15 15:08 ` Nick Piggin
2007-10-16 6:22 ` David Newall
2007-10-20 9:48 ` Pavel Machek
2007-10-15 11:40 ` Theodore Tso
2007-10-20 9:50 ` Pavel Machek
2007-10-16 3:55 ` Eric W. Biederman
2007-10-16 4:10 ` david
2007-10-16 4:45 ` Eric W. Biederman
2007-10-16 6:59 ` Nick Piggin
2007-10-16 4:38 ` Eric W. Biederman
2007-10-16 6:38 ` Rob Landley
2007-10-16 9:31 ` Eric W. Biederman
2007-10-16 10:28 ` Alan Cox
2007-10-16 23:59 ` Rob Landley
2007-10-16 7:34 ` Nick Piggin
2007-10-18 13:00 ` Rogier Wolff
2007-10-19 6:49 ` Rob Landley
2007-10-19 7:21 ` Rogier Wolff
2007-10-16 20:37 ` Andrew Morton
2007-10-17 5:34 ` What still uses the block layer? Valdis.Kletnieks
2007-10-17 6:07 ` david
2007-10-15 6:00 ` Greg KH
2007-10-15 8:36 ` Rob Landley
2007-10-15 13:08 ` Alan Cox
2007-10-15 14:00 ` Arjan van de Ven
2007-10-15 18:56 ` Matthew Garrett
2007-10-15 17:25 ` Greg KH
2007-10-15 18:00 ` Matthew Wilcox
2007-10-15 18:46 ` Jeff Garzik
2007-10-16 6:33 ` Stefan Richter
2007-10-17 23:43 ` Bill Davidsen
2007-10-15 22:54 ` Rob Landley
2007-10-15 8:52 ` Christoph Hellwig
2007-10-15 13:10 ` James Bottomley
2007-10-15 21:51 ` Rob Landley
2007-10-15 0:45 ` Luben Tuikov
2007-10-15 6:51 ` Rob Landley
2007-10-15 8:37 ` Luben Tuikov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=646765f40710151649o490c4e61y99864e16bba490bc@mail.gmail.com \
--to=julian.calaby@gmail.com \
--cc=James.Bottomley@steeleye.com \
--cc=axboe@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=matthew@wil.cx \
--cc=piggin@cyberone.com.au \
--cc=rob@landley.net \
--cc=suparna@in.ibm.com \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®