Lines Matching +full:set +full:- +full:of +full:- +full:ports

1 .. SPDX-License-Identifier: GPL-2.0
10 .. _dsa-config-showcases:
13 -----------------------
15 To configure a DSA switch a couple of commands need to be executed. In this
22 Every switch port is part of one configurable Ethernet bridge
25 Every switch port except one upstream port is part of a configurable
32 Through DSA every port of a switch is handled like a normal linux Ethernet
38 to send or receive traffic. Prior to kernel v5.12, the state of the master
42 - when a DSA slave interface is brought up, the master interface is
44 - when the master interface is brought down, all DSA slave interfaces are
71 * lan1: 192.0.2.1/30 (192.0.2.0 - 192.0.2.3)
72 * lan2: 192.0.2.5/30 (192.0.2.4 - 192.0.2.7)
73 * lan3: 192.0.2.9/30 (192.0.2.8 - 192.0.2.11)
76 * br0: 192.0.2.129/25 (192.0.2.128 - 192.0.2.255)
79 * br0: 192.0.2.129/25 (192.0.2.128 - 192.0.2.255)
80 * wan: 192.0.2.1/30 (192.0.2.0 - 192.0.2.3)
82 .. _dsa-tagged-configuration:
85 ----------------------------------
87 The tagging based configuration is desired and supported by the majority of
92 .. code-block:: sh
100 # brought up manually before the slave ports.
101 ip link set eth0 up
104 ip link set lan1 up
105 ip link set lan2 up
106 ip link set lan3 up
109 .. code-block:: sh
112 # brought up manually before the slave ports.
113 ip link set eth0 up
116 ip link set lan1 up
117 ip link set lan2 up
118 ip link set lan3 up
123 # add ports to bridge
124 ip link set dev lan1 master br0
125 ip link set dev lan2 master br0
126 ip link set dev lan3 master br0
132 ip link set dev br0 up
135 .. code-block:: sh
138 # brought up manually before the slave ports.
139 ip link set eth0 up
142 ip link set wan up
143 ip link set lan1 up
144 ip link set lan2 up
152 # add ports to bridge
153 ip link set dev lan1 master br0
154 ip link set dev lan2 master br0
160 ip link set dev br0 up
162 .. _dsa-vlan-configuration:
165 -------------------------------------
167 A minority of switches are not capable to use a taging protocol
172 The configuration can only be set up via VLAN tagging and bridge setup.
174 .. code-block:: sh
182 # brought up manually before the slave ports.
183 ip link set eth0 up
184 ip link set eth0.1 up
185 ip link set eth0.2 up
186 ip link set eth0.3 up
189 ip link set lan1 up
190 ip link set lan2 up
191 ip link set lan3 up
197 ip link set dev br0 type bridge vlan_filtering 1
199 # add ports to bridges
200 ip link set dev lan1 master br0
201 ip link set dev lan2 master br0
202 ip link set dev lan3 master br0
204 # tag traffic on ports
215 ip link set br0 up
219 .. code-block:: sh
225 # brought up manually before the slave ports.
226 ip link set eth0 up
227 ip link set eth0.1 up
230 ip link set lan1 up
231 ip link set lan2 up
232 ip link set lan3 up
238 ip link set dev br0 type bridge vlan_filtering 1
240 # add ports to bridge
241 ip link set dev lan1 master br0
242 ip link set dev lan2 master br0
243 ip link set dev lan3 master br0
244 ip link set eth0.1 master br0
246 # tag traffic on ports
255 ip link set dev br0 up
258 .. code-block:: sh
265 # brought up manually before the slave ports.
266 ip link set eth0 up
267 ip link set eth0.1 up
268 ip link set eth0.2 up
271 ip link set wan up
272 ip link set lan1 up
273 ip link set lan2 up
279 ip link set dev br0 type bridge vlan_filtering 1
281 # add ports to bridges
282 ip link set dev wan master br0
283 ip link set eth0.1 master br0
284 ip link set dev lan1 master br0
285 ip link set dev lan2 master br0
287 # tag traffic on ports
297 ip link set br0 up
300 ------------------------------------
303 the software FDB of the bridge in sync with the hardware tables, so the two
308 Up until kernel v4.14, DSA only supported user space management of bridge FDB
313 .. code-block:: sh
325 .. code-block:: sh
335 The last command is an incorrect way of adding a static bridge FDB entry to a
340 Between kernel v4.14 and v5.14, DSA has supported in parallel two modes of
345 .. code-block:: sh
353 .. code-block:: sh
355 # This is the only valid way of adding an FDB entry that is supported,
359 # 'local' instead of being forwarded:
364 Script writers are therefore encouraged to use the ``master static`` set of
367 Affinity of user ports to CPU ports
368 -----------------------------------
372 may permit the use of 2 or more ports connected to the host, for an increase in
375 DSA can make use of multiple CPU ports in two ways. First, it is possible to
378 custom policies of static load balancing between user ports, by spreading the
379 affinities according to the available CPU ports.
381 Secondly, it is possible to perform load balancing between CPU ports on a per
382 packet basis, rather than statically assigning user ports to CPU ports.
384 or team). DSA monitors this operation and creates a mirror of this software LAG
385 on the CPU ports facing the physical DSA masters that constitute the LAG slave
388 To make use of multiple CPU ports, the firmware (device tree) description of
389 the switch must mark all the links between CPU ports and their DSA masters
391 and DSA master will be used - the numerically first port from the firmware
396 changing the DSA master of a user port. The ``IFLA_DSA_MASTER`` u32 netlink
397 attribute contains the ifindex of the master device that handles each slave
404 .. code-block:: sh
407 ip -d link show dev swp0
412 ip link set swp0 type dsa master eth1
413 ip link set swp1 type dsa master eth0
414 ip link set swp2 type dsa master eth1
415 ip link set swp3 type dsa master eth0
417 # CPU ports in LAG, using explicit assignment of the DSA master
418 ip link add bond0 type bond mode balance-xor && ip link set bond0 up
419 ip link set eth1 down && ip link set eth1 master bond0
420 ip link set swp0 type dsa master bond0
421 ip link set swp1 type dsa master bond0
422 ip link set swp2 type dsa master bond0
423 ip link set swp3 type dsa master bond0
424 ip link set eth0 down && ip link set eth0 master bond0
425 ip -d link show dev swp0
429 # CPU ports in LAG, relying on implicit migration of the DSA master
430 ip link add bond0 type bond mode balance-xor && ip link set bond0 up
431 ip link set eth0 down && ip link set eth0 master bond0
432 ip link set eth1 down && ip link set eth1 master bond0
433 ip -d link show dev swp0
437 Notice that in the case of CPU ports under a LAG, the use of the
439 reacts to the ``IFLA_MASTER`` attribute change of its present master (``eth0``)
440 and migrates all user ports to the new upper of ``eth0``, ``bond0``. Similarly,
441 when ``bond0`` is destroyed using ``RTM_DELLINK``, DSA migrates the user ports
446 In a setup with more than 2 physical CPU ports, it is therefore possible to mix
449 upper interfaces (this includes LAG devices - the master must always be the LAG
452 Live changing of the DSA master (and thus CPU port) affinity of a user port is