netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Specifying netdev name on kernel boot?
@ 2013-08-15 15:50 Ben Greear
  2013-08-15 18:09 ` Dan Williams
  0 siblings, 1 reply; 3+ messages in thread
From: Ben Greear @ 2013-08-15 15:50 UTC (permalink / raw)
  To: netdev

It seems they finally broke udev in Fedora 19...it can no longer
rename ethX to ethY, for whatever reason.

Is there a way to specify the naming on the kernel command line?

I found something in google that made me think this might work:

ifname=eth0:00:30:48:fc:17:a2 ifname=eth1:00:30:48:fc:17:a3 ifname=eth2:00:e0:ed:1c:ec:e4 ifname=eth3:00:e0:ed:1c:ec:e5

but it doesn't seem to have any affect.

I'm using ixgbe and e1000e drivers, loaded as modules, in case that matters.

Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Specifying netdev name on kernel boot?
  2013-08-15 15:50 Specifying netdev name on kernel boot? Ben Greear
@ 2013-08-15 18:09 ` Dan Williams
  2013-08-15 18:26   ` Ben Greear
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Williams @ 2013-08-15 18:09 UTC (permalink / raw)
  To: Ben Greear; +Cc: netdev

On Thu, 2013-08-15 at 08:50 -0700, Ben Greear wrote:
> It seems they finally broke udev in Fedora 19...it can no longer
> rename ethX to ethY, for whatever reason.

It's intentional AFAIK, it won't rename devices into the kernel
namespace (eth, wlan, usb, wwan) because it's inherently race-prone and
there's no way to know that the kernel didn't just detect a new eth2
while you're about to rename your eth0 to eth2.  There actually have
been a lot of problems with that in past, because bus enumeration order
is not guaranteed.

I'm pretty sure you drop a rule in /etc/udev/rules.d  to what you want:

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:xx:xx:xx:xx:xx", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

Or if you install biosdevname, you'll get the nice BIOS names for the
interfaces which is usually something like "slot1nic0" or "builtin0" or
something like that.

(and yeah, one of my devices is "enp0s29f7u4" which is just f-king ugly.
*I* know what that means and why udev is doing it, but I also sympathize
with those who don't...)

Dan

> Is there a way to specify the naming on the kernel command line?
> 
> I found something in google that made me think this might work:
> 
> ifname=eth0:00:30:48:fc:17:a2 ifname=eth1:00:30:48:fc:17:a3 ifname=eth2:00:e0:ed:1c:ec:e4 ifname=eth3:00:e0:ed:1c:ec:e5
> 
> but it doesn't seem to have any affect.
> 
> I'm using ixgbe and e1000e drivers, loaded as modules, in case that matters.
> 
> Thanks,
> Ben
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Specifying netdev name on kernel boot?
  2013-08-15 18:09 ` Dan Williams
@ 2013-08-15 18:26   ` Ben Greear
  0 siblings, 0 replies; 3+ messages in thread
From: Ben Greear @ 2013-08-15 18:26 UTC (permalink / raw)
  To: Dan Williams; +Cc: netdev

On 08/15/2013 11:09 AM, Dan Williams wrote:
> On Thu, 2013-08-15 at 08:50 -0700, Ben Greear wrote:
>> It seems they finally broke udev in Fedora 19...it can no longer
>> rename ethX to ethY, for whatever reason.
>
> It's intentional AFAIK, it won't rename devices into the kernel
> namespace (eth, wlan, usb, wwan) because it's inherently race-prone and
> there's no way to know that the kernel didn't just detect a new eth2
> while you're about to rename your eth0 to eth2.  There actually have
> been a lot of problems with that in past, because bus enumeration order
> is not guaranteed.
>
> I'm pretty sure you drop a rule in /etc/udev/rules.d  to what you want:
>
> SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:xx:xx:xx:xx:xx", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

This used to work, but no longer does in Fedora 19.  If you do NAME="eth0r" then
it does work.

It shouldn't actually race (or at least shouldn't cause problems) at
the kernel level, and user-space should be able to detect a conflict
and take evasive action.  Even if the rename itself fails due to a
race, user-space can just try again and it should work after a few tries.

I opened a bug against Fedora udev, for what that is worth.

> Or if you install biosdevname, you'll get the nice BIOS names for the
> interfaces which is usually something like "slot1nic0" or "builtin0" or
> something like that.
>
> (and yeah, one of my devices is "enp0s29f7u4" which is just f-king ugly.
> *I* know what that means and why udev is doing it, but I also sympathize
> with those who don't...)

Yeah, I really want to avoid those types of names.

I hacked up a perl script that does the rename, but it can cause
some churn because I can't find any useful way to make systemd
put the rename logic between udev and network bringup.  I am
mostly clueless on systemd, so perhaps it's easier than it looked.

Thanks,
Ben


-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-08-15 18:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-15 15:50 Specifying netdev name on kernel boot? Ben Greear
2013-08-15 18:09 ` Dan Williams
2013-08-15 18:26   ` Ben Greear

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).