Skip to content

Commit 75f3a10

Browse files
idoschdavem330
authored andcommitted
switchdev: Use switch ID in suggested udev rule
Since there can be multiple switch ASICs on the same system we should use the switch ID in order to differentiate between them and set the switch name (e.g. swX) accordingly. Also, replace the order of the "Switch ID" and "Port Netdev Naming" sections following the above change. Signed-off-by: Ido Schimmel <[email protected]> Signed-off-by: Jiri Pirko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent b555cf4 commit 75f3a10

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

Documentation/networking/switchdev.txt

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,18 @@ Typically, the management port is not participating in offloaded data plane and
8989
is loaded with a different driver, such as a NIC driver, on the management port
9090
device.
9191

92+
Switch ID
93+
^^^^^^^^^
94+
95+
The switchdev driver must implement the switchdev op switchdev_port_attr_get
96+
for SWITCHDEV_ATTR_ID_PORT_PARENT_ID for each port netdev, returning the same
97+
physical ID for each port of a switch. The ID must be unique between switches
98+
on the same system. The ID does not need to be unique between switches on
99+
different systems.
100+
101+
The switch ID is used to locate ports on a switch and to know if aggregated
102+
ports belong to the same switch.
103+
92104
Port Netdev Naming
93105
^^^^^^^^^^^^^^^^^^
94106

@@ -104,25 +116,13 @@ external configuration. For example, if a physical 40G port is split logically
104116
into 4 10G ports, resulting in 4 port netdevs, the device can give a unique
105117
name for each port using port PHYS name. The udev rule would be:
106118

107-
SUBSYSTEM=="net", ACTION=="add", DRIVER="<driver>", ATTR{phys_port_name}!="", \
108-
NAME="$attr{phys_port_name}"
119+
SUBSYSTEM=="net", ACTION=="add", ATTR{phys_switch_id}=="<phys_switch_id>", \
120+
ATTR{phys_port_name}!="", NAME="swX$attr{phys_port_name}"
109121

110122
Suggested naming convention is "swXpYsZ", where X is the switch name or ID, Y
111123
is the port name or ID, and Z is the sub-port name or ID. For example, sw1p1s0
112124
would be sub-port 0 on port 1 on switch 1.
113125

114-
Switch ID
115-
^^^^^^^^^
116-
117-
The switchdev driver must implement the switchdev op switchdev_port_attr_get
118-
for SWITCHDEV_ATTR_ID_PORT_PARENT_ID for each port netdev, returning the same
119-
physical ID for each port of a switch. The ID must be unique between switches
120-
on the same system. The ID does not need to be unique between switches on
121-
different systems.
122-
123-
The switch ID is used to locate ports on a switch and to know if aggregated
124-
ports belong to the same switch.
125-
126126
Port Features
127127
^^^^^^^^^^^^^
128128

0 commit comments

Comments
 (0)