b53.rst 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. .. SPDX-License-Identifier: GPL-2.0
  2. ==========================================
  3. Broadcom RoboSwitch Ethernet switch driver
  4. ==========================================
  5. The Broadcom RoboSwitch Ethernet switch family is used in quite a range of
  6. xDSL router, cable modems and other multimedia devices.
  7. The actual implementation supports the devices BCM5325E, BCM5365, BCM539x,
  8. BCM53115 and BCM53125 as well as BCM63XX.
  9. Implementation details
  10. ======================
  11. The driver is located in ``drivers/net/dsa/b53/`` and is implemented as a
  12. DSA driver; see ``Documentation/networking/dsa/dsa.rst`` for details on the
  13. subsystem and what it provides.
  14. The switch is, if possible, configured to enable a Broadcom specific 4-bytes
  15. switch tag which gets inserted by the switch for every packet forwarded to the
  16. CPU interface, conversely, the CPU network interface should insert a similar
  17. tag for packets entering the CPU port. The tag format is described in
  18. ``net/dsa/tag_brcm.c``.
  19. The configuration of the device depends on whether or not tagging is
  20. supported.
  21. The interface names and example network configuration are used according the
  22. configuration described in the :ref:`dsa-config-showcases`.
  23. Configuration with tagging support
  24. ----------------------------------
  25. The tagging based configuration is desired. It is not specific to the b53
  26. DSA driver and will work like all DSA drivers which supports tagging.
  27. See :ref:`dsa-tagged-configuration`.
  28. Configuration without tagging support
  29. -------------------------------------
  30. Older models (5325, 5365) support a different tag format that is not supported
  31. yet. 539x and 531x5 require managed mode and some special handling, which is
  32. also not yet supported. The tagging support is disabled in these cases and the
  33. switch need a different configuration.
  34. The configuration slightly differ from the :ref:`dsa-vlan-configuration`.
  35. The b53 tags the CPU port in all VLANs, since otherwise any PVID untagged
  36. VLAN programming would basically change the CPU port's default PVID and make
  37. it untagged, undesirable.
  38. In difference to the configuration described in :ref:`dsa-vlan-configuration`
  39. the default VLAN 1 has to be removed from the slave interface configuration in
  40. single port and gateway configuration, while there is no need to add an extra
  41. VLAN configuration in the bridge showcase.
  42. single port
  43. ~~~~~~~~~~~
  44. The configuration can only be set up via VLAN tagging and bridge setup.
  45. By default packages are tagged with vid 1:
  46. .. code-block:: sh
  47. # tag traffic on CPU port
  48. ip link add link eth0 name eth0.1 type vlan id 1
  49. ip link add link eth0 name eth0.2 type vlan id 2
  50. ip link add link eth0 name eth0.3 type vlan id 3
  51. # The master interface needs to be brought up before the slave ports.
  52. ip link set eth0 up
  53. ip link set eth0.1 up
  54. ip link set eth0.2 up
  55. ip link set eth0.3 up
  56. # bring up the slave interfaces
  57. ip link set wan up
  58. ip link set lan1 up
  59. ip link set lan2 up
  60. # create bridge
  61. ip link add name br0 type bridge
  62. # activate VLAN filtering
  63. ip link set dev br0 type bridge vlan_filtering 1
  64. # add ports to bridges
  65. ip link set dev wan master br0
  66. ip link set dev lan1 master br0
  67. ip link set dev lan2 master br0
  68. # tag traffic on ports
  69. bridge vlan add dev lan1 vid 2 pvid untagged
  70. bridge vlan del dev lan1 vid 1
  71. bridge vlan add dev lan2 vid 3 pvid untagged
  72. bridge vlan del dev lan2 vid 1
  73. # configure the VLANs
  74. ip addr add 192.0.2.1/30 dev eth0.1
  75. ip addr add 192.0.2.5/30 dev eth0.2
  76. ip addr add 192.0.2.9/30 dev eth0.3
  77. # bring up the bridge devices
  78. ip link set br0 up
  79. bridge
  80. ~~~~~~
  81. .. code-block:: sh
  82. # tag traffic on CPU port
  83. ip link add link eth0 name eth0.1 type vlan id 1
  84. # The master interface needs to be brought up before the slave ports.
  85. ip link set eth0 up
  86. ip link set eth0.1 up
  87. # bring up the slave interfaces
  88. ip link set wan up
  89. ip link set lan1 up
  90. ip link set lan2 up
  91. # create bridge
  92. ip link add name br0 type bridge
  93. # activate VLAN filtering
  94. ip link set dev br0 type bridge vlan_filtering 1
  95. # add ports to bridge
  96. ip link set dev wan master br0
  97. ip link set dev lan1 master br0
  98. ip link set dev lan2 master br0
  99. ip link set eth0.1 master br0
  100. # configure the bridge
  101. ip addr add 192.0.2.129/25 dev br0
  102. # bring up the bridge
  103. ip link set dev br0 up
  104. gateway
  105. ~~~~~~~
  106. .. code-block:: sh
  107. # tag traffic on CPU port
  108. ip link add link eth0 name eth0.1 type vlan id 1
  109. ip link add link eth0 name eth0.2 type vlan id 2
  110. # The master interface needs to be brought up before the slave ports.
  111. ip link set eth0 up
  112. ip link set eth0.1 up
  113. ip link set eth0.2 up
  114. # bring up the slave interfaces
  115. ip link set wan up
  116. ip link set lan1 up
  117. ip link set lan2 up
  118. # create bridge
  119. ip link add name br0 type bridge
  120. # activate VLAN filtering
  121. ip link set dev br0 type bridge vlan_filtering 1
  122. # add ports to bridges
  123. ip link set dev wan master br0
  124. ip link set eth0.1 master br0
  125. ip link set dev lan1 master br0
  126. ip link set dev lan2 master br0
  127. # tag traffic on ports
  128. bridge vlan add dev wan vid 2 pvid untagged
  129. bridge vlan del dev wan vid 1
  130. # configure the VLANs
  131. ip addr add 192.0.2.1/30 dev eth0.2
  132. ip addr add 192.0.2.129/25 dev br0
  133. # bring up the bridge devices
  134. ip link set br0 up