net: add support for phys_port_name
authorDavid Ahern <dsahern@gmail.com>
Wed, 18 Mar 2015 02:23:15 +0000 (20:23 -0600)
committerDavid S. Miller <davem@davemloft.net>
Thu, 19 Mar 2015 02:30:35 +0000 (22:30 -0400)
Similar to port id allow netdevices to specify port names and export
the name via sysfs. Drivers can implement the netdevice operation to
assist udev in having sane default names for the devices using the
rule:

$ cat /etc/udev/rules.d/80-net-setup-link.rules
SUBSYSTEM=="net", ACTION=="add", ATTR{phys_port_name}!="",
NAME="$attr{phys_port_name}"

Use of phys_name versus phys_id was suggested-by Jiri Pirko.

Signed-off-by: David Ahern <dsahern@gmail.com>
Acked-by: Jiri Pirko <jiri@resnulli.us>
Acked-by: Scott Feldman <sfeldma@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Documentation/ABI/testing/sysfs-class-net
include/linux/netdevice.h
include/uapi/linux/if_link.h
net/core/dev.c
net/core/net-sysfs.c
net/core/rtnetlink.c

index beb8ec4..5ecfd72 100644 (file)
@@ -188,6 +188,14 @@ Description:
                Indicates the interface unique physical port identifier within
                the NIC, as a string.
 
+What:          /sys/class/net/<iface>/phys_port_name
+Date:          March 2015
+KernelVersion: 4.0
+Contact:       netdev@vger.kernel.org
+Description:
+               Indicates the interface physical port name within the NIC,
+               as a string.
+
 What:          /sys/class/net/<iface>/speed
 Date:          October 2009
 KernelVersion: 2.6.33
Simple merge
Simple merge
diff --cc net/core/dev.c
Simple merge
Simple merge
Simple merge