Back to home page

OSCL-LXR

 
 

    


0001 .. SPDX-License-Identifier: GPL-2.0
0002 
0003 ==========================================
0004 Broadcom RoboSwitch Ethernet switch driver
0005 ==========================================
0006 
0007 The Broadcom RoboSwitch Ethernet switch family is used in quite a range of
0008 xDSL router, cable modems and other multimedia devices.
0009 
0010 The actual implementation supports the devices BCM5325E, BCM5365, BCM539x,
0011 BCM53115 and BCM53125 as well as BCM63XX.
0012 
0013 Implementation details
0014 ======================
0015 
0016 The driver is located in ``drivers/net/dsa/b53/`` and is implemented as a
0017 DSA driver; see ``Documentation/networking/dsa/dsa.rst`` for details on the
0018 subsystem and what it provides.
0019 
0020 The switch is, if possible, configured to enable a Broadcom specific 4-bytes
0021 switch tag which gets inserted by the switch for every packet forwarded to the
0022 CPU interface, conversely, the CPU network interface should insert a similar
0023 tag for packets entering the CPU port. The tag format is described in
0024 ``net/dsa/tag_brcm.c``.
0025 
0026 The configuration of the device depends on whether or not tagging is
0027 supported.
0028 
0029 The interface names and example network configuration are used according the
0030 configuration described in the :ref:`dsa-config-showcases`.
0031 
0032 Configuration with tagging support
0033 ----------------------------------
0034 
0035 The tagging based configuration is desired. It is not specific to the b53
0036 DSA driver and will work like all DSA drivers which supports tagging.
0037 
0038 See :ref:`dsa-tagged-configuration`.
0039 
0040 Configuration without tagging support
0041 -------------------------------------
0042 
0043 Older models (5325, 5365) support a different tag format that is not supported
0044 yet. 539x and 531x5 require managed mode and some special handling, which is
0045 also not yet supported. The tagging support is disabled in these cases and the
0046 switch need a different configuration.
0047 
0048 The configuration slightly differ from the :ref:`dsa-vlan-configuration`.
0049 
0050 The b53 tags the CPU port in all VLANs, since otherwise any PVID untagged
0051 VLAN programming would basically change the CPU port's default PVID and make
0052 it untagged, undesirable.
0053 
0054 In difference to the configuration described in :ref:`dsa-vlan-configuration`
0055 the default VLAN 1 has to be removed from the slave interface configuration in
0056 single port and gateway configuration, while there is no need to add an extra
0057 VLAN configuration in the bridge showcase.
0058 
0059 single port
0060 ~~~~~~~~~~~
0061 The configuration can only be set up via VLAN tagging and bridge setup.
0062 By default packages are tagged with vid 1:
0063 
0064 .. code-block:: sh
0065 
0066   # tag traffic on CPU port
0067   ip link add link eth0 name eth0.1 type vlan id 1
0068   ip link add link eth0 name eth0.2 type vlan id 2
0069   ip link add link eth0 name eth0.3 type vlan id 3
0070 
0071   # The master interface needs to be brought up before the slave ports.
0072   ip link set eth0 up
0073   ip link set eth0.1 up
0074   ip link set eth0.2 up
0075   ip link set eth0.3 up
0076 
0077   # bring up the slave interfaces
0078   ip link set wan up
0079   ip link set lan1 up
0080   ip link set lan2 up
0081 
0082   # create bridge
0083   ip link add name br0 type bridge
0084 
0085   # activate VLAN filtering
0086   ip link set dev br0 type bridge vlan_filtering 1
0087 
0088   # add ports to bridges
0089   ip link set dev wan master br0
0090   ip link set dev lan1 master br0
0091   ip link set dev lan2 master br0
0092 
0093   # tag traffic on ports
0094   bridge vlan add dev lan1 vid 2 pvid untagged
0095   bridge vlan del dev lan1 vid 1
0096   bridge vlan add dev lan2 vid 3 pvid untagged
0097   bridge vlan del dev lan2 vid 1
0098 
0099   # configure the VLANs
0100   ip addr add 192.0.2.1/30 dev eth0.1
0101   ip addr add 192.0.2.5/30 dev eth0.2
0102   ip addr add 192.0.2.9/30 dev eth0.3
0103 
0104   # bring up the bridge devices
0105   ip link set br0 up
0106 
0107 
0108 bridge
0109 ~~~~~~
0110 
0111 .. code-block:: sh
0112 
0113   # tag traffic on CPU port
0114   ip link add link eth0 name eth0.1 type vlan id 1
0115 
0116   # The master interface needs to be brought up before the slave ports.
0117   ip link set eth0 up
0118   ip link set eth0.1 up
0119 
0120   # bring up the slave interfaces
0121   ip link set wan up
0122   ip link set lan1 up
0123   ip link set lan2 up
0124 
0125   # create bridge
0126   ip link add name br0 type bridge
0127 
0128   # activate VLAN filtering
0129   ip link set dev br0 type bridge vlan_filtering 1
0130 
0131   # add ports to bridge
0132   ip link set dev wan master br0
0133   ip link set dev lan1 master br0
0134   ip link set dev lan2 master br0
0135   ip link set eth0.1 master br0
0136 
0137   # configure the bridge
0138   ip addr add 192.0.2.129/25 dev br0
0139 
0140   # bring up the bridge
0141   ip link set dev br0 up
0142 
0143 gateway
0144 ~~~~~~~
0145 
0146 .. code-block:: sh
0147 
0148   # tag traffic on CPU port
0149   ip link add link eth0 name eth0.1 type vlan id 1
0150   ip link add link eth0 name eth0.2 type vlan id 2
0151 
0152   # The master interface needs to be brought up before the slave ports.
0153   ip link set eth0 up
0154   ip link set eth0.1 up
0155   ip link set eth0.2 up
0156 
0157   # bring up the slave interfaces
0158   ip link set wan up
0159   ip link set lan1 up
0160   ip link set lan2 up
0161 
0162   # create bridge
0163   ip link add name br0 type bridge
0164 
0165   # activate VLAN filtering
0166   ip link set dev br0 type bridge vlan_filtering 1
0167 
0168   # add ports to bridges
0169   ip link set dev wan master br0
0170   ip link set eth0.1 master br0
0171   ip link set dev lan1 master br0
0172   ip link set dev lan2 master br0
0173 
0174   # tag traffic on ports
0175   bridge vlan add dev wan vid 2 pvid untagged
0176   bridge vlan del dev wan vid 1
0177 
0178   # configure the VLANs
0179   ip addr add 192.0.2.1/30 dev eth0.2
0180   ip addr add 192.0.2.129/25 dev br0
0181 
0182   # bring up the bridge devices
0183   ip link set br0 up