요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0
=================
Devlink Line card
=================
Background
==========
The ``devlink-linecard`` mechanism is targeted for manipulation of
line cards that serve as a detachable PHY modules for modular switch
system. Following operations are provided:
* Get a list of supported line card types.
* Provision of a slot with specific line card type.
* Get and monitor of line card state and its change.
Line card according to the type may contain one or more gearboxes
to mux the lanes with certain speed to multiple ports with lanes
of different speed. Line card ensures N:M mapping between
the switch ASIC modules and physical front panel ports.
Overview
========
Each line card devlink object is created by device driver,
according to the physical line card slots available on the device.
Similar to splitter cable, where the device might have no way
of detection of the splitter cable geometry, the device
might not have a way to detect line card type. For that devices,
concept of provisioning is introduced. It allows the user to:
* Provision a line card slot with certain line card type
- Device driver would instruct the ASIC to prepare all
resources accordingly. The device driver would
create all instances, namely devlink port and netdevices
that reside on the line card, according to the line card type
* Manipulate of line card entities even without line card
being physically connected or powered-up
* Setup splitter cable on line card ports
- As on the ordinary ports, user may provision a splitter
cable of a certain type, without the need to
be physically connected to the port
* Configure devlink ports and netdevices
Netdevice carrier is decided as follows:
* Line card is not inserted or powered-down
- The carrier is always down
* Line card is inserted and powered up
- The carrier is decided as for ordinary port netdevice
Line card state
===============
The ``devlink-linecard`` mechanism supports the following line card states:
* ``unprovisioned``: Line card is not provisioned on the slot.
* ``unprovisioning``: Line card slot is currently being unprovisioned.
* ``provisioning``: Line card slot is currently in a process of being provisioned
with a line card type.
* ``provisioning_failed``: Provisioning was not successful.
* ``provisioned``: Line card slot is provisioned with a type.
* ``active``: Line card is powered-up and active.
The following diagram provides a general overview of ``devlink-linecard``
state transitions::
+-------------------------+
| |
+----------------------------------> unprovisioned |
| | |
| +--------|-------^--------+
| | |
| | |
| +--------v-------|--------+
| | |
| | provisioning |
| | |
| +------------|------------+
| |
| +-----------------------------+
| | |
| +------------v------------+ +------------v------------+ +-------------------------+
| | | | ----> |
+----- provisioning_failed | | provisioned | | active |
| | | | <---- |
| +------------^------------+ +------------|------------+ +-------------------------+
| | |
| | |
| | +------------v------------+
| | | |
| | | unprovisioning |
| | | |
| | +------------|------------+
| | |
| +-----------------------------+
| |
+-----------------------------------------------+
Example usage
=============
.. code:: shell
$ devlink lc show [ DEV [ lc LC_INDEX ] ]
$ devlink lc set DEV lc LC_INDEX [ { type LC_TYPE | notype } ]
# Show current line card configuration and status for all slots:
$ devlink lc
# Set slot 8 to be provisioned with type "16x100G":
$ devlink lc set pci/0000:01:00.0 lc 8 type 16x100G
# Set slot 8 to be unprovisioned:
$ devlink lc set pci/0000:01:00.0 lc 8 notype
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
Devlink Line card 배경
1-22이 문서는 `GPL-2.0` 라이선스를 따릅니다.
Devlink Line card
배경
`devlink-linecard` mechanism은 modular switch system에서 분리 가능한 PHY module 역할을 하는 line card를 다루기 위한 것입니다.
다음 operation을 제공합니다.
- 지원하는 line card type 목록 조회
- 특정 line card type으로 slot provisioning
- line card state와 그 변화의 조회·monitoring
line card는 type에 따라 하나 이상의 gearbox를 포함할 수 있습니다. gearbox는 특정 속도의 lane을 서로 다른 속도의 lane을 가진 여러 port로 multiplexing합니다.
line card는 switch ASIC module과 물리 front panel port 사이의 N:M mapping을 보장합니다.
.. SPDX-License-Identifier: GPL-2.0
=================
Devlink Line card
=================
Background
==========
The ``devlink-linecard`` mechanism is targeted for manipulation of
line cards that serve as a detachable PHY modules for modular switch
system. Following operations are provided:
* Get a list of supported line card types.
* Provision of a slot with specific line card type.
* Get and monitor of line card state and its change.
Line card according to the type may contain one or more gearboxes
to mux the lanes with certain speed to multiple ports with lanes
of different speed. Line card ensures N:M mapping between
the switch ASIC modules and physical front panel ports.
Line card provisioning 개요
23-57개요
각 line card devlink object는 장치에서 사용할 수 있는 물리 line card slot에 맞춰 device driver가 만듭니다.
장치가 splitter cable geometry를 감지하지 못할 수 있는 것처럼 line card type도 감지하지 못할 수 있습니다. 이런 장치를 위해 provisioning 개념을 도입합니다.
provisioning을 사용하면 다음 작업을 할 수 있습니다.
- 특정 line card type으로 slot을 provisioning합니다. driver는 ASIC에 필요한 resource를 준비하도록 지시하고, 해당 type에 맞춰 line card의 devlink port와 netdevice instance를 모두 만듭니다.
- line card가 물리적으로 연결되지 않았거나 전원이 켜지지 않은 상태에서도 line card entity를 조작합니다.
- line card port에 splitter cable을 설정합니다. 일반 port와 마찬가지로 cable이 실제로 연결되지 않았어도 특정 type으로 provisioning할 수 있습니다.
- devlink port와 netdevice를 구성합니다.
netdevice carrier는 다음과 같이 결정합니다.
line card의 장착·전원 상태에 따라 netdevice carrier 규칙이 달라집니다.
Overview
========
Each line card devlink object is created by device driver,
according to the physical line card slots available on the device.
Similar to splitter cable, where the device might have no way
of detection of the splitter cable geometry, the device
might not have a way to detect line card type. For that devices,
concept of provisioning is introduced. It allows the user to:
* Provision a line card slot with certain line card type
- Device driver would instruct the ASIC to prepare all
resources accordingly. The device driver would
create all instances, namely devlink port and netdevices
that reside on the line card, according to the line card type
* Manipulate of line card entities even without line card
being physically connected or powered-up
* Setup splitter cable on line card ports
- As on the ordinary ports, user may provision a splitter
cable of a certain type, without the need to
be physically connected to the port
* Configure devlink ports and netdevices
Netdevice carrier is decided as follows:
* Line card is not inserted or powered-down
- The carrier is always down
* Line card is inserted and powered up
- The carrier is decided as for ordinary port netdevice
Line card state와 전이
58-106Line card state
`devlink-linecard`는 다음 line card state를 지원합니다.
slot의 type 준비 단계와 실제 전원·활성 상태를 나타냅니다.
일반적인 상태 전이는 다음과 같습니다. provisioning에 성공하면 `provisioned`, 실패하면 `provisioning_failed`가 됩니다. provisioning된 card는 전원 상태에 따라 `active`와 오갈 수 있습니다. 해제를 시작하면 `unprovisioning`으로 이동하고 성공하면 `unprovisioned`로 돌아갑니다.
type 설정부터 card 활성화와 provisioning 해제까지의 정상 경로입니다.
provision 또는 unprovision 과정이 실패하면 실패 상태를 거쳐 다시 준비되지 않은 상태로 복구할 수 있습니다.
Line card state
===============
The ``devlink-linecard`` mechanism supports the following line card states:
* ``unprovisioned``: Line card is not provisioned on the slot.
* ``unprovisioning``: Line card slot is currently being unprovisioned.
* ``provisioning``: Line card slot is currently in a process of being provisioned
with a line card type.
* ``provisioning_failed``: Provisioning was not successful.
* ``provisioned``: Line card slot is provisioned with a type.
* ``active``: Line card is powered-up and active.
The following diagram provides a general overview of ``devlink-linecard``
state transitions::
+-------------------------+
| |
+----------------------------------> unprovisioned |
| | |
| +--------|-------^--------+
| | |
| | |
| +--------v-------|--------+
| | |
| | provisioning |
| | |
| +------------|------------+
| |
| +-----------------------------+
| | |
| +------------v------------+ +------------v------------+ +-------------------------+
| | | | ----> |
+----- provisioning_failed | | provisioned | | active |
| | | | <---- |
| +------------^------------+ +------------|------------+ +-------------------------+
| | |
| | |
| | +------------v------------+
| | | |
| | | unprovisioning |
| | | |
| | +------------|------------+
| | |
| +-----------------------------+
| |
+-----------------------------------------------+
Line card 사용 예
107-122사용 예
`devlink lc show`는 line card를 표시하고, `devlink lc set`은 slot에 type을 지정하거나 `notype`으로 provisioning을 해제합니다.
$ devlink lc show [ DEV [ lc LC_INDEX ] ]
$ devlink lc set DEV lc LC_INDEX [ { type LC_TYPE | notype } ]
# Show current line card configuration and status for all slots:
$ devlink lc
# Set slot 8 to be provisioned with type "16x100G":
$ devlink lc set pci/0000:01:00.0 lc 8 type 16x100G
# Set slot 8 to be unprovisioned:
$ devlink lc set pci/0000:01:00.0 lc 8 notype
Example usage
=============
.. code:: shell
$ devlink lc show [ DEV [ lc LC_INDEX ] ]
$ devlink lc set DEV lc LC_INDEX [ { type LC_TYPE | notype } ]
# Show current line card configuration and status for all slots:
$ devlink lc
# Set slot 8 to be provisioned with type "16x100G":
$ devlink lc set pci/0000:01:00.0 lc 8 type 16x100G
# Set slot 8 to be unprovisioned:
$ devlink lc set pci/0000:01:00.0 lc 8 notype
요약·해설
devlink-linecard.rst:1-122line card provisioning은 card가 실제로 장착되기 전에도 type에 맞는 ASIC resource, devlink port, netdevice와 splitter 구성을 준비하게 합니다. state machine은 준비 여부와 물리적인 전원·활성 상태를 분리하며, card가 없거나 꺼져 있으면 carrier는 항상 down입니다.
논리 provisioning과 물리 card 활성화는 별도 단계입니다.