Re: [systemd-devel] network interface renaming via PCI ID w/ systemd-udevd

2015-11-13 Thread Filipe Brandenburger
On Thu, Nov 12, 2015 at 10:13 AM, Matthew Hall  wrote:
> On Thu, Nov 12, 2015 at 10:37:56AM +0100, Lennart Poettering wrote:
>> Since time began eth* is where the kernel automatically picked iface
>> names from. If you want to assign your own names go for some other
>> namespace, or be prepared to race against the kernel, and deal with
>> it.
>
> Again, this logic worked well when the level of dynamism was lower.

I think I see where you're coming from... Some distributions (in my
recollection, RHEL) would use weird tricks to keep interface ordering
stable while still keeping the eth0, eth1, ethX names.

If I recall correctly, RHEL's /etc/init.d/network would try to match
interface names from /etc/sysconfig/networking-scripts/ifcfg-ethX to
the MAC address listed inside that configuration file. If it had to
switch it from, say, eth0 to eth1, it would do weird tricks such as
looking whether eth1 existed already, then rename it to tmp98765 with
a random number, then rename eth0 to eth1. In many cases, something
would go awry and you would end up with an interface named tmp98765.

As you can imagine, this was fraught with problems and race
conditions. It doesn't really work when you're trying to boot with as
much parallelism (which is something we aim for these days) or even
hot plug new interfaces...

> But now the level of dynamism is higher and different principles should apply.

Yes. I'd say that's a good thing.

> You aren't thinking very much about how it will work for newer users.

New users mostly don't care... I really think retraining your fingers
from eth -> enp or whatever you pick, net, lan, wired, etc. is
probably much easier than trying to preserve a relic of a name that
mostly serves no purpose these days... As mentioned, keeping it is not
simple since it's still the dumping ground for the kernel (and that's
unlikely to change), avoiding the race with the kernel is much better
than trying to deal with it, the complexity is just not worth it... I
hope you get to see the light!

Cheers!
Filipe
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] network interface renaming via PCI ID w/ systemd-udevd

2015-11-13 Thread Jordan Hargrave
On Fri, Nov 13, 2015 at 12:44 PM, Filipe Brandenburger
 wrote:
> On Thu, Nov 12, 2015 at 10:13 AM, Matthew Hall  wrote:
>> On Thu, Nov 12, 2015 at 10:37:56AM +0100, Lennart Poettering wrote:
>>> Since time began eth* is where the kernel automatically picked iface
>>> names from. If you want to assign your own names go for some other
>>> namespace, or be prepared to race against the kernel, and deal with
>>> it.
>>
>> Again, this logic worked well when the level of dynamism was lower.
>
> I think I see where you're coming from... Some distributions (in my
> recollection, RHEL) would use weird tricks to keep interface ordering
> stable while still keeping the eth0, eth1, ethX names.
>
> If I recall correctly, RHEL's /etc/init.d/network would try to match
> interface names from /etc/sysconfig/networking-scripts/ifcfg-ethX to
> the MAC address listed inside that configuration file. If it had to
> switch it from, say, eth0 to eth1, it would do weird tricks such as
> looking whether eth1 existed already, then rename it to tmp98765 with
> a random number, then rename eth0 to eth1. In many cases, something
> would go awry and you would end up with an interface named tmp98765.
>
> As you can imagine, this was fraught with problems and race
> conditions. It doesn't really work when you're trying to boot with as
> much parallelism (which is something we aim for these days) or even
> hot plug new interfaces...
>
>> But now the level of dynamism is higher and different principles should 
>> apply.
>
> Yes. I'd say that's a good thing.
>
>> You aren't thinking very much about how it will work for newer users.
>
> New users mostly don't care... I really think retraining your fingers
> from eth -> enp or whatever you pick, net, lan, wired, etc. is
> probably much easier than trying to preserve a relic of a name that
> mostly serves no purpose these days... As mentioned, keeping it is not
> simple since it's still the dumping ground for the kernel (and that's
> unlikely to change), avoiding the race with the kernel is much better
> than trying to deal with it, the complexity is just not worth it... I
> hope you get to see the light!
>
> Cheers!
> Filipe
> ___
> systemd-devel mailing list
> systemd-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel

I'm the primary developer of biosdevname, used by RedHat/Fedora for
consistent naming.

Servers using SR-IOV can have potentially hundreds of NIC devices, all
loaded in parallel.
eth* is still the internal name used by the kernel, and the number
gets assigned first-come first-served.   Trying to keep consistent
eth* names without collision here is impossible.  The eth* device name
then gets changed by systemd or biosdevname.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] network interface renaming via PCI ID w/ systemd-udevd

2015-11-13 Thread Mantas Mikulėnas
On Thu, Nov 12, 2015 at 8:13 PM, Matthew Hall  wrote:

> On Thu, Nov 12, 2015 at 10:37:56AM +0100, Lennart Poettering wrote:
> > Since time began eth* is where the kernel automatically picked iface
> > names from. If you want to assign your own names go for some other
> > namespace, or be prepared to race against the kernel, and deal with
> > it.
> >
> > Lennart
>
> Again, this logic worked well when the level of dynamism was lower.
>
> But now the level of dynamism is higher and different principles should
> apply.
>

And systemd is the cause of that dynamism how exactly? If you're
complaining that the kernel started probing & detecting devices in a less
stable order, then you're complaining in very much the wrong place (and
maybe during the wrong decade).

The two times udev was involved in network interface naming, it was to make
the names _more stable_, not less. Perhaps your earlier systems had an
autogenerated .rules file which would make the names static – this was
implemented via udev (though I don't remember if it was Debian-specific or
upstream). Fedora for a while used "biosdevname" to make the names static –
this was also implemented via udev. And so on...


> You aren't thinking very much about how it will work for newer users.


Well, you've been using UNIX for 24 years, you're not exactly a "newer"
user...

And new users don't have any problems with the enp* scheme (probably
because they _aren't_ used to eth*) – they see enp1s0, wlp2s0 in `ip link`
and they successfully use those.

~

Either way, I remain convinced that you have not the slightest idea what
you're talking about.

You say, "This new way steals the old eth* namespace everybody was
comfortable with, despite its issues, and makes it a lot more random and
full of weird dynamic stuff.", even though this "new way" is the _exact
opposite_ of that.

The "persistent naming" that you linked to _does not_ use the eth*
namespace for anything, nor does it use random names anywhere – it
specifically avoids that, using enp* prefixes and PCI-based names. You've
been ranting all this time about entirely irrelevant things.

-- 
Mantas Mikulėnas 
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] network interface renaming via PCI ID w/ systemd-udevd

2015-11-12 Thread Andrei Borzenkov
On Thu, Nov 12, 2015 at 10:29 AM, Matthew Hall  wrote:
>
> Let me try and put this another way. I have been using UNIX 24 years. I have
> typed the characters eth0 so long that it's long since been hardcoded into my
> fingers; trying to change it would drive me crazy and serve no beneficial
> purpose besides confusing me when I am trying to get work done. The computer
> is a tool to help me solve problems. It makes more sense to get the computer
> to accomodate the users than the other way around.
>

In the past 24 years I have been working with over dozen of different
operating systems (and likely the same number of different Linux
distributions). Each of them had different rules for interface naming,
these rules changing from version to version. Even your Linux
distribution has at least dozen different names for network interfaces
(have you never ever seen wlan0?)

So I do not really care a  about what name is used as long as this
name remains persistent from reboot to reboot.

> Dynamically populating the "eth*" namespace with random unexpected network
> interfaces on the fly should honestly be considered a bug not a feature. If
> they are dynamically populated then they can be placed anywhere, so why not
> place them under net0, net1, net2, etc.?


What's wrong with naming *your* interfaces net0, net1 etc then? Why
are so addicted to three letters 'e', 't', 'h'?
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] network interface renaming via PCI ID w/ systemd-udevd

2015-11-12 Thread Lennart Poettering
On Thu, 12.11.15 02:29, Matthew Hall (mh...@mhcomputing.net) wrote:

> On Thu, Nov 12, 2015 at 07:59:03AM +0200, Mantas Mikul??nas wrote:
> > I'm not sure if udev even still _allows_ renaming to eth*, but even if it
> > does, that's explicitly not supported. (For example, between the time eth0
> > appears and the "rename to eth1" rule gets processed, another eth1 might
> > also appear, and the rename would fail.) If you want custom names, use en*
> > or port* or lan* or some other prefix.
> 
> Let me try and put this another way. I have been using UNIX 24 years. I have 
> typed the characters eth0 so long that it's long since been hardcoded into my 
> fingers; trying to change it would drive me crazy and serve no beneficial 
> purpose besides confusing me when I am trying to get work done. The computer 
> is a tool to help me solve problems. It makes more sense to get the computer 
> to accomodate the users than the other way around.
> 
> Dynamically populating the "eth*" namespace with random unexpected network 
> interfaces on the fly should honestly be considered a bug not a feature. If 
> they are dynamically populated then they can be placed anywhere, so why not 
> place them under net0, net1, net2, etc.?

Since time began eth* is where the kernel automatically picked iface
names from. If you want to assign your own names go for some other
namespace, or be prepared to race against the kernel, and deal with
it.

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] network interface renaming via PCI ID w/ systemd-udevd

2015-11-12 Thread Mantas Mikulėnas
On Thu, Nov 12, 2015 at 10:52 AM, Matthew Hall 
wrote:

> On Thu, Nov 12, 2015 at 09:56:28AM +0200, Mantas Mikul??nas wrote:
> > You begin with saying that eth# is good because that's how it's been done
> > for decades ??? but then you say the exact same thing is now *bad* and
> the
> > kernel should start putting new interfaces under net#, completely
> > contradicting your earlier "trying to change it would drive me crazy".
> What
> > even?
> >
> > The kernel has been "dynamically populating the eth* namespace with
> random
> > unexpected network interfaces" since day one. It's not a systemd thing.
> > It's as you said "how UNIX has always worked".
>
> Yes, of course at first it appears to be a contradiction.
>
> Until you consider that for most of these decades, the software was
> populating
> more or less the same set of static devices once at boot, albeit in a
> potentially weird order. It was not randomly adding or removing things
> on-the-fly as some new driver comes up or down.
>
> So, we took was was an admittedly semi-random process that was working
> pretty
> well, and starting doing thinsg in a new way. Except this new way comes
> with
> some unpleasant side effects.
>
> This new way steals the old eth* namespace everybody was comfortable with,
> despite its issues, and makes it a lot more random and full of weird
> dynamic
> stuff. The need for weird dynamic stuff was unavoidable, but it seems
> unhelpful to complicate the problems with eth* by pouring more gasoline on
> it.
>
> Putting weird stuff in there by itself would not be a big deal. Except now
> you're saying that we are prohibited from giving meaning and lofical back
> to
> that namespace, merely because the software wants to reserve the right to
> randomly insert weird stuff into the middle of that namespace at any point
> for
> no really reason in terms of features or usability as far as I could
> determine.
>

I am _still_ not sure what you're talking about. The kernel's eth*
assignment policy hasn't changed for _many years_ – first device detected
gets eth0, second gets eth1, and so on. It has always been so.

The "new way" of systemd _does not_ use the eth* namespace for anything.
Just as you said, it uses alternative prefixes such as en* for the
"persistent" names.


-- 
Mantas Mikulėnas 
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] network interface renaming via PCI ID w/ systemd-udevd

2015-11-12 Thread Matthew Hall
On Thu, Nov 12, 2015 at 10:37:56AM +0100, Lennart Poettering wrote:
> Since time began eth* is where the kernel automatically picked iface
> names from. If you want to assign your own names go for some other
> namespace, or be prepared to race against the kernel, and deal with
> it.
> 
> Lennart

Again, this logic worked well when the level of dynamism was lower.

But now the level of dynamism is higher and different principles should apply.

You aren't thinking very much about how it will work for newer users.

Matthew.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] network interface renaming via PCI ID w/ systemd-udevd

2015-11-11 Thread Matthew Hall
Hello all,

I am tearing my hair out trying to follow the directions in this page to get 
the 
correct interface names on Ubuntu Wily w/ systemd-udevd.

http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/

I am just trying to get my eth0 - eth3 into the desired order. The order in 
lspci is correct:

00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (2) I219-V 
(rev 31)
08:00.0 Ethernet controller: Intel Corporation I211 Gigabit Network Connection 
(rev 03)
0a:00.0 Ethernet controller: Intel Corporation I350 Gigabit Network Connection 
(rev 01)
0a:00.1 Ethernet controller: Intel Corporation I350 Gigabit Network Connection 
(rev 01)

Here is what I have tried. I am trying to understand what I missed. It really 
shouldn't have to be this difficult. So I must be missing something.

1) First I tried making an override file:

/etc/udev/rules.d/70-net-names.rules:
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", SUBSYSTEM=="pci", 
KERNELS==":00:1f.6", NAME="eth0"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", SUBSYSTEM=="pci", 
KERNELS==":08:00.0", NAME="eth1"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", SUBSYSTEM=="pci", 
KERNELS==":0a:00.0", NAME="eth2"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", SUBSYSTEM=="pci", 
KERNELS==":0a:00.1", NAME="eth3"

2) Then I tried masking off the PCI-based renamer file as well.

ln -s /dev/null /etc/udev/rules.d/80-net-setup-link.rules

3) After that I tried net.ifnames=0 to see if that was getting in the way.

This produced a different wrong order, which did not match the lspci order, 
did not match the default PCI naming order (obviously enough) and did not 
match the udev rules.

During all of these I also kept checking journalctl -u systemd-udevd and 
/var/log, but I did not get any useful output there either.

What do I need to do to get this right?

Matthew.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] network interface renaming via PCI ID w/ systemd-udevd

2015-11-11 Thread Matthew Hall
On Thu, Nov 12, 2015 at 12:12:55AM -0500, Matthew Hall wrote:
> /etc/udev/rules.d/70-net-names.rules:
> SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", SUBSYSTEM=="pci", 
> KERNELS==":00:1f.6", NAME="eth0"
> SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", SUBSYSTEM=="pci", 
> KERNELS==":08:00.0", NAME="eth1"
> SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", SUBSYSTEM=="pci", 
> KERNELS==":0a:00.0", NAME="eth2"
> SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", SUBSYSTEM=="pci", 
> KERNELS==":0a:00.1", NAME="eth3"

For future users who hits this, I think I finally found the bug.

You have to use the "SUBSYSTEMS" filter not the "SUBSYSTEM" filter. I am by 
far not an expert on udev and the rules are extremely confusing. Is there a 
better way to write this ruleset?

The process for adding an account on the FDO wiki is extremely confusing for 
any non-expert users:

http://wiki.freedesktop.org/sitewranglers/wiki/401/

There is no way anybody that isn't a crypto geek will know how to do that. It 
would be good if you could enable a CAPTCHA or web-based flow of some kind in 
a way which will not cause a flood of spammers so mere mortals can actually 
fix bugs in the pages.

I requested access... is there somebody here who could expedite it so I could 
get this fixed ASAP?

Thanks,
Matthew.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] network interface renaming via PCI ID w/ systemd-udevd

2015-11-11 Thread Mantas Mikulėnas
On Thu, Nov 12, 2015 at 7:40 AM, Matthew Hall  wrote:

> On Thu, Nov 12, 2015 at 12:12:55AM -0500, Matthew Hall wrote:
> > /etc/udev/rules.d/70-net-names.rules:
> > SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", SUBSYSTEM=="pci",
> KERNELS==":00:1f.6", NAME="eth0"
> > SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", SUBSYSTEM=="pci",
> KERNELS==":08:00.0", NAME="eth1"
> > SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", SUBSYSTEM=="pci",
> KERNELS==":0a:00.0", NAME="eth2"
> > SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", SUBSYSTEM=="pci",
> KERNELS==":0a:00.1", NAME="eth3"
>

I'm not sure if udev even still _allows_ renaming to eth*, but even if it
does, that's explicitly not supported. (For example, between the time eth0
appears and the "rename to eth1" rule gets processed, another eth1 might
also appear, and the rename would fail.) If you want custom names, use en*
or port* or lan* or some other prefix.


> For future users who hits this, I think I finally found the bug.
>
> You have to use the "SUBSYSTEMS" filter not the "SUBSYSTEM" filter. I am by
> far not an expert on udev and the rules are extremely confusing. Is there a
> better way to write this ruleset?


The way they work is simple though – they directly compare the values you'd
see in `udevadm monitor --env` or `udevadm info /sys/class/net/eth0`. If it
says "SUBSYSTEM=net", then you can match it using SUBSYSTEM=="net", that's
it.

But I guess the more important thing to know is that the network interface
is _not the same thing_ as the raw PCI device; it's shown as a sub-device
in /sys. (A single PCI device could easily expose multiple network
interfaces, for example.) Compare the output of `udevadm
info /sys/devices/pci:00/:00:1c.0/:01:00.0` vs `udevadm
info /sys/devices/pci:00/:00:1c.0/:01:00.0/net/eth0`.

That's why you use "SUBSYSTEMS=" and "KERNELS=" – you're checking
information of the _parent_ device. That said, some of the matches are IMHO
a bit redundant, and you'd be fine with:

ACTION=="add", SUBSYSTEM=="net", KERNELS==":0a:00.1", NAME="em1"

-- 
Mantas Mikulėnas 
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] network interface renaming via PCI ID w/ systemd-udevd

2015-11-11 Thread Matthew Hall
On Thu, Nov 12, 2015 at 07:59:03AM +0200, Mantas Mikul??nas wrote:
> I'm not sure if udev even still _allows_ renaming to eth*, but even if it
> does, that's explicitly not supported. (For example, between the time eth0
> appears and the "rename to eth1" rule gets processed, another eth1 might
> also appear, and the rename would fail.) If you want custom names, use en*
> or port* or lan* or some other prefix.

Let me try and put this another way. I have been using UNIX 24 years. I have 
typed the characters eth0 so long that it's long since been hardcoded into my 
fingers; trying to change it would drive me crazy and serve no beneficial 
purpose besides confusing me when I am trying to get work done. The computer 
is a tool to help me solve problems. It makes more sense to get the computer 
to accomodate the users than the other way around.

Dynamically populating the "eth*" namespace with random unexpected network 
interfaces on the fly should honestly be considered a bug not a feature. If 
they are dynamically populated then they can be placed anywhere, so why not 
place them under net0, net1, net2, etc.?

It makes no sense to put them into the middle of a namespace that has decades 
of what had previously been pretty clear easy-to-follow traditions behind it.

It took several hours even to find wrong examples how to rename an interface 
using a PCI ID because the page didn't bother to explain the options it listed 
with any kind of examples. No new users are going to have much hope of making 
sense of any of the behavior of this. Of course, provided they even manage to 
follow the cryptic instructions to registed to update the wiki page if they do 
figure it out.

> they directly compare the values you'd see in `udevadm monitor --env` or 
> `udevadm info /sys/class/net/eth0`.

Thanks for these. It should help a lot in the future.

Matthew.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] network interface renaming via PCI ID w/ systemd-udevd

2015-11-11 Thread Matthew Hall
On Thu, Nov 12, 2015 at 12:40:04AM -0500, Matthew Hall wrote:
> The process for adding an account on the FDO wiki is extremely confusing for 
> any non-expert users:
> 
> http://wiki.freedesktop.org/sitewranglers/wiki/401/
> 
> There is no way anybody that isn't a crypto geek will know how to do that. It 
> would be good if you could enable a CAPTCHA or web-based flow of some kind in 
> a way which will not cause a flood of spammers so mere mortals can actually 
> fix bugs in the pages.

Even better yet, the process rejects your email that contains a conventional 
PGP signed message instead of a one-line clearsigned PW hash. This is 1) not 
mentioned in the wiki page regarding the authentication, 2) so hostile to new 
users that essentially nobody would be capable of fixing it.

Matthew.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] network interface renaming via PCI ID w/ systemd-udevd

2015-11-11 Thread Mantas Mikulėnas
On Thu, Nov 12, 2015 at 9:29 AM, Matthew Hall  wrote:

> On Thu, Nov 12, 2015 at 07:59:03AM +0200, Mantas Mikul??nas wrote:
> > I'm not sure if udev even still _allows_ renaming to eth*, but even if it
> > does, that's explicitly not supported. (For example, between the time
> eth0
> > appears and the "rename to eth1" rule gets processed, another eth1 might
> > also appear, and the rename would fail.) If you want custom names, use
> en*
> > or port* or lan* or some other prefix.
>
> Let me try and put this another way. I have been using UNIX 24 years. I
> have
> typed the characters eth0 so long that it's long since been hardcoded into
> my
> fingers; trying to change it would drive me crazy and serve no beneficial
> purpose besides confusing me when I am trying to get work done. The
> computer
> is a tool to help me solve problems. It makes more sense to get the
> computer
> to accomodate the users than the other way around.
>
> Dynamically populating the "eth*" namespace with random unexpected network
> interfaces on the fly should honestly be considered a bug not a feature. If
> they are dynamically populated then they can be placed anywhere, so why not
> place them under net0, net1, net2, etc.?
>
> It makes no sense to put them into the middle of a namespace that has
> decades
> of what had previously been pretty clear easy-to-follow traditions behind
> it.
>

...Really not sure what you're complaining about, here.

You begin with saying that eth# is good because that's how it's been done
for decades – but then you say the exact same thing is now *bad* and the
kernel should start putting new interfaces under net#, completely
contradicting your earlier "trying to change it would drive me crazy". What
even?

The kernel has been "dynamically populating the eth* namespace with random
unexpected network interfaces" since day one. It's not a systemd thing.
It's as you said "how UNIX has always worked".

-- 
Mantas Mikulėnas 
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel