sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget0/translations/zh_CN/networking/dsa/configurationmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget0/translations/zh_TW/networking/dsa/configurationmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget0/translations/it_IT/networking/dsa/configurationmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget0/translations/ja_JP/networking/dsa/configurationmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget0/translations/ko_KR/networking/dsa/configurationmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget0/translations/sp_SP/networking/dsa/configurationmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhcomment)}(h SPDX-License-Identifier: GPL-2.0h]h SPDX-License-Identifier: GPL-2.0}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhhJ/var/lib/git/docbuild/linux/Documentation/networking/dsa/configuration.rsthKubhsection)}(hhh](htitle)}(h'DSA switch configuration from userspaceh]h'DSA switch configuration from userspace}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh paragraph)}(hThe DSA switch configuration is not integrated into the main userspace network configuration suites by now and has to be performed manually.h]hThe DSA switch configuration is not integrated into the main userspace network configuration suites by now and has to be performed manually.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubhtarget)}(h.. _dsa-config-showcases:h]h}(h]h ]h"]h$]h&]refiddsa-config-showcasesuh1hhK hhhhhhubh)}(hhh](h)}(hConfiguration showcasesh]hConfiguration showcases}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhK ubh)}(hTo configure a DSA switch a couple of commands need to be executed. In this documentation some common configuration scenarios are handled as showcases:h]hTo configure a DSA switch a couple of commands need to be executed. In this documentation some common configuration scenarios are handled as showcases:}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubhdefinition_list)}(hhh](hdefinition_list_item)}(hO*single port* Every switch port acts as a different configurable Ethernet port h](hterm)}(h *single port*h]hemphasis)}(hjh]h single port}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhKhj ubh definition)}(hhh]h)}(h@Every switch port acts as a different configurable Ethernet porth]h@Every switch port acts as a different configurable Ethernet port}(hj1hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj.ubah}(h]h ]h"]h$]h&]uh1j,hj ubeh}(h]h ]h"]h$]h&]uh1j hhhKhjubj )}(hG*bridge* Every switch port is part of one configurable Ethernet bridge h](j)}(h*bridge*h]j)}(hjQh]hbridge}(hjShhhNhNubah}(h]h ]h"]h$]h&]uh1jhjOubah}(h]h ]h"]h$]h&]uh1jhhhKhjKubj-)}(hhh]h)}(h=Every switch port is part of one configurable Ethernet bridgeh]h=Every switch port is part of one configurable Ethernet bridge}(hjihhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjfubah}(h]h ]h"]h$]h&]uh1j,hjKubeh}(h]h ]h"]h$]h&]uh1j hhhKhjhhubj )}(h*gateway* Every switch port except one upstream port is part of a configurable Ethernet bridge. The upstream port acts as different configurable Ethernet port. h](j)}(h *gateway*h]j)}(hjh]hgateway}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhKhjubj-)}(hhh]h)}(hEvery switch port except one upstream port is part of a configurable Ethernet bridge. The upstream port acts as different configurable Ethernet port.h]hEvery switch port except one upstream port is part of a configurable Ethernet bridge. The upstream port acts as different configurable Ethernet port.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j,hjubeh}(h]h ]h"]h$]h&]uh1j hhhKhjhhubeh}(h]h ]h"]h$]h&]uh1jhhhhhhhNubh)}(hAll configurations are performed with tools from iproute2, which is available at https://www.kernel.org/pub/linux/utils/net/iproute2/h](hQAll configurations are performed with tools from iproute2, which is available at }(hjhhhNhNubh reference)}(h4https://www.kernel.org/pub/linux/utils/net/iproute2/h]h4https://www.kernel.org/pub/linux/utils/net/iproute2/}(hjhhhNhNubah}(h]h ]h"]h$]h&]refurijuh1jhjubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hX)Through DSA every port of a switch is handled like a normal linux Ethernet interface. The CPU port is the switch port connected to an Ethernet MAC chip. The corresponding linux Ethernet interface is called the conduit interface. All other corresponding linux interfaces are called user interfaces.h]hX)Through DSA every port of a switch is handled like a normal linux Ethernet interface. The CPU port is the switch port connected to an Ethernet MAC chip. The corresponding linux Ethernet interface is called the conduit interface. All other corresponding linux interfaces are called user interfaces.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhhhubh)}(hXThe user interfaces depend on the conduit interface being up in order for them to send or receive traffic. Prior to kernel v5.12, the state of the conduit interface had to be managed explicitly by the user. Starting with kernel v5.12, the behavior is as follows:h]hXThe user interfaces depend on the conduit interface being up in order for them to send or receive traffic. Prior to kernel v5.12, the state of the conduit interface had to be managed explicitly by the user. Starting with kernel v5.12, the behavior is as follows:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK%hhhhubh bullet_list)}(hhh](h list_item)}(h[when a DSA user interface is brought up, the conduit interface is automatically brought up.h]h)}(h[when a DSA user interface is brought up, the conduit interface is automatically brought up.h]h[when a DSA user interface is brought up, the conduit interface is automatically brought up.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK*hjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(hdwhen the conduit interface is brought down, all DSA user interfaces are automatically brought down. h]h)}(hcwhen the conduit interface is brought down, all DSA user interfaces are automatically brought down.h]hcwhen the conduit interface is brought down, all DSA user interfaces are automatically brought down.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK,hjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubeh}(h]h ]h"]h$]h&]bullet-uh1jhhhK*hhhhubh)}(hAIn this documentation the following Ethernet interfaces are used:h]hAIn this documentation the following Ethernet interfaces are used:}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK/hhhhubj)}(hhh](j )}(h*eth0* the conduit interface h](j)}(h*eth0*h]j)}(hjRh]heth0}(hjThhhNhNubah}(h]h ]h"]h$]h&]uh1jhjPubah}(h]h ]h"]h$]h&]uh1jhhhK2hjLubj-)}(hhh]h)}(hthe conduit interfaceh]hthe conduit interface}(hjjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK2hjgubah}(h]h ]h"]h$]h&]uh1j,hjLubeh}(h]h ]h"]h$]h&]uh1j hhhK2hjIubj )}(h!*eth1* another conduit interface h](j)}(h*eth1*h]j)}(hjh]heth1}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhK5hjubj-)}(hhh]h)}(hanother conduit interfaceh]hanother conduit interface}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK5hjubah}(h]h ]h"]h$]h&]uh1j,hjubeh}(h]h ]h"]h$]h&]uh1j hhhK5hjIhhubj )}(h*lan1* a user interface h](j)}(h*lan1*h]j)}(hjh]hlan1}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhK8hjubj-)}(hhh]h)}(ha user interfaceh]ha user interface}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK8hjubah}(h]h ]h"]h$]h&]uh1j,hjubeh}(h]h ]h"]h$]h&]uh1j hhhK8hjIhhubj )}(h*lan2* another user interface h](j)}(h*lan2*h]j)}(hjh]hlan2}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhK;hjubj-)}(hhh]h)}(hanother user interfaceh]hanother user interface}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK;hjubah}(h]h ]h"]h$]h&]uh1j,hjubeh}(h]h ]h"]h$]h&]uh1j hhhK;hjIhhubj )}(h*lan3* a third user interface h](j)}(h*lan3*h]j)}(hj2h]hlan3}(hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj0ubah}(h]h ]h"]h$]h&]uh1jhhhK>hj,ubj-)}(hhh]h)}(ha third user interfaceh]ha third user interface}(hjJhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK>hjGubah}(h]h ]h"]h$]h&]uh1j,hj,ubeh}(h]h ]h"]h$]h&]uh1j hhhK>hjIhhubj )}(h6*wan* A user interface dedicated for upstream traffic h](j)}(h*wan*h]j)}(hjjh]hwan}(hjlhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjhubah}(h]h ]h"]h$]h&]uh1jhhhKAhjdubj-)}(hhh]h)}(h/A user interface dedicated for upstream traffich]h/A user interface dedicated for upstream traffic}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKAhjubah}(h]h ]h"]h$]h&]uh1j,hjdubeh}(h]h ]h"]h$]h&]uh1j hhhKAhjIhhubeh}(h]h ]h"]h$]h&]uh1jhhhhhhhNubh)}(h[Further Ethernet interfaces can be configured similar. The configured IPs and networks are:h]h[Further Ethernet interfaces can be configured similar. The configured IPs and networks are:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKChhhhubj)}(hhh](j )}(h*single port* * lan1: 192.0.2.1/30 (192.0.2.0 - 192.0.2.3) * lan2: 192.0.2.5/30 (192.0.2.4 - 192.0.2.7) * lan3: 192.0.2.9/30 (192.0.2.8 - 192.0.2.11) h](j)}(h *single port*h]j)}(hjh]h single port}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhKIhjubj-)}(hhh]j)}(hhh](j)}(h*lan1: 192.0.2.1/30 (192.0.2.0 - 192.0.2.3)h]h)}(hjh]h*lan1: 192.0.2.1/30 (192.0.2.0 - 192.0.2.3)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKGhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(h*lan2: 192.0.2.5/30 (192.0.2.4 - 192.0.2.7)h]h)}(hjh]h*lan2: 192.0.2.5/30 (192.0.2.4 - 192.0.2.7)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKHhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(h,lan3: 192.0.2.9/30 (192.0.2.8 - 192.0.2.11) h]h)}(h+lan3: 192.0.2.9/30 (192.0.2.8 - 192.0.2.11)h]h+lan3: 192.0.2.9/30 (192.0.2.8 - 192.0.2.11)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKIhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]j9*uh1jhhhKGhjubah}(h]h ]h"]h$]h&]uh1j,hjubeh}(h]h ]h"]h$]h&]uh1j hhhKIhjubj )}(h;*bridge* * br0: 192.0.2.129/25 (192.0.2.128 - 192.0.2.255) h](j)}(h*bridge*h]j)}(hj3h]hbridge}(hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj1ubah}(h]h ]h"]h$]h&]uh1jhhhKLhj-ubj-)}(hhh]j)}(hhh]j)}(h0br0: 192.0.2.129/25 (192.0.2.128 - 192.0.2.255) h]h)}(h/br0: 192.0.2.129/25 (192.0.2.128 - 192.0.2.255)h]h/br0: 192.0.2.129/25 (192.0.2.128 - 192.0.2.255)}(hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKLhjNubah}(h]h ]h"]h$]h&]uh1jhjKubah}(h]h ]h"]h$]h&]j9j uh1jhhhKLhjHubah}(h]h ]h"]h$]h&]uh1j,hj-ubeh}(h]h ]h"]h$]h&]uh1j hhhKLhjhhubj )}(hh*gateway* * br0: 192.0.2.129/25 (192.0.2.128 - 192.0.2.255) * wan: 192.0.2.1/30 (192.0.2.0 - 192.0.2.3) h](j)}(h *gateway*h]j)}(hj~h]hgateway}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj|ubah}(h]h ]h"]h$]h&]uh1jhhhKPhjxubj-)}(hhh]j)}(hhh](j)}(h/br0: 192.0.2.129/25 (192.0.2.128 - 192.0.2.255)h]h)}(hjh]h/br0: 192.0.2.129/25 (192.0.2.128 - 192.0.2.255)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKOhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(h*wan: 192.0.2.1/30 (192.0.2.0 - 192.0.2.3) h]h)}(h)wan: 192.0.2.1/30 (192.0.2.0 - 192.0.2.3)h]h)wan: 192.0.2.1/30 (192.0.2.0 - 192.0.2.3)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKPhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]j9j uh1jhhhKOhjubah}(h]h ]h"]h$]h&]uh1j,hjxubeh}(h]h ]h"]h$]h&]uh1j hhhKPhjhhubeh}(h]h ]h"]h$]h&]uh1jhhhhhNhNubh)}(h.. _dsa-tagged-configuration:h]h}(h]h ]h"]h$]h&]hdsa-tagged-configurationuh1hhKRhhhhhhubeh}(h](configuration-showcasesheh ]h"](configuration showcasesdsa-config-showcaseseh$]h&]uh1hhhhhhhhK expect_referenced_by_name}jhsexpect_referenced_by_id}hhsubh)}(hhh](h)}(h"Configuration with tagging supporth]h"Configuration with tagging support}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKUubh)}(hThe tagging based configuration is desired and supported by the majority of DSA switches. These switches are capable to tag incoming and outgoing traffic without using a VLAN based configuration.h]hThe tagging based configuration is desired and supported by the majority of DSA switches. These switches are capable to tag incoming and outgoing traffic without using a VLAN based configuration.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKWhjhhubj)}(hhh](j )}(hX*single port* .. code-block:: sh # configure each interface ip addr add 192.0.2.1/30 dev lan1 ip addr add 192.0.2.5/30 dev lan2 ip addr add 192.0.2.9/30 dev lan3 # For kernels earlier than v5.12, the conduit interface needs to be # brought up manually before the user ports. ip link set eth0 up # bring up the user interfaces ip link set lan1 up ip link set lan2 up ip link set lan3 up h](j)}(h *single port*h]j)}(hj h]h single port}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhKjhjubj-)}(hhh]h literal_block)}(hXb# configure each interface ip addr add 192.0.2.1/30 dev lan1 ip addr add 192.0.2.5/30 dev lan2 ip addr add 192.0.2.9/30 dev lan3 # For kernels earlier than v5.12, the conduit interface needs to be # brought up manually before the user ports. ip link set eth0 up # bring up the user interfaces ip link set lan1 up ip link set lan2 up ip link set lan3 uph]hXb# configure each interface ip addr add 192.0.2.1/30 dev lan1 ip addr add 192.0.2.5/30 dev lan2 ip addr add 192.0.2.9/30 dev lan3 # For kernels earlier than v5.12, the conduit interface needs to be # brought up manually before the user ports. ip link set eth0 up # bring up the user interfaces ip link set lan1 up ip link set lan2 up ip link set lan3 up}hj:sbah}(h]h ]h"]h$]h&]hhforcelanguageshhighlight_args}uh1j8hhhK\hj5ubah}(h]h ]h"]h$]h&]uh1j,hjubeh}(h]h ]h"]h$]h&]uh1j hhhKjhjubj )}(hX2*bridge* .. code-block:: sh # For kernels earlier than v5.12, the conduit interface needs to be # brought up manually before the user ports. ip link set eth0 up # bring up the user interfaces ip link set lan1 up ip link set lan2 up ip link set lan3 up # create bridge ip link add name br0 type bridge # add ports to bridge ip link set dev lan1 master br0 ip link set dev lan2 master br0 ip link set dev lan3 master br0 # configure the bridge ip addr add 192.0.2.129/25 dev br0 # bring up the bridge ip link set dev br0 up h](j)}(h*bridge*h]j)}(hj_h]hbridge}(hjahhhNhNubah}(h]h ]h"]h$]h&]uh1jhj]ubah}(h]h ]h"]h$]h&]uh1jhhhKhjYubj-)}(hhh]j9)}(hX# For kernels earlier than v5.12, the conduit interface needs to be # brought up manually before the user ports. ip link set eth0 up # bring up the user interfaces ip link set lan1 up ip link set lan2 up ip link set lan3 up # create bridge ip link add name br0 type bridge # add ports to bridge ip link set dev lan1 master br0 ip link set dev lan2 master br0 ip link set dev lan3 master br0 # configure the bridge ip addr add 192.0.2.129/25 dev br0 # bring up the bridge ip link set dev br0 uph]hX# For kernels earlier than v5.12, the conduit interface needs to be # brought up manually before the user ports. ip link set eth0 up # bring up the user interfaces ip link set lan1 up ip link set lan2 up ip link set lan3 up # create bridge ip link add name br0 type bridge # add ports to bridge ip link set dev lan1 master br0 ip link set dev lan2 master br0 ip link set dev lan3 master br0 # configure the bridge ip addr add 192.0.2.129/25 dev br0 # bring up the bridge ip link set dev br0 up}hjwsbah}(h]h ]h"]h$]h&]hhjHjIshjK}uh1j8hhhKmhjtubah}(h]h ]h"]h$]h&]uh1j,hjYubeh}(h]h ]h"]h$]h&]uh1j hhhKhjhhubj )}(hXT*gateway* .. code-block:: sh # For kernels earlier than v5.12, the conduit interface needs to be # brought up manually before the user ports. ip link set eth0 up # bring up the user interfaces ip link set wan up ip link set lan1 up ip link set lan2 up # configure the upstream port ip addr add 192.0.2.1/30 dev wan # create bridge ip link add name br0 type bridge # add ports to bridge ip link set dev lan1 master br0 ip link set dev lan2 master br0 # configure the bridge ip addr add 192.0.2.129/25 dev br0 # bring up the bridge ip link set dev br0 up h](j)}(h *gateway*h]j)}(hjh]hgateway}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhKhjubj-)}(hhh]j9)}(hX# For kernels earlier than v5.12, the conduit interface needs to be # brought up manually before the user ports. ip link set eth0 up # bring up the user interfaces ip link set wan up ip link set lan1 up ip link set lan2 up # configure the upstream port ip addr add 192.0.2.1/30 dev wan # create bridge ip link add name br0 type bridge # add ports to bridge ip link set dev lan1 master br0 ip link set dev lan2 master br0 # configure the bridge ip addr add 192.0.2.129/25 dev br0 # bring up the bridge ip link set dev br0 uph]hX# For kernels earlier than v5.12, the conduit interface needs to be # brought up manually before the user ports. ip link set eth0 up # bring up the user interfaces ip link set wan up ip link set lan1 up ip link set lan2 up # configure the upstream port ip addr add 192.0.2.1/30 dev wan # create bridge ip link add name br0 type bridge # add ports to bridge ip link set dev lan1 master br0 ip link set dev lan2 master br0 # configure the bridge ip addr add 192.0.2.129/25 dev br0 # bring up the bridge ip link set dev br0 up}hjsbah}(h]h ]h"]h$]h&]hhjHjIshjK}uh1j8hhhKhjubah}(h]h ]h"]h$]h&]uh1j,hjubeh}(h]h ]h"]h$]h&]uh1j hhhKhjhhubeh}(h]h ]h"]h$]h&]uh1jhjhhhNhNubh)}(h.. _dsa-vlan-configuration:h]h}(h]h ]h"]h$]h&]hdsa-vlan-configurationuh1hhKhjhhhhubeh}(h]("configuration-with-tagging-supportjeh ]h"]("configuration with tagging supportdsa-tagged-configurationeh$]h&]uh1hhhhhhhhKUj}jjsj}jjsubh)}(hhh](h)}(h%Configuration without tagging supporth]h%Configuration without tagging support}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hA minority of switches are not capable to use a taging protocol (DSA_TAG_PROTO_NONE). These switches can be configured by a VLAN based configuration.h]hA minority of switches are not capable to use a taging protocol (DSA_TAG_PROTO_NONE). These switches can be configured by a VLAN based configuration.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj)}(hhh](j )}(hX*single port* The configuration can only be set up via VLAN tagging and bridge setup. .. code-block:: sh # tag traffic on CPU port ip link add link eth0 name eth0.1 type vlan id 1 ip link add link eth0 name eth0.2 type vlan id 2 ip link add link eth0 name eth0.3 type vlan id 3 # For kernels earlier than v5.12, the conduit interface needs to be # brought up manually before the user ports. ip link set eth0 up ip link set eth0.1 up ip link set eth0.2 up ip link set eth0.3 up # bring up the user interfaces ip link set lan1 up ip link set lan2 up ip link set lan3 up # create bridge ip link add name br0 type bridge # activate VLAN filtering ip link set dev br0 type bridge vlan_filtering 1 # add ports to bridges ip link set dev lan1 master br0 ip link set dev lan2 master br0 ip link set dev lan3 master br0 # tag traffic on ports bridge vlan add dev lan1 vid 1 pvid untagged bridge vlan add dev lan2 vid 2 pvid untagged bridge vlan add dev lan3 vid 3 pvid untagged # configure the VLANs ip addr add 192.0.2.1/30 dev eth0.1 ip addr add 192.0.2.5/30 dev eth0.2 ip addr add 192.0.2.9/30 dev eth0.3 # bring up the bridge devices ip link set br0 up h](j)}(h *single port*h]j)}(hjh]h single port}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhKhj ubj-)}(hhh](h)}(hGThe configuration can only be set up via VLAN tagging and bridge setup.h]hGThe configuration can only be set up via VLAN tagging and bridge setup.}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj&ubj9)}(hX# tag traffic on CPU port ip link add link eth0 name eth0.1 type vlan id 1 ip link add link eth0 name eth0.2 type vlan id 2 ip link add link eth0 name eth0.3 type vlan id 3 # For kernels earlier than v5.12, the conduit interface needs to be # brought up manually before the user ports. ip link set eth0 up ip link set eth0.1 up ip link set eth0.2 up ip link set eth0.3 up # bring up the user interfaces ip link set lan1 up ip link set lan2 up ip link set lan3 up # create bridge ip link add name br0 type bridge # activate VLAN filtering ip link set dev br0 type bridge vlan_filtering 1 # add ports to bridges ip link set dev lan1 master br0 ip link set dev lan2 master br0 ip link set dev lan3 master br0 # tag traffic on ports bridge vlan add dev lan1 vid 1 pvid untagged bridge vlan add dev lan2 vid 2 pvid untagged bridge vlan add dev lan3 vid 3 pvid untagged # configure the VLANs ip addr add 192.0.2.1/30 dev eth0.1 ip addr add 192.0.2.5/30 dev eth0.2 ip addr add 192.0.2.9/30 dev eth0.3 # bring up the bridge devices ip link set br0 uph]hX# tag traffic on CPU port ip link add link eth0 name eth0.1 type vlan id 1 ip link add link eth0 name eth0.2 type vlan id 2 ip link add link eth0 name eth0.3 type vlan id 3 # For kernels earlier than v5.12, the conduit interface needs to be # brought up manually before the user ports. ip link set eth0 up ip link set eth0.1 up ip link set eth0.2 up ip link set eth0.3 up # bring up the user interfaces ip link set lan1 up ip link set lan2 up ip link set lan3 up # create bridge ip link add name br0 type bridge # activate VLAN filtering ip link set dev br0 type bridge vlan_filtering 1 # add ports to bridges ip link set dev lan1 master br0 ip link set dev lan2 master br0 ip link set dev lan3 master br0 # tag traffic on ports bridge vlan add dev lan1 vid 1 pvid untagged bridge vlan add dev lan2 vid 2 pvid untagged bridge vlan add dev lan3 vid 3 pvid untagged # configure the VLANs ip addr add 192.0.2.1/30 dev eth0.1 ip addr add 192.0.2.5/30 dev eth0.2 ip addr add 192.0.2.9/30 dev eth0.3 # bring up the bridge devices ip link set br0 up}hj7sbah}(h]h ]h"]h$]h&]hhjHjIshjK}uh1j8hhhKhj&ubeh}(h]h ]h"]h$]h&]uh1j,hj ubeh}(h]h ]h"]h$]h&]uh1j hhhKhjubj )}(hX*bridge* .. code-block:: sh # tag traffic on CPU port ip link add link eth0 name eth0.1 type vlan id 1 # For kernels earlier than v5.12, the conduit interface needs to be # brought up manually before the user ports. ip link set eth0 up ip link set eth0.1 up # bring up the user interfaces ip link set lan1 up ip link set lan2 up ip link set lan3 up # create bridge ip link add name br0 type bridge # activate VLAN filtering ip link set dev br0 type bridge vlan_filtering 1 # add ports to bridge ip link set dev lan1 master br0 ip link set dev lan2 master br0 ip link set dev lan3 master br0 ip link set eth0.1 master br0 # tag traffic on ports bridge vlan add dev lan1 vid 1 pvid untagged bridge vlan add dev lan2 vid 1 pvid untagged bridge vlan add dev lan3 vid 1 pvid untagged # configure the bridge ip addr add 192.0.2.129/25 dev br0 # bring up the bridge ip link set dev br0 up h](j)}(h*bridge*h]j)}(hjYh]hbridge}(hj[hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjWubah}(h]h ]h"]h$]h&]uh1jhhhKhjSubj-)}(hhh]j9)}(hX]# tag traffic on CPU port ip link add link eth0 name eth0.1 type vlan id 1 # For kernels earlier than v5.12, the conduit interface needs to be # brought up manually before the user ports. ip link set eth0 up ip link set eth0.1 up # bring up the user interfaces ip link set lan1 up ip link set lan2 up ip link set lan3 up # create bridge ip link add name br0 type bridge # activate VLAN filtering ip link set dev br0 type bridge vlan_filtering 1 # add ports to bridge ip link set dev lan1 master br0 ip link set dev lan2 master br0 ip link set dev lan3 master br0 ip link set eth0.1 master br0 # tag traffic on ports bridge vlan add dev lan1 vid 1 pvid untagged bridge vlan add dev lan2 vid 1 pvid untagged bridge vlan add dev lan3 vid 1 pvid untagged # configure the bridge ip addr add 192.0.2.129/25 dev br0 # bring up the bridge ip link set dev br0 uph]hX]# tag traffic on CPU port ip link add link eth0 name eth0.1 type vlan id 1 # For kernels earlier than v5.12, the conduit interface needs to be # brought up manually before the user ports. ip link set eth0 up ip link set eth0.1 up # bring up the user interfaces ip link set lan1 up ip link set lan2 up ip link set lan3 up # create bridge ip link add name br0 type bridge # activate VLAN filtering ip link set dev br0 type bridge vlan_filtering 1 # add ports to bridge ip link set dev lan1 master br0 ip link set dev lan2 master br0 ip link set dev lan3 master br0 ip link set eth0.1 master br0 # tag traffic on ports bridge vlan add dev lan1 vid 1 pvid untagged bridge vlan add dev lan2 vid 1 pvid untagged bridge vlan add dev lan3 vid 1 pvid untagged # configure the bridge ip addr add 192.0.2.129/25 dev br0 # bring up the bridge ip link set dev br0 up}hjqsbah}(h]h ]h"]h$]h&]hhjHjIshjK}uh1j8hhhKhjnubah}(h]h ]h"]h$]h&]uh1j,hjSubeh}(h]h ]h"]h$]h&]uh1j hhhKhjhhubj )}(hX$*gateway* .. code-block:: sh # tag traffic on CPU port ip link add link eth0 name eth0.1 type vlan id 1 ip link add link eth0 name eth0.2 type vlan id 2 # For kernels earlier than v5.12, the conduit interface needs to be # brought up manually before the user ports. ip link set eth0 up ip link set eth0.1 up ip link set eth0.2 up # bring up the user interfaces ip link set wan up ip link set lan1 up ip link set lan2 up # create bridge ip link add name br0 type bridge # activate VLAN filtering ip link set dev br0 type bridge vlan_filtering 1 # add ports to bridges ip link set dev wan master br0 ip link set eth0.1 master br0 ip link set dev lan1 master br0 ip link set dev lan2 master br0 # tag traffic on ports bridge vlan add dev lan1 vid 1 pvid untagged bridge vlan add dev lan2 vid 1 pvid untagged bridge vlan add dev wan vid 2 pvid untagged # configure the VLANs ip addr add 192.0.2.1/30 dev eth0.2 ip addr add 192.0.2.129/25 dev br0 # bring up the bridge devices ip link set br0 up h](j)}(h *gateway*h]j)}(hjh]hgateway}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhM)hjubj-)}(hhh]j9)}(hX# tag traffic on CPU port ip link add link eth0 name eth0.1 type vlan id 1 ip link add link eth0 name eth0.2 type vlan id 2 # For kernels earlier than v5.12, the conduit interface needs to be # brought up manually before the user ports. ip link set eth0 up ip link set eth0.1 up ip link set eth0.2 up # bring up the user interfaces ip link set wan up ip link set lan1 up ip link set lan2 up # create bridge ip link add name br0 type bridge # activate VLAN filtering ip link set dev br0 type bridge vlan_filtering 1 # add ports to bridges ip link set dev wan master br0 ip link set eth0.1 master br0 ip link set dev lan1 master br0 ip link set dev lan2 master br0 # tag traffic on ports bridge vlan add dev lan1 vid 1 pvid untagged bridge vlan add dev lan2 vid 1 pvid untagged bridge vlan add dev wan vid 2 pvid untagged # configure the VLANs ip addr add 192.0.2.1/30 dev eth0.2 ip addr add 192.0.2.129/25 dev br0 # bring up the bridge devices ip link set br0 uph]hX# tag traffic on CPU port ip link add link eth0 name eth0.1 type vlan id 1 ip link add link eth0 name eth0.2 type vlan id 2 # For kernels earlier than v5.12, the conduit interface needs to be # brought up manually before the user ports. ip link set eth0 up ip link set eth0.1 up ip link set eth0.2 up # bring up the user interfaces ip link set wan up ip link set lan1 up ip link set lan2 up # create bridge ip link add name br0 type bridge # activate VLAN filtering ip link set dev br0 type bridge vlan_filtering 1 # add ports to bridges ip link set dev wan master br0 ip link set eth0.1 master br0 ip link set dev lan1 master br0 ip link set dev lan2 master br0 # tag traffic on ports bridge vlan add dev lan1 vid 1 pvid untagged bridge vlan add dev lan2 vid 1 pvid untagged bridge vlan add dev wan vid 2 pvid untagged # configure the VLANs ip addr add 192.0.2.1/30 dev eth0.2 ip addr add 192.0.2.129/25 dev br0 # bring up the bridge devices ip link set br0 up}hjsbah}(h]h ]h"]h$]h&]hhjHjIshjK}uh1j8hhhMhjubah}(h]h ]h"]h$]h&]uh1j,hjubeh}(h]h ]h"]h$]h&]uh1j hhhM)hjhhubeh}(h]h ]h"]h$]h&]uh1jhjhhhNhNubeh}(h](%configuration-without-tagging-supportjeh ]h"](%configuration without tagging supportdsa-vlan-configurationeh$]h&]uh1hhhhhhhhKj}jjsj}jjsubh)}(hhh](h)}(h$Forwarding database (FDB) managementh]h$Forwarding database (FDB) management}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhM,ubh)}(hXThe existing DSA switches do not have the necessary hardware support to keep the software FDB of the bridge in sync with the hardware tables, so the two tables are managed separately (``bridge fdb show`` queries both, and depending on whether the ``self`` or ``master`` flags are being used, a ``bridge fdb add`` or ``bridge fdb del`` command acts upon entries from one or both tables).h](hThe existing DSA switches do not have the necessary hardware support to keep the software FDB of the bridge in sync with the hardware tables, so the two tables are managed separately (}(hjhhhNhNubhliteral)}(h``bridge fdb show``h]hbridge fdb show}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh, queries both, and depending on whether the }(hjhhhNhNubj)}(h``self``h]hself}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh or }(hjhhhNhNubj)}(h ``master``h]hmaster}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh flags are being used, a }(hjhhhNhNubj)}(h``bridge fdb add``h]hbridge fdb add}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh or }hjsbj)}(h``bridge fdb del``h]hbridge fdb del}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh4 command acts upon entries from one or both tables).}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM.hjhhubh)}(hUp until kernel v4.14, DSA only supported user space management of bridge FDB entries using the bridge bypass operations (which do not update the software FDB, just the hardware one) using the ``self`` flag (which is optional and can be omitted).h](hUp until kernel v4.14, DSA only supported user space management of bridge FDB entries using the bridge bypass operations (which do not update the software FDB, just the hardware one) using the }(hjShhhNhNubj)}(h``self``h]hself}(hj[hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjSubh- flag (which is optional and can be omitted).}(hjShhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM4hjhhubh block_quote)}(h.. code-block:: sh bridge fdb add dev swp0 00:01:02:03:04:05 self static # or shorthand bridge fdb add dev swp0 00:01:02:03:04:05 static h]j9)}(hubridge fdb add dev swp0 00:01:02:03:04:05 self static # or shorthand bridge fdb add dev swp0 00:01:02:03:04:05 statich]hubridge fdb add dev swp0 00:01:02:03:04:05 self static # or shorthand bridge fdb add dev swp0 00:01:02:03:04:05 static}hjysbah}(h]h ]h"]h$]h&]hhjHjIshjK}uh1j8hhhM9hjuubah}(h]h ]h"]h$]h&]uh1jshhhM9hjhhubh)}(hXDue to a bug, the bridge bypass FDB implementation provided by DSA did not distinguish between ``static`` and ``local`` FDB entries (``static`` are meant to be forwarded, while ``local`` are meant to be locally terminated, i.e. sent to the host port). Instead, all FDB entries with the ``self`` flag (implicit or explicit) are treated by DSA as ``static`` even if they are ``local``.h](h_Due to a bug, the bridge bypass FDB implementation provided by DSA did not distinguish between }(hjhhhNhNubj)}(h ``static``h]hstatic}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh and }(hjhhhNhNubj)}(h ``local``h]hlocal}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh FDB entries (}(hjhhhNhNubj)}(h ``static``h]hstatic}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh" are meant to be forwarded, while }(hjhhhNhNubj)}(h ``local``h]hlocal}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhd are meant to be locally terminated, i.e. sent to the host port). Instead, all FDB entries with the }(hjhhhNhNubj)}(h``self``h]hself}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh3 flag (implicit or explicit) are treated by DSA as }(hjhhhNhNubj)}(h ``static``h]hstatic}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh even if they are }(hjhhhNhNubj)}(h ``local``h]hlocal}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM?hjhhubjt)}(hX[.. code-block:: sh # This command: bridge fdb add dev swp0 00:01:02:03:04:05 static # behaves the same for DSA as this command: bridge fdb add dev swp0 00:01:02:03:04:05 local # or shorthand, because the 'local' flag is implicit if 'static' is not # specified, it also behaves the same as: bridge fdb add dev swp0 00:01:02:03:04:05 h]j9)}(hX8# This command: bridge fdb add dev swp0 00:01:02:03:04:05 static # behaves the same for DSA as this command: bridge fdb add dev swp0 00:01:02:03:04:05 local # or shorthand, because the 'local' flag is implicit if 'static' is not # specified, it also behaves the same as: bridge fdb add dev swp0 00:01:02:03:04:05h]hX8# This command: bridge fdb add dev swp0 00:01:02:03:04:05 static # behaves the same for DSA as this command: bridge fdb add dev swp0 00:01:02:03:04:05 local # or shorthand, because the 'local' flag is implicit if 'static' is not # specified, it also behaves the same as: bridge fdb add dev swp0 00:01:02:03:04:05}hjsbah}(h]h ]h"]h$]h&]hhjHjIshjK}uh1j8hhhMEhjubah}(h]h ]h"]h$]h&]uh1jshhhMEhjhhubh)}(hXThe last command is an incorrect way of adding a static bridge FDB entry to a DSA switch using the bridge bypass operations, and works by mistake. Other drivers will treat an FDB entry added by the same command as ``local`` and as such, will not forward it, as opposed to DSA.h](hThe last command is an incorrect way of adding a static bridge FDB entry to a DSA switch using the bridge bypass operations, and works by mistake. Other drivers will treat an FDB entry added by the same command as }(hj5hhhNhNubj)}(h ``local``h]hlocal}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj5ubh5 and as such, will not forward it, as opposed to DSA.}(hj5hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMOhjhhubh)}(hBetween kernel v4.14 and v5.14, DSA has supported in parallel two modes of adding a bridge FDB entry to the switch: the bridge bypass discussed above, as well as a new mode using the ``master`` flag which installs FDB entries in the software bridge too.h](hBetween kernel v4.14 and v5.14, DSA has supported in parallel two modes of adding a bridge FDB entry to the switch: the bridge bypass discussed above, as well as a new mode using the }(hjUhhhNhNubj)}(h ``master``h]hmaster}(hj]hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjUubh< flag which installs FDB entries in the software bridge too.}(hjUhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMThjhhubjt)}(hN.. code-block:: sh bridge fdb add dev swp0 00:01:02:03:04:05 master static h]j9)}(h7bridge fdb add dev swp0 00:01:02:03:04:05 master statich]h7bridge fdb add dev swp0 00:01:02:03:04:05 master static}hjysbah}(h]h ]h"]h$]h&]hhjHjIshjK}uh1j8hhhMYhjuubah}(h]h ]h"]h$]h&]uh1jshhhMYhjhhubh)}(hSince kernel v5.14, DSA has gained stronger integration with the bridge's software FDB, and the support for its bridge bypass FDB implementation (using the ``self`` flag) has been removed. This results in the following changes:h](hSince kernel v5.14, DSA has gained stronger integration with the bridge’s software FDB, and the support for its bridge bypass FDB implementation (using the }(hjhhhNhNubj)}(h``self``h]hself}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh? flag) has been removed. This results in the following changes:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM]hjhhubjt)}(hX.. code-block:: sh # This is the only valid way of adding an FDB entry that is supported, # compatible with v4.14 kernels and later: bridge fdb add dev swp0 00:01:02:03:04:05 master static # This command is no longer buggy and the entry is properly treated as # 'local' instead of being forwarded: bridge fdb add dev swp0 00:01:02:03:04:05 # This command no longer installs a static FDB entry to hardware: bridge fdb add dev swp0 00:01:02:03:04:05 static h]j9)}(hX# This is the only valid way of adding an FDB entry that is supported, # compatible with v4.14 kernels and later: bridge fdb add dev swp0 00:01:02:03:04:05 master static # This command is no longer buggy and the entry is properly treated as # 'local' instead of being forwarded: bridge fdb add dev swp0 00:01:02:03:04:05 # This command no longer installs a static FDB entry to hardware: bridge fdb add dev swp0 00:01:02:03:04:05 statich]hX# This is the only valid way of adding an FDB entry that is supported, # compatible with v4.14 kernels and later: bridge fdb add dev swp0 00:01:02:03:04:05 master static # This command is no longer buggy and the entry is properly treated as # 'local' instead of being forwarded: bridge fdb add dev swp0 00:01:02:03:04:05 # This command no longer installs a static FDB entry to hardware: bridge fdb add dev swp0 00:01:02:03:04:05 static}hjsbah}(h]h ]h"]h$]h&]hhjHjIshjK}uh1j8hhhMahjubah}(h]h ]h"]h$]h&]uh1jshhhMahjhhubh)}(hScript writers are therefore encouraged to use the ``master static`` set of flags when working with bridge FDB entries on DSA switch interfaces.h](h3Script writers are therefore encouraged to use the }(hjhhhNhNubj)}(h``master static``h]h master static}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhL set of flags when working with bridge FDB entries on DSA switch interfaces.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMlhjhhubeh}(h]"forwarding-database-fdb-managementah ]h"]$forwarding database (fdb) managementah$]h&]uh1hhhhhhhhM,ubh)}(hhh](h)}(h#Affinity of user ports to CPU portsh]h#Affinity of user ports to CPU ports}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMpubh)}(hTypically, DSA switches are attached to the host via a single Ethernet interface, but in cases where the switch chip is discrete, the hardware design may permit the use of 2 or more ports connected to the host, for an increase in termination throughput.h]hTypically, DSA switches are attached to the host via a single Ethernet interface, but in cases where the switch chip is discrete, the hardware design may permit the use of 2 or more ports connected to the host, for an increase in termination throughput.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMrhjhhubh)}(hXcDSA can make use of multiple CPU ports in two ways. First, it is possible to statically assign the termination traffic associated with a certain user port to be processed by a certain CPU port. This way, user space can implement custom policies of static load balancing between user ports, by spreading the affinities according to the available CPU ports.h]hXcDSA can make use of multiple CPU ports in two ways. First, it is possible to statically assign the termination traffic associated with a certain user port to be processed by a certain CPU port. This way, user space can implement custom policies of static load balancing between user ports, by spreading the affinities according to the available CPU ports.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMwhjhhubh)}(hXSecondly, it is possible to perform load balancing between CPU ports on a per packet basis, rather than statically assigning user ports to CPU ports. This can be achieved by placing the DSA conduits under a LAG interface (bonding or team). DSA monitors this operation and creates a mirror of this software LAG on the CPU ports facing the physical DSA conduits that constitute the LAG slave devices.h]hXSecondly, it is possible to perform load balancing between CPU ports on a per packet basis, rather than statically assigning user ports to CPU ports. This can be achieved by placing the DSA conduits under a LAG interface (bonding or team). DSA monitors this operation and creates a mirror of this software LAG on the CPU ports facing the physical DSA conduits that constitute the LAG slave devices.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM}hjhhubh)}(hXTo make use of multiple CPU ports, the firmware (device tree) description of the switch must mark all the links between CPU ports and their DSA conduits using the ``ethernet`` reference/phandle. At startup, only a single CPU port and DSA conduit will be used - the numerically first port from the firmware description which has an ``ethernet`` property. It is up to the user to configure the system for the switch to use other conduits.h](hTo make use of multiple CPU ports, the firmware (device tree) description of the switch must mark all the links between CPU ports and their DSA conduits using the }(hj, hhhNhNubj)}(h ``ethernet``h]hethernet}(hj4 hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj, ubh reference/phandle. At startup, only a single CPU port and DSA conduit will be used - the numerically first port from the firmware description which has an }(hj, hhhNhNubj)}(h ``ethernet``h]hethernet}(hjF hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj, ubh] property. It is up to the user to configure the system for the switch to use other conduits.}(hj, hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hXDSA uses the ``rtnl_link_ops`` mechanism (with a "dsa" ``kind``) to allow changing the DSA conduit of a user port. The ``IFLA_DSA_CONDUIT`` u32 netlink attribute contains the ifindex of the conduit device that handles each user device. The DSA conduit must be a valid candidate based on firmware node information, or a LAG interface which contains only slaves which are valid candidates.h](h DSA uses the }(hj^ hhhNhNubj)}(h``rtnl_link_ops``h]h rtnl_link_ops}(hjf hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj^ ubh mechanism (with a “dsa” }(hj^ hhhNhNubj)}(h``kind``h]hkind}(hjx hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj^ ubh8) to allow changing the DSA conduit of a user port. The }(hj^ hhhNhNubj)}(h``IFLA_DSA_CONDUIT``h]hIFLA_DSA_CONDUIT}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj^ ubh u32 netlink attribute contains the ifindex of the conduit device that handles each user device. The DSA conduit must be a valid candidate based on firmware node information, or a LAG interface which contains only slaves which are valid candidates.}(hj^ hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(h9Using iproute2, the following manipulations are possible:h]h9Using iproute2, the following manipulations are possible:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubjt)}(hXX.. code-block:: sh # See the DSA conduit in current use ip -d link show dev swp0 (...) dsa master eth0 # Static CPU port distribution ip link set swp0 type dsa master eth1 ip link set swp1 type dsa master eth0 ip link set swp2 type dsa master eth1 ip link set swp3 type dsa master eth0 # CPU ports in LAG, using explicit assignment of the DSA conduit ip link add bond0 type bond mode balance-xor && ip link set bond0 up ip link set eth1 down && ip link set eth1 master bond0 ip link set swp0 type dsa master bond0 ip link set swp1 type dsa master bond0 ip link set swp2 type dsa master bond0 ip link set swp3 type dsa master bond0 ip link set eth0 down && ip link set eth0 master bond0 ip -d link show dev swp0 (...) dsa master bond0 # CPU ports in LAG, relying on implicit migration of the DSA conduit ip link add bond0 type bond mode balance-xor && ip link set bond0 up ip link set eth0 down && ip link set eth0 master bond0 ip link set eth1 down && ip link set eth1 master bond0 ip -d link show dev swp0 (...) dsa master bond0 h]j9)}(hX # See the DSA conduit in current use ip -d link show dev swp0 (...) dsa master eth0 # Static CPU port distribution ip link set swp0 type dsa master eth1 ip link set swp1 type dsa master eth0 ip link set swp2 type dsa master eth1 ip link set swp3 type dsa master eth0 # CPU ports in LAG, using explicit assignment of the DSA conduit ip link add bond0 type bond mode balance-xor && ip link set bond0 up ip link set eth1 down && ip link set eth1 master bond0 ip link set swp0 type dsa master bond0 ip link set swp1 type dsa master bond0 ip link set swp2 type dsa master bond0 ip link set swp3 type dsa master bond0 ip link set eth0 down && ip link set eth0 master bond0 ip -d link show dev swp0 (...) dsa master bond0 # CPU ports in LAG, relying on implicit migration of the DSA conduit ip link add bond0 type bond mode balance-xor && ip link set bond0 up ip link set eth0 down && ip link set eth0 master bond0 ip link set eth1 down && ip link set eth1 master bond0 ip -d link show dev swp0 (...) dsa master bond0h]hX # See the DSA conduit in current use ip -d link show dev swp0 (...) dsa master eth0 # Static CPU port distribution ip link set swp0 type dsa master eth1 ip link set swp1 type dsa master eth0 ip link set swp2 type dsa master eth1 ip link set swp3 type dsa master eth0 # CPU ports in LAG, using explicit assignment of the DSA conduit ip link add bond0 type bond mode balance-xor && ip link set bond0 up ip link set eth1 down && ip link set eth1 master bond0 ip link set swp0 type dsa master bond0 ip link set swp1 type dsa master bond0 ip link set swp2 type dsa master bond0 ip link set swp3 type dsa master bond0 ip link set eth0 down && ip link set eth0 master bond0 ip -d link show dev swp0 (...) dsa master bond0 # CPU ports in LAG, relying on implicit migration of the DSA conduit ip link add bond0 type bond mode balance-xor && ip link set bond0 up ip link set eth0 down && ip link set eth0 master bond0 ip link set eth1 down && ip link set eth1 master bond0 ip -d link show dev swp0 (...) dsa master bond0}hj sbah}(h]h ]h"]h$]h&]hhjHjIshjK}uh1j8hhhMhj ubah}(h]h ]h"]h$]h&]uh1jshhhMhjhhubh)}(hX2Notice that in the case of CPU ports under a LAG, the use of the ``IFLA_DSA_CONDUIT`` netlink attribute is not strictly needed, but rather, DSA reacts to the ``IFLA_MASTER`` attribute change of its present conduit (``eth0``) and migrates all user ports to the new upper of ``eth0``, ``bond0``. Similarly, when ``bond0`` is destroyed using ``RTM_DELLINK``, DSA migrates the user ports that were assigned to this interface to the first physical DSA conduit which is eligible, based on the firmware description (it effectively reverts to the startup configuration).h](hANotice that in the case of CPU ports under a LAG, the use of the }(hj hhhNhNubj)}(h``IFLA_DSA_CONDUIT``h]hIFLA_DSA_CONDUIT}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubhI netlink attribute is not strictly needed, but rather, DSA reacts to the }(hj hhhNhNubj)}(h``IFLA_MASTER``h]h IFLA_MASTER}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh* attribute change of its present conduit (}(hj hhhNhNubj)}(h``eth0``h]heth0}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh2) and migrates all user ports to the new upper of }(hj hhhNhNubj)}(h``eth0``h]heth0}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh, }(hj hhhNhNubj)}(h ``bond0``h]hbond0}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh. Similarly, when }(hj hhhNhNubj)}(h ``bond0``h]hbond0}(hj, hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh is destroyed using }(hj hhhNhNubj)}(h``RTM_DELLINK``h]h RTM_DELLINK}(hj> hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh, DSA migrates the user ports that were assigned to this interface to the first physical DSA conduit which is eligible, based on the firmware description (it effectively reverts to the startup configuration).}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hXHIn a setup with more than 2 physical CPU ports, it is therefore possible to mix static user to CPU port assignment with LAG between DSA conduits. It is not possible to statically assign a user port towards a DSA conduit that has any upper interfaces (this includes LAG devices - the conduit must always be the LAG in this case).h]hXHIn a setup with more than 2 physical CPU ports, it is therefore possible to mix static user to CPU port assignment with LAG between DSA conduits. It is not possible to statically assign a user port towards a DSA conduit that has any upper interfaces (this includes LAG devices - the conduit must always be the LAG in this case).}(hjV hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hLive changing of the DSA conduit (and thus CPU port) affinity of a user port is permitted, in order to allow dynamic redistribution in response to traffic.h]hLive changing of the DSA conduit (and thus CPU port) affinity of a user port is permitted, in order to allow dynamic redistribution in response to traffic.}(hjd hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hPhysical DSA conduits are allowed to join and leave at any time a LAG interface used as a DSA conduit; however, DSA will reject a LAG interface as a valid candidate for being a DSA conduit unless it has at least one physical DSA conduit as a slave device.h]hPhysical DSA conduits are allowed to join and leave at any time a LAG interface used as a DSA conduit; however, DSA will reject a LAG interface as a valid candidate for being a DSA conduit unless it has at least one physical DSA conduit as a slave device.}(hjr hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubeh}(h]#affinity-of-user-ports-to-cpu-portsah ]h"]#affinity of user ports to cpu portsah$]h&]uh1hhhhhhhhMpubeh}(h]'dsa-switch-configuration-from-userspaceah ]h"]'dsa switch configuration from userspaceah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerj error_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}(h]haj]jaj]jaunameids}(j j jhjjjjjjjjjjjjj j u nametypes}(j jjjjjjjj uh}(j hhhjhjjjjjjjjjjj ju footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages](hsystem_message)}(hhh]h)}(hhh]h:Hyperlink target "dsa-config-showcases" is not referenced.}hj sbah}(h]h ]h"]h$]h&]uh1hhj ubah}(h]h ]h"]h$]h&]levelKtypeINFOsourcehlineK uh1j ubj )}(hhh]h)}(hhh]h>Hyperlink target "dsa-tagged-configuration" is not referenced.}hj: sbah}(h]h ]h"]h$]h&]uh1hhj7 ubah}(h]h ]h"]h$]h&]levelKtypej4 sourcehlineKRuh1j ubj )}(hhh]h)}(hhh]h