Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 655726 - sys-fs/udev: Error changing net interface name eth0 to eno1: File exists
Summary: sys-fs/udev: Error changing net interface name eth0 to eno1: File exists
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: udev maintainers
URL: https://github.com/systemd/systemd/is...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-14 11:05 UTC by Michael Haubenwallner (RETIRED)
Modified: 2018-05-16 14:46 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Haubenwallner (RETIRED) gentoo-dev 2018-05-14 11:05:42 UTC
The Lenovo ThinkStation P710 here does happen to have two different ethernet cards installed on board, besides one PCI Express extension card:

$ lspci | grep Ethernet
On Board:
 00:19.0 Ethernet controller: Intel Corporation Ethernet Connection (2) I218-LM (rev 05)
 08:00.0 Ethernet controller: Intel Corporation I210 Gigabit Network Connection (rev 03)
Extension card:
 09:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 06)

The kernel drivers in use are e1000e, igb and r8169, respectively.

While udevd does successfully rename the PCIe card to "enp9s0", it does want to rename both on board cards to "eno1", with the slower one loosing and remaining named "eth0" or "eth1":

$ grep eth /var/log/dmesg
[    5.422557] e1000e 0000:00:19.0 eth0: (PCI Express:2.5GT/s:Width x1) 6c:0b:84:aa:de:d2
[    5.423340] e1000e 0000:00:19.0 eth0: Intel(R) PRO/1000 Network Connection
[    5.424140] e1000e 0000:00:19.0 eth0: MAC: 11, PHY: 12, PBA No: FFFFFF-0FF
[    5.662783] igb 0000:08:00.0: added PHC on eth1
[    5.664278] igb 0000:08:00.0: eth1: (PCIe:2.5Gb/s:Width x1) 6c:0b:84:aa:de:d3
[    5.665067] igb 0000:08:00.0: eth1: PBA No: 000300-000
[    5.669146] r8169 0000:09:00.0 eth2: RTL8168e/8111e at 0xffff9c1e47379000, 00:e0:4c:99:50:7b, XID 0c200000 IRQ 61
[    5.669920] r8169 0000:09:00.0 eth2: jumbo features [frames: 9200 bytes, tx checksumming: ko]
[   23.520030] igb 0000:08:00.0 eno1: renamed from eth1
[   23.540732] udevd[5925]: Error changing net interface name eth0 to eno1: File exists
[   23.540746] udevd[5925]: could not rename interface '2' from 'eth0' to 'eno1': File exists
[   23.602537] r8169 0000:09:00.0 enp9s0: renamed from eth2

This does happen with both sys-fs/eudev-3.2.5 and sys-fs/udev-236-r1,
as well as sys-fs/eudev-9999 (commit 6f630d32b) and sys-fs/udev-9999 (commit 8d29bef6b),
although with sysfs/udev the error messages are missing in dmesg (maybe because I'm not using systemd here),
but the result is the same.

Now I'm wondering about the "correct" solution to get my network interface names predictable again.

Thanks!
Comment 1 Ian Stakenvicius (RETIRED) gentoo-dev 2018-05-14 14:42:31 UTC
Apologies, I find this bug hilarious since the whole predictive-renaming thing is supposed to entirely prevent this.

So this is a bug in systemd-udev's ruleset for sure.  Eudev doesn't maintain those rules, that's all systemd-udev.

What I would recommend is something akin to what the old-style rule-generator used to do:  add an extra rules file in /etc/udev/rules.d/ that will handle renaming of  the igb card:

/etc/udev/rules.d/81-fix-broken-nic-naming.rules:

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="6c:0b:84:aa:de:d3", ATTR{dev_id}=="0x0", ATTR{type}=="1", NAME="igb0"
Comment 2 Mike Gilbert gentoo-dev 2018-05-14 15:32:30 UTC
Please create an issue upstream for this, and give us a link to it so we can track it.

https://github.com/systemd/systemd/issues/new?template=Bug_report.md
Comment 3 Michael Haubenwallner (RETIRED) gentoo-dev 2018-05-14 15:37:59 UTC
(In reply to Mike Gilbert from comment #2)
> Please create an issue upstream for this, and give us a link to it so we can
> track it.
> 
> https://github.com/systemd/systemd/issues/new?template=Bug_report.md

Wouldn't they require myself to actually use systemd, or is there upstream support for using standalone systemd-udev? How's their opinion about eudev?
Comment 4 Mike Gilbert gentoo-dev 2018-05-14 15:54:41 UTC
> Wouldn't they require myself to actually use systemd, or is there upstream support for using standalone systemd-udev?

I don't think the developers will give you any trouble, so long as you mention it up front.

> How's their opinion about eudev?

I suspect they will not care about how it works in eudev. Since the behavior is identical to udev, I would not bother mentioning it.
Comment 5 Michael Haubenwallner (RETIRED) gentoo-dev 2018-05-16 08:52:18 UTC
It turns out to be a firmware bug here, let's see if upstream is going to do anything about it.

So I would like to do what floppym suggested in upstream report:
> As a workaround, you could remove onboard from the default NamePolicy setting,
> which should cause udev to use the ID_NET_NAME_PATH value instead. Just copy
> /lib/systemd/network/99-default.link to /etc/systemd/network/99-default.link,
> and remove the word onboard.

But how to do this with sys-fs/eudev, as it does not provide any .link file?
Comment 6 Ian Stakenvicius (RETIRED) gentoo-dev 2018-05-16 13:59:21 UTC
(In reply to Michael Haubenwallner from comment #5)
> It turns out to be a firmware bug here, let's see if upstream is going to do
> anything about it.
> 
> So I would like to do what floppym suggested in upstream report:
> > As a workaround, you could remove onboard from the default NamePolicy setting,
> > which should cause udev to use the ID_NET_NAME_PATH value instead. Just copy
> > /lib/systemd/network/99-default.link to /etc/systemd/network/99-default.link,
> > and remove the word onboard.
> 
> But how to do this with sys-fs/eudev, as it does not provide any .link file?

To be honest I'm not sure how one would do this with systemd either -- the current version in centos (the only install I have with systemd right now) doesn't have /lib/systemd/network at all either.

I think the udev and eudev equivalent would be to:

cp /lib/udev/rules.d/80-net-name-slot.rules /etc/udev/rules.d
sed -i '/ID_NET_NAME_ONBOARD/d' /etc/udev/rules.d/80-net-name-slot.rules

..which just removes the rename rule that processes 'ONBOARD'.

Alternatively, the solution I mentioned earlier (assigning your own name directly to the igb) would suffice too; with the caveat that you want to have the rules file prefixed with a number smaller than 80, rather than larger (since these rules will abort if 'NAME' is already assigned)
Comment 7 Mike Gilbert gentoo-dev 2018-05-16 14:46:56 UTC
(In reply to Ian Stakenvicius from comment #6)
> To be honest I'm not sure how one would do this with systemd either -- the
> current version in centos (the only install I have with systemd right now)
> doesn't have /lib/systemd/network at all either.

Upstream removed 80-net-name-slot.rules in systemd-209, moving the name policy logic to .link files.

https://github.com/systemd/systemd/commit/daeb71a36a98834664e4d95773a3629b746f4db8

CentOS 7 restores 80-net-name-slot.rules via a patch against systemd-219. I have no idea why they did this instead of installing 99-default.link.

https://git.centos.org/blob/rpms!systemd.git/c7/SOURCES!0124-rules-bring-back-80-net-name-slot.rules.patch

> I think the udev and eudev equivalent would be to:
> 
> cp /lib/udev/rules.d/80-net-name-slot.rules /etc/udev/rules.d
> sed -i '/ID_NET_NAME_ONBOARD/d' /etc/udev/rules.d/80-net-name-slot.rules
> 
> ..which just removes the rename rule that processes 'ONBOARD'.

For eudev, that's probably the best option.

sys-fs/udev installs and utilizes /lib/systemd/network/99-default.link.