From: Andrew Lunn <andrew@lunn.ch>
To: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel@savoirfairelinux.com,
"David S. Miller" <davem@davemloft.net>,
"Florian Fainelli" <f.fainelli@gmail.com>,
"Uwe Kleine-König" <uwe@kleine-koenig.org>,
"Andrey Smirnov" <andrew.smirnov@gmail.com>,
"Jiri Pirko" <jiri@resnulli.us>
Subject: Re: [PATCH net-next v2] net: dsa: make "label" property optional for dsa2
Date: Mon, 9 Jan 2017 00:30:19 +0100 [thread overview]
Message-ID: <20170108233019.GA25588@lunn.ch> (raw)
In-Reply-To: <20170108231552.26995-1-vivien.didelot@savoirfairelinux.com>
> Until the printing of netdev_phys_item_id structures is fixed in
> net/core/net-sysfs.c, an external helper can be used like this:
Hi Vivien
As Florian pointed out, this cannot be changed. It is now part of the
ABI. We have to live with it printing little endian numbers as big
endian.
> # cat /etc/udev/rules.d/90-net-dsa.rules
> SUBSYSTEM=="net", ACTION=="add", ENV{DEVTYPE}=="dsa", PROGRAM="/lib/udev/dsanitizer $attr{phys_switch_id} $attr{phys_port_id}", NAME="$result"
>
> # cat /lib/udev/dsanitizer
> #!/bin/sh
> echo $1 | sed -e 's,^0*,,' -e 's,0*$,,' | xargs printf sw%d
> echo $2 | sed -e 's,^0*,,' | xargs printf p%d
>
> # ip link | awk '/@eth/ { split($2,a,"@"); print a[1]; }'
> sw0p0
> sw0p1
> sw0p2
> sw1p0
> sw1p1
> sw1p2
> sw2p0
> sw2p1
> sw2p2
> sw2p3
> sw2p4
Rather than recommending something, it might be better to point to the
Free Desktop "Predictable Network Interface Names" which is what most
people will end up with, if they rename:
https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/
It would also be good to test on a recent systemd system and see what
happens. What names does it pick?
Andrew
next prev parent reply other threads:[~2017-01-08 23:30 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-08 23:15 [PATCH net-next v2] net: dsa: make "label" property optional for dsa2 Vivien Didelot
2017-01-08 23:30 ` Andrew Lunn [this message]
2017-01-09 2:56 ` Vivien Didelot
2017-01-09 7:32 ` Jiri Pirko
2017-01-09 15:04 ` Vivien Didelot
2017-01-09 15:11 ` Jiri Pirko
2017-01-09 15:45 ` Vivien Didelot
2017-01-09 16:00 ` Andrew Lunn
2017-01-09 16:07 ` Jiri Pirko
2017-01-09 16:06 ` Jiri Pirko
2017-01-09 17:42 ` Florian Fainelli
2017-01-09 17:58 ` Jiri Pirko
2017-01-09 18:06 ` Florian Fainelli
2017-01-10 9:55 ` Jiri Pirko
2017-01-10 17:58 ` Florian Fainelli
2017-01-11 7:26 ` Jiri Pirko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170108233019.GA25588@lunn.ch \
--to=andrew@lunn.ch \
--cc=andrew.smirnov@gmail.com \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=jiri@resnulli.us \
--cc=kernel@savoirfairelinux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=uwe@kleine-koenig.org \
--cc=vivien.didelot@savoirfairelinux.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.