Re: Network Device Naming mechanism and policy

From: Kay Sievers
Date: Tue Mar 24 2009 - 12:29:50 EST


On Tue, Mar 24, 2009 at 17:21, Patrick McHardy <kaber@xxxxxxxxx> wrote:
> Matt Domsch wrote:
>>
>> 2) udev may have rules to change the device names. ÂThis is most often
>> Â seen in the '70-persistent-net.rules' file. ÂHere we have
>> Â additional challenges:
>>
>> ...
>>
>> Â c) udev may not always be able to change a device's name. ÂIf udev
>> Â Â Âuses the kernel assignment namespace (ethN), then a rename of
>> Â Â Âeth0->eth1 may require renaming eth1->eth0 (or something else).
>> Â Â ÂUdev operates on a single device instance at a time, it becomes
>> Â Â Âdifficult to switch names around for multiple devices, within
>> Â Â Âthe single namespace.
>
> I would classify this as a bug, especially the fact that udev doesn't
> undo a failed rename, so you end up with ethX_rename. Virtual devices
> using the same MAC address trigger this reliably unless you add
> exceptions to the udev rules.

This is handled in most cases. Virtual interfaces claiming a
configured name and created before the "hardware" interface are not
handled, that's right, but pretty uncommon.

> You state that it only operates on one device at a time. If that is
> correct, I'm not sure why the _rename suffix is used at all instead
> of simply trying to assign the final name, which would avoid this
> problem.

How? The kernel assignes the names and the configured names may
conflict. So you possibly can not rename a device to the target name
when it's name is already taken. I don't see how to avoid this.

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