LWN.net Logo

Systemd 197 released

Systemd 197 released

Posted Jan 8, 2013 19:53 UTC (Tue) by mezcalero (subscriber, #45103)
In reply to: Systemd 197 released by cesarb
Parent article: Systemd 197 released

Regarding USB cards it's hard to find a solution that pleases everybody. If we'd bind things to MAC addresses for USB, then it is difficult to replace broken hardware. If we bind things to the USB path then you cannot plug things into different USB plugs. Neither is ideal.

Ultimately we decided to just stick to the path-based naming for everything, since it would be weird to deviate only for USB for this, and given that none of the two options is clearly better than the other we think uniformity is a good thing to have.

You could see this from a different perspective: the new predictable names are really useful for admins to know which physical RJ45 ethernet port to plug their cat5 cable into. With the scheme we opted for as a default now you can now consider the USB ethernet adapter simply a trivial converter of cat5, so that instead of having to map cat5 cables to RJ45 port you now just have to map a cat5 cable to a USB port. Looking at it that way makes this choice kinda natural, doesn't it? If you think about it this way the USB ethernet adapter is really just a converter you can randomly replace, and the focus is stricly on matching up cables and physical ports on the computer itself.

That all said, this all isn't set in stone. We are very open to changes.

Lennart


(Log in to post comments)

Systemd 197 released

Posted Jan 8, 2013 21:02 UTC (Tue) by dave_malcolm (subscriber, #15013) [Link]

Minor bikesheddery: are underscores (or dashes) allowed within names?
en_x000000000466
en_p5_s0
en_s1
ww_x028037ec0200
seems to me to be easier for (this human) to parse than
enx000000000466 
enp5s0
ens1
wwx028037ec0200

Systemd 197 released

Posted Jan 8, 2013 21:26 UTC (Tue) by mezcalero (subscriber, #45103) [Link]

They are allowed, but interface names are limited to IFNAMSIZ characters, and that's defined to 16 on Linux (and can't realistically be changed), of which one must be the trailing 0. That means you have only 15 chars. A MAC address formatted in hex requires 12 characters. That means you only have 3 characters left for the prefix. An underscore is hence a luxury you can't afford. WE could use it for the other policies, but 15 chars for them is not plentiful either (think about USB device paths!), and uniformity is kinda nice too.

Systemd 197 released

Posted Jan 8, 2013 21:51 UTC (Tue) by jimparis (subscriber, #38647) [Link]

It's not really clear from the documentation -- what happens if the USB path doesn't fit in 15 characters?

Systemd 197 released

Posted Jan 8, 2013 22:52 UTC (Tue) by mezcalero (subscriber, #45103) [Link]

Then we won't use that name. The rule is basically: if the chosen policy makes sense for a device, all the necessary information for it is available for a device, and if the name would fit in IFNAMSIZ then we use it, otherwise we give up, and try another policy, or just stick to the kernel name.

Systemd 197 released

Posted Jan 9, 2013 2:30 UTC (Wed) by dave_malcolm (subscriber, #15013) [Link]

Aha! Given that constraint, it makes sense. Thanks.

Systemd 197 released

Posted Jan 9, 2013 5:34 UTC (Wed) by jthill (guest, #56558) [Link]

Does anyone value being able to sight-read the actual address values? Why not base64 them?

Systemd 197 released

Posted Jan 9, 2013 23:18 UTC (Wed) by mathstuf (subscriber, #69389) [Link]

> but interface names are limited to IFNAMSIZ characters

I suppose there's a 'DFINSIZ' limit for the length of variable names too. Either that or the 'E' key was broken that day…

Systemd 197 released

Posted Jan 9, 2013 23:53 UTC (Wed) by Cyberax (✭ supporter ✭, #52523) [Link]

Yeah, and they also were not careful - one vowel accidentally got in. Standards are slipping these days...

I always wondered how EIEIO did happen.

Systemd 197 released

Posted Jan 10, 2013 11:20 UTC (Thu) by mgedmin (subscriber, #34497) [Link]

IBM motto: "We found five vowels hiding in a corner, and we used
them _all_ for the 'eieio' instruction so that we wouldn't have to use
them anywhere else"
-- Linus Torvalds

Systemd 197 released

Posted Jan 11, 2013 20:30 UTC (Fri) by pcarrier (subscriber, #65446) [Link]

I always assumed it was a pun on the “Old MacDonald had a farm” lyrics.

http://en.wikipedia.org/wiki/Old_MacDonald_Had_a_Farm

Systemd 197 released

Posted Jan 11, 2013 20:49 UTC (Fri) by s_hoop (subscriber, #49503) [Link]

I have heard this before too. Seems likely to me based on this anecdata ;-)

Systemd 197 released

Posted Jan 12, 2013 10:19 UTC (Sat) by zwenna (subscriber, #64777) [Link]

Indeed, the error message corresponding to EIEIO is Computer bought the farm.

Systemd 197 released

Posted Jan 8, 2013 22:46 UTC (Tue) by DarrenJThompson (guest, #88685) [Link]

Is there a relatively easy way to provide a linking of these names to the more traditional names, for those sort of "dumb apps/scrips" that make an assumption about device names and are not easily adapted.
From what i read, the udev naming rules/mapping thing still works but it would be nice to have that confirmed.

Can the device be mapped into more than one namespace (e.g. eth0 and MAC and path-based) at the same time?

Systemd 197 released

Posted Jan 8, 2013 22:54 UTC (Tue) by mezcalero (subscriber, #45103) [Link]

No, network interfaces cannot have alias names. This is different from device nodes in /dev where we can add as many alias names via symlinks as we want while leaving the primary kernel name intact (and which is what udev does). For network interfaces we can only control one name and one name only. If people wrote their stuff with ethX names in mind, then they should just not use the new naming policy.

Systemd 197 released

Posted Jan 8, 2013 23:01 UTC (Tue) by ovitters (subscriber, #27950) [Link]

Could the kernel be changed to allow this, or is that too messy?

Systemd 197 released

Posted Jan 9, 2013 0:20 UTC (Wed) by Cyberax (✭ supporter ✭, #52523) [Link]

It's a long-standing issue in Linux (and UNIX). Network devices live in a completely separate namespace from the 'general' devices.

There's also a special API to interact with them which actually uses device _indexes_, not names. As far as I remember, there was not even a way to lookup index by name - one has to enumerate all the devices and get their names using SIOCGIFNAME (though I might be mistaken here).

It's a legacy mess, in short.

Systemd 197 released

Posted Jan 9, 2013 7:36 UTC (Wed) by dankamongmen (subscriber, #35141) [Link]

Nowadays one would use netlink, but yeah, same deal.

Systemd 197 released

Posted Jan 10, 2013 10:10 UTC (Thu) by justincormack (subscriber, #70439) [Link]

If_name to index(3) which is an ioctl will do it without enumeration. And net link can use names...

Systemd 197 released

Posted Jan 9, 2013 0:29 UTC (Wed) by mezcalero (subscriber, #45103) [Link]

People have considered that, but it's not that easy unfortunately.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds