LANANA: To Pending Device Number Registrants
Quoted 1 line
Quoted 1 line
The "eth0..N" naming is done RIGHT!
Only if it's augmented by additional device IDs, such as the "what 's the physical connection for this interface" sort of primitive that's been mentioned.
Quoted 4 lines
Nothing to do with the kernel but, one should then argue that the current stuff in
/etc/sysconfig/network-scriptsis broken for hotplug as placing a new network adapter into your bus will renumber your interfaces causing them to be ifconfig'd wrongly.
Not just hotplug -- any configuration where these identifiers can change "meaning" (which physical device?) over time. For example, adding/removing/swapping hardware does it too.
Quoted 2 lines
You'd want to associate the IP
configuration stuff with the particular network interface, by MAC address.
Bob Glamm had the right sort of idea: if the kernel is going to be assigning tool-visible device names, the tools need to have and use additional device metadata, perhaps like this:
Quoted 6 lines
# start up networking
for i in eth0 eth1 eth2; do
identify device $i
get configuration/config procedure for device $i identity
configure $i
done In fact that "identify" step is probably worth enabling for EVERY (!) device, not just network interfaces. (Which, since they don't show up with major/minor device numbers today, are perhaps a bit offtopic for the original thrust of this thread ... :)
I suppose that for network interface names, some convention for interface ioctls would suffice to solve that "identify" step. PCI devices would return the slot_name, USB devices need something like a patch I posted to linux-usb-devel a few months back.
- Dave
Quoted 4 lines · David Brownell
I suppose that for network interface names, some convention for interface ioctls would suffice to solve that "identify" step. PCI devices would return the
slot_name, USB devices need something like a patch I posted to linux-usb-devel a few months back.
This is crap. For user tools (_especially_ for admin scripts) ioctls are damn inconvenient. I don't have Perl or Python on the root fs. And I don't need yet another binary lurking in /sbin, thank you very much.
If you want to do it - do it right. Accessing /dev/eth/<n>/MAC is trivial. Wanking with ioctls is not. And populating such tree is as simple as it gets.
Quoted 6 lines
Quoted 4 lines
I suppose that for network interface names, some convention for interface ioctls would suffice to solve that "identify" step. PCI devices would return the
slot_name, USB devices need something like a patch I posted to linux-usb-devel a few months back.This is crap.
Only the ioctl part, though I confess to trolling for a better proposal ... :)
Quoted 3 lines
If you want to do it - do it right. Accessing /dev/eth/<n>/MAC is trivial. Wanking with ioctls is not. And populating such tree is as simple as it gets.
For links without a stable MAC, /.../net/<ifname>/{pci-slot,usb-path,...} is more like it, but I think that class of solution should be fine.
Now ... what should be the roles of "regular" file ops, devfs, usbdevfs, procfs, and "devreg" ? That's the part that doesn't seem simple yet. I'd expect a few rounds of code/design changes.
- Dave
Quoted 8 lines · David Brownell
Only if it's augmented by additional device IDs, such as the "what 's the physical connection for this interface" sort of primitive that's been mentioned.
[...]
I suppose that for network interface names, some convention for interface ioctls would suffice to solve that "identify" step. PCI devices would return theslot_name, USB devices need something like a patch I posted to linux-usb-devel a few months back.
At this point of the discussion I would like to point to the Device Registry patch (http://www.tjansen.de/devreg) that already solves these problems and offers stable device ids for the identification of devices and finding their /dev nodes.
The devreg device id has four components: the bus identifier, the location of the device (for pci bus number and slot number, for usb the bus number and a list of port numbers), a model (product and device id) and, if available, a serial number.
With the matching algorithm from the libdevreg library you can correctly identifiy after a hotplug action or reboot
- each device that has a serial numberas most of the better USB devices do, even if it location has changed
- a device without a serial number whose location has not changed
If you have a device without serial number and you changed its location the device id can be used for a guess that is correct as long as you dont have two devices of the same kind (same product and vendor ids).
bye...
Quoted 10 lines · Tim Jansen
Quoted 8 lines · David Brownell
Only if it's augmented by additional device IDs, such as the "what 's the physical connection for this interface" sort of primitive that's been mentioned.
[...]
I suppose that for network interface names, some convention for interface ioctls would suffice to solve that "identify" step. PCI devices would return theslot_name, USB devices need something like a patch I posted to linux-usb-devel a few months back.
Quoted 4 lines
At this point of the discussion I would like to point to the Device Registry patch (http://www.tjansen.de/devreg) that already solves these problems and offers stable device ids for the identification of devices and finding their /dev nodes.
Does your approach solve the problem of USB devices, like mice, that don't have device ID's of any sort, where topology is the only way to distinguish them? IIRC, the USB development team was planning to use topology to provide a limited ability to associate a mouse on a given port with a display, when XFree86 supports per-Xinerama-display input device associations.
They new VT console work would benefit from this, too.
Miles
Quoted 6 lines
Quoted 5 lines
At this point of the discussion I would like to point to the Device Registry patch (http://www.tjansen.de/devreg) that already solves these problems and offers stable device ids for the identification of devices and finding their /dev nodes.
Quoted 7 lines
Does your approach solve the problem of USB devices, like mice, that don't have device ID's of any sort, where topology is the only way to distinguish them? IIRC, the USB development team was planning to use topology to provide a limited ability to associate a mouse on a given port with a display, when XFree86 supports per-Xinerama-display input device associations.
They new VT console work would benefit from this, too.
I have been thinking about this. If you think about it multi-desktop
systems are very similar to clustering. The idea is something can only be seen by certain things in the system. With clustering you might want a shared memeory segment (/dev/shm) visble to certain NUMA nodes. With multi-desktop systems you have several users using the same box. Now you don't want to user 3 being able to draw something to users 2 screen.
So how do you handle this? Since we are treating the device as a
filesystem we can control the permissons on all the files in the filesystem. This gives the extra bonus of the ability to make certain device features global to certain groups. The best way I can see it is to setup workstation groups. This is pretty easy to do with most systems since most have a group per user. So for desktop one you have it belong to user joe. So when he want to some device on his machine he mounts the filesystem and all the files and directories belong to joe. No one else can use that device. Now what if you want several people to be able to use the same desktop. The sys admin could create a desktop1 group and then ensure the device is mounted with the desktop1 group. Then anyone belonging to the desktop group can access this hardware. The extra bonus is the ability to allow certain feature of a device to be exposed to same someone in your group. This could be a really powerful feature. Unfortunely I can't think of a example off the top of my head.
Quoted 25 lines · Tim Jansen
Quoted 8 lines · David Brownell
Only if it's augmented by additional device IDs, such as the "what 's the physical connection for this interface" sort of primitive that's been mentioned.
[...]
I suppose that for network interface names, some convention for interface ioctls would suffice to solve that "identify" step. PCI devices would return theslot_name, USB devices need something like a patch I posted to linux-usb-devel a few months back.At this point of the discussion I would like to point to the Device Registry patch (http://www.tjansen.de/devreg) that already solves these problems and offers stable device ids for the identification of devices and finding their /dev nodes.
The devreg device id has four components: the bus identifier, the location of the device (for pci bus number and slot number, for usb the bus number and a list of port numbers), a model (product and device id) and, if available, a serial number.
With the matching algorithm from the libdevreg library you can correctly identifiy after a hotplug action or reboot
- each device that has a serial numberas most of the better USB devices do, even if it location has changed
- a device without a serial number whose location has not changed
Quoted 3 lines
If you have a device without serial number and you changed its location the device id can be used for a guess that is correct as long as you dont have two devices of the same kind (same product and vendor ids).
Hmm. It's interesting to me that there have been no replies discussing Tim's code. Are any of you looking at it or do you simply think it is inconsequential and deserves to be ignored?
Or, perhaps folks feel that it is off-topic?
Since, as Alan mentioned, the lack of device serial numbers for USB mice and keyboards means that the only way to implement a relatively stable assignment of USB input devices to a quasi-multiuser system with multi-headed displays is by paying attention to USB topology, I would like us to explore any implementation that includes this support. As Linus mentioned, this approach is unreliable, but it's all we have for these devices -- Topology can be disturbed by a variety of events (plugging a hub into a different host-controller port, etc).
Miles
Quoted 5 lines
Hmm. It's interesting to me that there have been no replies discussing Tim's code. Are any of you looking at it or do you simply think it is inconsequential and deserves to be ignored?
Or, perhaps folks feel that it is off-topic?
Haven't had the chance to look at it. This weekend I will take a look.
Quoted 8 lines
Since, as Alan mentioned, the lack of device serial numbers for USB mice and keyboards means that the only way to implement a relatively stable assignment of USB input devices to a quasi-multiuser system with multi-headed displays is by paying attention to USB topology, I would like us to explore any implementation that includes this support. As Linus mentioned, this approach is unreliable, but it's all we have for these devices -- Topology can be disturbed by a variety of events (plugging a hub into a different host-controller port, etc).
For identifying this is probably the right approach. However identifying is not enough, as the ioctl discussion has shown. Capabilities are needed. How can the device registry provide that information ? If we register it together with the device, we might spend a lot of resources needlessly and can't deal with devices whose capabilities change dynamically.
In addition how do we export the information ? Proc ? Device nodes (bad for network devices) ?
Regards
Oliver
Quoted 5 lines
Quoted 5 lines
At this point of the discussion I would like to point to the Device Registry patch (http://www.tjansen.de/devreg) that already solves these problems and offers stable device ids for the identification of devices and finding their /dev nodes.
Quoted 7 lines
Quoted 4 lines
The devreg device id has four components: the bus identifier, the location of the device (for pci bus number and slot number, for usb the bus number and a list of port numbers), a model (product and device id) and, if available, a serial number.
Hmm. It's interesting to me that there have been no replies discussing Tim's code.
I'd want to put it in the context of some of the USB work already done, and also know how it generalizes to other busses ...
For example, that usb-devname patch of mine, posted to linux-usb-devel somewhere around 12/6/2000 (2.4.0-test12), which worked the issue of teaching USB about "stable" identifiers (like pci slot_name, except it didn't address functions within device configurations since PCI doesn't have that notion of "configuration").
Or the patch providing a standard API for USB device drivers to report what major/minor device numbers are associated with a given interface (I think it was Alan Barnett who provided that).
Or the original (userspace) XML dump of XML tree structure, shown at http://jusb.sourceforge.net/?selected=tree ... it's not clear to me which structural information there is also found in the "devreg" XML syntax (from the kernel!), and which isn't. (Class information omitted from "devreg"? Interface structure?) Most of it's known to be needed.
For example, USB "bus numbers" are themselves unstable identifiers; PCI slot_name fields work better, at least for host controllers (most!) which use PCI. If "devreg" uses "bus numbers", that needs to change.
- Dave
Quoted 3 lines · you
For identifying this is probably the right approach. However identifying is not enough, as the ioctl discussion has shown. Capabilities are needed. How can the device registry provide that information ?
The device registry provides you with device's capabilities and has different meachanisms for different needs:
- each device node has a type that describes the API (read/write format, ioctls) of the node. The type is set when you call devfs_register2 (a new version of devfs_register, set sets the node type and a connection to the physical device). So when you want to play pcm sound and your app supports OSS you search for the type "sound/oss/dsp"
- each physical device gets a type that is intended to be shown to the user and may be simplified. It can be used for things like selecting a appropriate icon for a device. It is not guaranteed to be correctly and some devices may not have a type.
- each bus subsystem and driver is free to add its own information. For example the PCI subsystem adds things like the interrupt, memory space and so on. User-space apps that dont know about it are required to ignore it.
Quoted 3 lines
If we register it together with the device, we might spend a lot of resources needlessly and can't deal with devices whose capabilities change dynamically.
No, the device and bus-subsystem information is generated on-demand, the type isnt guaranteed to be correct (and can be changed at any time) and the API of your device nodes hopefully doesnt change or otherwise you will really confuse the apps.
Quoted 2 lines
In addition how do we export the information ? Proc ? Device nodes (bad for network devices) ?
The last version used a large XML file, but the next will expose the information in a (very) large number of proc files, each containing a single value. This required some changes in the proc API, but unfortunately I did not get a single comment on my patch
(http://www.uwsg.indiana.edu/hypermail/linux/kernel/0105.1/1041.html)..
bye...
Quoted 3 lines
For identifying this is probably the right approach. However identifying is not enough, as the ioctl discussion has shown. Capabilities are needed. How can the device registry provide that information ?
My feedback on "device registry 0.1" was that I really liked the approach of _modeling_ devices by attributes ... which reminded me of the good things in "attribute based naming" a la X.500/LDAP models. I suspect 0.2 went too far, using XML to expose those attributes to userspace ... :)
If each device had a directory node, those directory nodes could be grouped as a "registry" ... the directory contents would list the various bus-specific or type-specific capabilities/attributes. Would those directory nodes be the /dev/... or /devfs/... nodes? I suspect not.
Quoted 3 lines
If we register it together
with the device, we might spend a lot of resources needlessly and can't deal with devices whose capabilities change dynamically.
So obviously such a registry should query the drivers/busses directly.
Quoted 1 line
In addition how do we export the information ? Proc ?
I think Tim has some ideas here, given a patch I scanned recently...
- Dave