← Documents Documentation/networking/dsa/b53.rst GitHub 원문 ↗

Linux 6.18.37 · Networking

Broadcom RoboSwitch Ethernet switch driver

Broadcom b53 DSA 스위치의 태그 지원 여부에 따른 CPU 포트와 VLAN·브리지 구성을 설명합니다.

Source pathDocumentation/networking/dsa/b53.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

b53.rst:1-183

b53 드라이버는 가능한 모델에서는 Broadcom 4바이트 태그를 사용합니다. 태그를 지원하지 않는 모델에서는 CPU 포트를 모든 VLAN에서 항상 태그 상태로 유지하고, 사용자 포트의 기본 VLAN 1을 명시적으로 제거해야 하는 차이가 있습니다.

b53 구성 예제 비교
구성CPU VLAN주소 위치VLAN 1 처리
단일 포트eth0.1·eth0.2·eth0.3각 CPU VLAN 인터페이스lan1·lan2에서 제거
브리지eth0.1br0추가 VLAN 구성 불필요
게이트웨이eth0.1·eth0.2WAN은 eth0.2, LAN은 br0wan에서 제거

같은 포트 집합을 목적에 따라 세 가지 방식으로 배치합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

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

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

Broadcom RoboSwitch 지원 범위

1-12

이 문서는 `GPL-2.0` 라이선스를 따릅니다.

Broadcom RoboSwitch 이더넷 스위치 드라이버

Broadcom RoboSwitch 이더넷 스위치 계열은 다양한 xDSL 라우터, 케이블 모뎀 및 기타 멀티미디어 장치에 사용됩니다.

현재 구현은 BCM5325E, BCM5365, BCM539x, BCM53115, BCM53125 및 BCM63XX 장치를 지원합니다.

.. SPDX-License-Identifier: GPL-2.0

==========================================
Broadcom RoboSwitch Ethernet switch driver
==========================================

The Broadcom RoboSwitch Ethernet switch family is used in quite a range of
xDSL router, cable modems and other multimedia devices.

The actual implementation supports the devices BCM5325E, BCM5365, BCM539x,
BCM53115 and BCM53125 as well as BCM63XX.

DSA 구현과 Broadcom 스위치 태그

13-31

구현 세부 사항

드라이버는 `drivers/net/dsa/b53/`에 있으며 DSA 드라이버로 구현되어 있습니다. 하위 시스템과 제공 기능은 `Documentation/networking/dsa/dsa.rst`를 참고하십시오.

가능한 경우 스위치는 Broadcom 전용 4바이트 스위치 태그를 사용하도록 구성됩니다. 스위치는 CPU 인터페이스로 전달하는 모든 패킷에 이 태그를 삽입하고, 반대로 CPU 네트워크 인터페이스도 CPU 포트로 들어가는 패킷에 같은 형식의 태그를 삽입해야 합니다. 태그 형식은 `net/dsa/tag_brcm.c`에 정의되어 있습니다.

장치 구성 방식은 태깅 지원 여부에 따라 달라집니다.

인터페이스 이름과 네트워크 구성 예제는 `dsa-config-showcases`에서 설명한 구성을 따릅니다.

Implementation details
======================

The driver is located in ``drivers/net/dsa/b53/`` and is implemented as a
DSA driver; see ``Documentation/networking/dsa/dsa.rst`` for details on the
subsystem and what it provides.

The switch is, if possible, configured to enable a Broadcom specific 4-bytes
switch tag which gets inserted by the switch for every packet forwarded to the
CPU interface, conversely, the CPU network interface should insert a similar
tag for packets entering the CPU port. The tag format is described in
``net/dsa/tag_brcm.c``.

The configuration of the device depends on whether or not tagging is
supported.

The interface names and example network configuration are used according the
configuration described in the :ref:`dsa-config-showcases`.

태깅을 지원하는 권장 구성

32-39

태깅 지원 구성

태그 기반 구성이 권장됩니다. 이 방식은 b53 DSA 드라이버에만 해당하지 않으며 태깅을 지원하는 모든 DSA 드라이버와 같은 방식으로 동작합니다.

자세한 구성은 `dsa-tagged-configuration`을 참고하십시오.

Configuration with tagging support
----------------------------------

The tagging based configuration is desired. It is not specific to the b53
DSA driver and will work like all DSA drivers which supports tagging.

See :ref:`dsa-tagged-configuration`.

태깅 미지원 모델의 VLAN 차이

40-58

태깅을 지원하지 않는 구성

구형 모델 5325와 5365는 아직 지원되지 않는 별도 태그 형식을 사용합니다. 539x와 531x5는 관리 모드와 특수 처리가 필요하지만 이 역시 아직 지원되지 않습니다. 이런 경우 태깅 지원을 끄고 스위치를 다른 방식으로 구성해야 합니다.

구성은 `dsa-vlan-configuration`과 약간 다릅니다.

b53은 모든 VLAN에서 CPU 포트를 태그 처리합니다. 그렇지 않으면 PVID 비태그 VLAN을 프로그램할 때 CPU 포트의 기본 PVID가 바뀌고 포트가 비태그 상태가 되므로 바람직하지 않습니다.

`dsa-vlan-configuration`의 구성과 달리 단일 포트 및 게이트웨이 구성에서는 사용자 인터페이스에서 기본 VLAN 1을 제거해야 합니다. 브리지 예제에서는 별도 VLAN 구성을 추가할 필요가 없습니다.

Configuration without tagging support
-------------------------------------

Older models (5325, 5365) support a different tag format that is not supported
yet. 539x and 531x5 require managed mode and some special handling, which is
also not yet supported. The tagging support is disabled in these cases and the
switch need a different configuration.

The configuration slightly differ from the :ref:`dsa-vlan-configuration`.

The b53 tags the CPU port in all VLANs, since otherwise any PVID untagged
VLAN programming would basically change the CPU port's default PVID and make
it untagged, undesirable.

In difference to the configuration described in :ref:`dsa-vlan-configuration`
the default VLAN 1 has to be removed from the user interface configuration in
single port and gateway configuration, while there is no need to add an extra
VLAN configuration in the bridge showcase.

단일 포트 VLAN 구성

59-107

단일 포트

이 구성은 VLAN 태깅과 브리지 설정을 통해서만 만들 수 있습니다. 기본적으로 패킷은 VID 1로 태그됩니다.

CPU 포트에 VLAN 1·2·3 서브인터페이스를 만들고, 사용자 포트보다 먼저 conduit 인터페이스와 VLAN 인터페이스를 올립니다. 이어 `wan`, `lan1`, `lan2`를 브리지에 넣고 VLAN 필터링을 켭니다.

`lan1`은 PVID 2, `lan2`는 PVID 3의 비태그 포트로 만들고 두 포트에서 기본 VLAN 1을 제거합니다. 각 CPU VLAN 인터페이스에 별도 /30 주소를 설정한 뒤 브리지를 올립니다.

# 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

# The conduit interface needs to be brought up 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 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 dev lan1 master br0
ip link set dev lan2 master br0

# tag traffic on ports
bridge vlan add dev lan1 vid 2 pvid untagged
bridge vlan del dev lan1 vid 1
bridge vlan add dev lan2 vid 3 pvid untagged
bridge vlan del dev lan2 vid 1

# 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
single port
~~~~~~~~~~~
The configuration can only be set up via VLAN tagging and bridge setup.
By default packages are tagged with vid 1:

.. 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

  # The conduit interface needs to be brought up 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 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 dev lan1 master br0
  ip link set dev lan2 master br0

  # tag traffic on ports
  bridge vlan add dev lan1 vid 2 pvid untagged
  bridge vlan del dev lan1 vid 1
  bridge vlan add dev lan2 vid 3 pvid untagged
  bridge vlan del dev lan2 vid 1

  # 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

모든 포트를 묶는 브리지 구성

108-142

브리지

CPU 포트에 VLAN 1 서브인터페이스를 만든 뒤 `eth0`과 `eth0.1`, 사용자 포트를 차례로 올립니다. VLAN 필터링을 활성화한 `br0`에 `wan`, `lan1`, `lan2`, `eth0.1`을 모두 연결하고 브리지 자체에 `192.0.2.129/25`를 할당합니다.

# tag traffic on CPU port
ip link add link eth0 name eth0.1 type vlan id 1

# The conduit interface needs to be brought up before the user ports.
ip link set eth0 up
ip link set eth0.1 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 bridge
ip link set dev wan master br0
ip link set dev lan1 master br0
ip link set dev lan2 master br0
ip link set eth0.1 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
bridge
~~~~~~

.. code-block:: sh

  # tag traffic on CPU port
  ip link add link eth0 name eth0.1 type vlan id 1

  # The conduit interface needs to be brought up before the user ports.
  ip link set eth0 up
  ip link set eth0.1 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 bridge
  ip link set dev wan master br0
  ip link set dev lan1 master br0
  ip link set dev lan2 master br0
  ip link set eth0.1 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

WAN을 분리하는 게이트웨이 구성

143-183

게이트웨이

CPU 포트에 VLAN 1과 2 서브인터페이스를 만들고, `wan`과 `eth0.1`, 두 LAN 포트를 브리지에 넣습니다. `wan`은 PVID 2의 비태그 포트로 바꾸고 기본 VLAN 1을 제거합니다.

분리된 WAN용 `eth0.2`에는 `192.0.2.1/30`, LAN 브리지 `br0`에는 `192.0.2.129/25`를 설정한 다음 브리지를 올립니다.

# 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

# The conduit interface needs to be brought up 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 wan vid 2 pvid untagged
bridge vlan del dev wan vid 1

# 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
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

  # The conduit interface needs to be brought up 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 wan vid 2 pvid untagged
  bridge vlan del dev wan vid 1

  # 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