[systemd-devel] [RFC] networkd/udev: match on 'ethernet' devices

Marcel Holtmann marcel at holtmann.org
Fri Jan 3 17:56:18 PST 2014


Hi Greg,

>>>> I just pushed a change[0] which allows the match syntax
>>>> "Type=ethernet" to match on network devices without a DEVTYPE.
>>>> 
>>>> We had a discussion on IRC whether we should call it Type=wired or
>>>> Type=ethernet. I think the former may be more intuitive, but the
>>>> latter seems to be more in line with what is done elsewhere (connman
>>>> calls it ethernet, and udev prefixes the devices names with 'en').
>>>> 
>>>> Any thoughts?
>>> 
>>> Any reason why the kernel can't be setting this value in the first place
>>> so you don't have to rely on it being "null"?
>>> 
>>> Seems like a kernel issue.
>> 
>> I asked Marcel the same thing earlier. He said:
>> 
>> [Friday 03 January 2014] [19:58:22] <holtmann>  Because you have to
>> touch every single driver to get this done properly.
>> [Friday 03 January 2014] [19:58:34] <holtmann>  So DEVTYPE= means it
>> is wired Ethernet.
>> [Friday 03 January 2014] [19:58:42] <holtmann>  If that is not true,
>> then that is a bug.
>> 
>> From my point of view, I'd prefer the kernel just doing the right
>> thing (and I'd be happy to write the patches), but my impression was
>> that that's not going to happen...(?)
> 
> It shouldn't need to be set for every driver, wireless doesn't work this
> way, so there is lots of precident for how to do this in only a few
> lines of kernel code :)

when I did the initial DEVTYPE support, it was easy for “wlan” since the subsystem is taking care of creating the netdev. So you have one places for mac80211 drivers and some extra work for the cfg80211 only drivers. It was all minimal work. So was “bluetooth” since it is one central place and same applied to “wimax”. The “wwan” was lucky part since the drivers already did the FLAG_WWAN to pick the wwan%d ifname.

For Ethernet cards it was just the wild west. So I left them out of the picture. It is also more important to detect the devices that need extra management handling. Like WiFi, Bluetooth, 3G/LTE etc. The indication of DEVTYPE here is mainly that nobody goes and tries to run DHCP until another management entity tell you the device is ready. For Ethernet or DEVTYPE=“” you do not need to know who manages it since there is nobody.

Regards

Marcel



More information about the systemd-devel mailing list