요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. 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.
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`.
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`.
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.
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
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
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
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
요약·해설
b53.rst:1-183b53 드라이버는 가능한 모델에서는 Broadcom 4바이트 태그를 사용합니다. 태그를 지원하지 않는 모델에서는 CPU 포트를 모든 VLAN에서 항상 태그 상태로 유지하고, 사용자 포트의 기본 VLAN 1을 명시적으로 제거해야 하는 차이가 있습니다.
같은 포트 집합을 목적에 따라 세 가지 방식으로 배치합니다.