From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1033732AbdAHXa3 (ORCPT ); Sun, 8 Jan 2017 18:30:29 -0500 Received: from vps0.lunn.ch ([178.209.37.122]:51421 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965156AbdAHXaZ (ORCPT ); Sun, 8 Jan 2017 18:30:25 -0500 Date: Mon, 9 Jan 2017 00:30:19 +0100 From: Andrew Lunn To: Vivien Didelot Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@savoirfairelinux.com, "David S. Miller" , Florian Fainelli , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Andrey Smirnov , Jiri Pirko Subject: Re: [PATCH net-next v2] net: dsa: make "label" property optional for dsa2 Message-ID: <20170108233019.GA25588@lunn.ch> References: <20170108231552.26995-1-vivien.didelot@savoirfairelinux.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170108231552.26995-1-vivien.didelot@savoirfairelinux.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > 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