RE: Persistent device numbers

Borsenkow Andrej (Andrej.Borsenkow@mow.siemens.ru)
Wed, 8 Aug 2001 11:27:06 +0400


To summarize what I've got so far.

1. To answer the question - I try to solve a problem of persistent
device (in general sense, meaning scsi0, eth2, disk3 etc) naming :-) I
want to avoid, that rebooting with failing Ethernet card or plugging in
additional SCSI controller suddenly moves eth1 into eth0 or scsi0 to
scsi1. I want to make sure that a given physical device always is
referred to by the same name irrespectively of any other configuration
changes.

2. I generally agree that it is mostly user-space problem. With the
large if - *if* kernel provides unique physical device identification.
Currently it is not the case. Just review recent thread " How does
"alias ethX drivername" in modules.conf work?"
(http://www.uwsg.indiana.edu/hypermail/linux/kernel/0108.0/1230.html).
There is no way to assure that an Ethernet controller plugged into slot
3 of my PCI bus is always named eth2.

3. devfs does not help here. It provides consistent view of *logical*
namespace - but it changes nothing in how physical devices are mapped
into logical.

What Linux lacks is the ability to refer to devices by there unique path
(please, call it whatever you want, I just find it natural and it is
used in many systems). You may not have module loaded that controls card
in PCI slot 3 but you *do* know that you have a card there and that the
card is of type network (from PCI id). So, you can refer to this card
even if module is not loaded. What I basically suggest is to shift
logical number allocation from actual drivers into upper layer (PCI in
this case). Then SCSI/Ethernet/whatever drivers will get logical numbers
already assigned. And of course tool to assign these numbers belongs to
user space :-)

There are cases when it is not possible. Legacy ISA is an example. In
this case you have no way but reserve some numbers and assign them to
cards using IRQ/Port as it is currently. It seems doable.

-andrej
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/