Documentation/driver-api/interconnect.rst GitHub 원문 ↗

Linux 6.18.37 · Driver API

Generic System Interconnect Subsystem

SoC NoC provider·node·endpoint·path·consumer model과 debugfs bandwidth inspection·test interface를 설명합니다.

Source pathDocumentation/driver-api/interconnect.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약과 해설

interconnect.rst:1-140

Generic interconnect framework는 여러 provider와 node로 이루어진 SoC data path를 표현하고 consumer의 bandwidth·latency·priority request를 hardware 설정으로 집계합니다. Debugfs graph와 test-client는 강력하지만 stable ABI가 아니며 test write 기능은 안전상 기본 비활성입니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2
3 =====================================
4 Generic System Interconnect Subsystem
5 =====================================
6
7 Introduction
8 ------------
9
10 This framework is designed to provide a standard kernel interface to control
11 the settings of the interconnects on an SoC. These settings can be throughput,
12 latency and priority between multiple interconnected devices or functional
13 blocks. This can be controlled dynamically in order to save power or provide
14 maximum performance.
15
16 The interconnect bus is hardware with configurable parameters, which can be
17 set on a data path according to the requests received from various drivers.
18 An example of interconnect buses are the interconnects between various
19 components or functional blocks in chipsets. There can be multiple interconnects
20 on an SoC that can be multi-tiered.
21
22 Below is a simplified diagram of a real-world SoC interconnect bus topology.
23
24 ::
25
26 +----------------+ +----------------+
27 | HW Accelerator |--->| M NoC |<---------------+
28 +----------------+ +----------------+ |
29 | | +------------+
30 +-----+ +-------------+ V +------+ | |
31 | DDR | | +--------+ | PCIe | | |
32 +-----+ | | Slaves | +------+ | |
33 ^ ^ | +--------+ | | C NoC |
34 | | V V | |
35 +------------------+ +------------------------+ | | +-----+
36 | |-->| |-->| |-->| CPU |
37 | |-->| |<--| | +-----+
38 | Mem NoC | | S NoC | +------------+
39 | |<--| |---------+ |
40 | |<--| |<------+ | | +--------+
41 +------------------+ +------------------------+ | | +-->| Slaves |
42 ^ ^ ^ ^ ^ | | +--------+
43 | | | | | | V
44 +------+ | +-----+ +-----+ +---------+ +----------------+ +--------+
45 | CPUs | | | GPU | | DSP | | Masters |-->| P NoC |-->| Slaves |
46 +------+ | +-----+ +-----+ +---------+ +----------------+ +--------+
47 |
48 +-------+
49 | Modem |
50 +-------+
51
52 Terminology
53 -----------
54
55 Interconnect provider is the software definition of the interconnect hardware.
56 The interconnect providers on the above diagram are M NoC, S NoC, C NoC, P NoC
57 and Mem NoC.
58
59 Interconnect node is the software definition of the interconnect hardware
60 port. Each interconnect provider consists of multiple interconnect nodes,
61 which are connected to other SoC components including other interconnect
62 providers. The point on the diagram where the CPUs connect to the memory is
63 called an interconnect node, which belongs to the Mem NoC interconnect provider.
64
65 Interconnect endpoints are the first or the last element of the path. Every
66 endpoint is a node, but not every node is an endpoint.
67
68 Interconnect path is everything between two endpoints including all the nodes
69 that have to be traversed to reach from a source to destination node. It may
70 include multiple master-slave pairs across several interconnect providers.
71
72 Interconnect consumers are the entities which make use of the data paths exposed
73 by the providers. The consumers send requests to providers requesting various
74 throughput, latency and priority. Usually the consumers are device drivers, that
75 send request based on their needs. An example for a consumer is a video decoder
76 that supports various formats and image sizes.
77
78 Interconnect providers
79 ----------------------
80
81 Interconnect provider is an entity that implements methods to initialize and
82 configure interconnect bus hardware. The interconnect provider drivers should
83 be registered with the interconnect provider core.
84
85 .. kernel-doc:: include/linux/interconnect-provider.h
86
87 Interconnect consumers
88 ----------------------
89
90 Interconnect consumers are the clients which use the interconnect APIs to
91 get paths between endpoints and set their bandwidth/latency/QoS requirements
92 for these interconnect paths. These interfaces are not currently
93 documented.
94
95 Interconnect debugfs interfaces
96 -------------------------------
97
98 Like several other subsystems interconnect will create some files for debugging
99 and introspection. Files in debugfs are not considered ABI so application
100 software shouldn't rely on format details change between kernel versions.
101
102 ``/sys/kernel/debug/interconnect/interconnect_summary``:
103
104 Show all interconnect nodes in the system with their aggregated bandwidth
105 request. Indented under each node show bandwidth requests from each device.
106
107 ``/sys/kernel/debug/interconnect/interconnect_graph``:
108
109 Show the interconnect graph in the graphviz dot format. It shows all
110 interconnect nodes and links in the system and groups together nodes from the
111 same provider as subgraphs. The format is human-readable and can also be piped
112 through dot to generate diagrams in many graphical formats::
113
114 $ cat /sys/kernel/debug/interconnect/interconnect_graph | \
115 dot -Tsvg > interconnect_graph.svg
116
117 The ``test-client`` directory provides interfaces for issuing BW requests to
118 any arbitrary path. Note that for safety reasons, this feature is disabled by
119 default without a Kconfig to enable it. Enabling it requires code changes to
120 ``#define INTERCONNECT_ALLOW_WRITE_DEBUGFS``. Example usage::
121
122 cd /sys/kernel/debug/interconnect/test-client/
123
124 # Configure node endpoints for the path from CPU to DDR on
125 # qcom/sm8550.
126 echo chm_apps > src_node
127 echo ebi > dst_node
128
129 # Get path between src_node and dst_node. This is only
130 # necessary after updating the node endpoints.
131 echo 1 > get
132
133 # Set desired BW to 1GBps avg and 2GBps peak.
134 echo 1000000 > avg_bw
135 echo 2000000 > peak_bw
136
137 # Vote for avg_bw and peak_bw on the latest path from "get".
138 # Voting for multiple paths is possible by repeating this
139 # process for different nodes endpoints.
140 echo 1 > commit
141

3. 한국어 전문 번역

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

Generic System Interconnect

1-21

문서 제목은 `Generic System Interconnect Subsystem`입니다. Framework는 SoC interconnect 설정을 제어하는 standard kernel interface를 제공합니다. 설정에는 연결된 여러 device·functional block 사이 throughput, latency, priority가 포함되며 power 절감이나 maximum performance를 위해 동적으로 제어할 수 있습니다.

Interconnect bus는 configurable parameter를 가진 hardware입니다. 여러 driver가 보낸 request에 따라 data path의 parameter를 설정합니다. Chipset의 component·functional block 사이 interconnect가 한 예이며, SoC에는 multi-tier로 연결된 여러 interconnect가 있을 수 있습니다.

Interconnect dynamic control
Device driver workloadThroughput·latency·priority requestInterconnect core aggregationProvider가 path node 설정SoC interconnect hardware 조정Power 절감 또는 maximum performance

Consumer requirement가 hardware path 설정으로 집계되는 흐름입니다.

Interconnect 조정 항목
항목목적
Throughput필요 data bandwidth 확보
Latency응답 시간 requirement
Priority경합 traffic의 우선순위
Dynamic controlWorkload에 맞춰 power·performance 균형

Framework가 path별로 다루는 대표 requirement입니다.

SoC interconnect topology

22-51

원문의 simplified topology는 HW accelerator, CPU·GPU·DSP·modem·PCIe, DDR와 여러 slave가 M NoC, S NoC, C NoC, P NoC, Mem NoC를 통해 다단계로 연결되는 실제 SoC 구조를 나타냅니다. 원문 ASCII diagram을 그대로 보존하고 같은 연결을 표와 흐름으로 정리했습니다.

::

 +----------------+    +----------------+
 | HW Accelerator |--->|      M NoC     |<---------------+
 +----------------+    +----------------+                |
                         |      |                    +------------+
  +-----+  +-------------+      V       +------+     |            |
  | DDR |  |                +--------+  | PCIe |     |            |
  +-----+  |                | Slaves |  +------+     |            |
    ^ ^    |                +--------+     |         |   C NoC    |
    | |    V                               V         |            |
 +------------------+   +------------------------+   |            |   +-----+
 |                  |-->|                        |-->|            |-->| CPU |
 |                  |-->|                        |<--|            |   +-----+
 |     Mem NoC      |   |         S NoC          |   +------------+
 |                  |<--|                        |---------+    |
 |                  |<--|                        |<------+ |    |   +--------+
 +------------------+   +------------------------+       | |    +-->| Slaves |
   ^  ^    ^    ^          ^                             | |        +--------+
   |  |    |    |          |                             | V
 +------+  |  +-----+   +-----+  +---------+   +----------------+   +--------+
 | CPUs |  |  | GPU |   | DSP |  | Masters |-->|       P NoC    |-->| Slaves |
 +------+  |  +-----+   +-----+  +---------+   +----------------+   +--------+
           |
       +-------+
       | Modem |
       +-------+
SoC NoC provider와 endpoint
Provider연결 source·peer대표 destination
M NoCHW Accelerator, Mem NoCSlaves, S NoC
Mem NoCCPUs, GPU, Modem, S NoCDDR
S NoCDSP, Mem NoC, M NoC, C NoC, P NoCPCIe·여러 fabric
C NoCS NoC, M NoCCPU, Slaves
P NoCMasters, S NoCSlaves

원문 topology의 주요 provider·source·destination 관계입니다.

Multi-tier interconnect path 예
DSP source endpointS NoC nodeMem NoC nodeDDR destination endpoint각 provider가 같은 path의 bandwidth vote 적용

한 endpoint request가 여러 provider를 지나는 예입니다.

Interconnect terminology

52-77

Interconnect provider는 interconnect hardware의 software definition입니다. 위 topology의 M NoC, S NoC, C NoC, P NoC, Mem NoC가 provider입니다.

Interconnect node는 interconnect hardware port의 software definition입니다. Provider 하나는 여러 node로 이루어지고, node는 다른 provider를 포함한 SoC component에 연결됩니다. CPU가 memory에 연결되는 diagram 지점도 Mem NoC provider에 속한 interconnect node입니다.

Interconnect endpoint는 path의 첫 element 또는 마지막 element입니다. 모든 endpoint는 node지만 모든 node가 endpoint인 것은 아닙니다.

Interconnect path는 source node에서 destination node까지 도달할 때 거쳐야 하는 모든 node를 포함한 두 endpoint 사이 전체입니다. 여러 provider에 걸쳐 여러 master-slave pair를 포함할 수 있습니다.

Interconnect consumer는 provider가 노출한 data path를 사용하는 entity입니다. Consumer는 throughput, latency, priority request를 provider에 보냅니다. 보통 필요에 따라 request를 보내는 device driver이며, 다양한 format과 image size를 지원하는 video decoder가 한 예입니다.

Interconnect 용어
용어정의
ProviderInterconnect hardware의 software definition
NodeProvider 안 hardware port의 software definition
EndpointPath의 첫 또는 마지막 node
Path두 endpoint와 그 사이 모든 traversed node
ConsumerPath requirement를 요청하는 client, 보통 device driver

Provider·node·endpoint·path·consumer의 포함 관계입니다.

Consumer request와 path
Consumer가 source·destination endpoint 선택Interconnect path 획득여러 provider의 node traverseThroughput·latency·priority 요청Provider별 aggregateHardware port parameter 설정

Video decoder 같은 consumer가 endpoint path를 사용하는 흐름입니다.

Interconnect provider

78-86

Interconnect provider는 interconnect bus hardware를 initialize·configure하는 method를 구현하는 entity입니다. Provider driver는 interconnect provider core에 등록해야 합니다. Provider API kernel-doc source는 `include/linux/interconnect-provider.h`입니다.

.. kernel-doc:: include/linux/interconnect-provider.h
Provider registration
SoC interconnect hardwareProvider driver가 init·configure method 구현Interconnect provider core에 등록Node·link topology 노출Consumer request 적용

Hardware-specific driver와 generic core의 관계입니다.

Interconnect consumer

87-94

Interconnect consumer는 interconnect API를 사용해 endpoint 사이 path를 얻고 그 path에 bandwidth, latency, QoS requirement를 설정하는 client입니다. 이 interface는 현재 문서화되어 있지 않습니다.

Consumer API 목적
Endpoint 지정Interconnect path 획득Bandwidth 설정Latency 설정QoS requirement 설정

현재 미문서화된 interface가 수행하는 두 핵심 단계입니다.

Interconnect debugfs

95-116

Interconnect subsystem은 debugging과 introspection용 debugfs file을 만듭니다. Debugfs는 ABI가 아니므로 application software는 kernel version 사이 format detail에 의존해서는 안 됩니다.

`/sys/kernel/debug/interconnect/interconnect_summary`는 system의 모든 interconnect node와 aggregate bandwidth request를 보여 줍니다. 각 node 아래에는 device별 bandwidth request가 indent되어 표시됩니다.

`/sys/kernel/debug/interconnect/interconnect_graph`는 system의 모든 node와 link를 Graphviz dot format으로 보여 주고 같은 provider의 node를 subgraph로 묶습니다. Human-readable이며 `dot`에 pipe해 여러 graphic format의 diagram을 만들 수 있습니다.

$ cat /sys/kernel/debug/interconnect/interconnect_graph | \
        dot -Tsvg > interconnect_graph.svg
Interconnect debugfs file
File내용ABI
interconnect_summaryNode별 aggregate BW와 device request아님
interconnect_graphNode·link와 provider subgraph의 dot graph아님

Summary와 graph의 정보·안정성입니다.

Interconnect graph render
interconnect_graph readGraphviz dot textdot -Tsvginterconnect_graph.svgTopology inspection

Debugfs dot graph를 SVG로 변환합니다.

Debugfs test-client

117-140

`test-client` directory는 임의 path에 bandwidth request를 발행하는 interface를 제공합니다. 안전을 위해 enable하는 Kconfig 없이 default disabled이며, 사용하려면 `#define INTERCONNECT_ALLOW_WRITE_DEBUGFS`를 바꾸는 code change가 필요합니다.

예제는 qcom/sm8550에서 CPU에서 DDR로 가는 path의 `src_node=chm_apps`, `dst_node=ebi`를 설정합니다. Endpoint를 바꾼 뒤 `get`에 1을 써 path를 얻고, average 1 GBps에 해당하는 `avg_bw=1000000`, peak 2 GBps에 해당하는 `peak_bw=2000000`을 설정한 뒤 `commit`에 1을 써 vote합니다. 다른 endpoint로 과정을 반복하면 여러 path에 vote할 수 있습니다.

cd /sys/kernel/debug/interconnect/test-client/

# Configure node endpoints for the path from CPU to DDR on
# qcom/sm8550.
echo chm_apps > src_node
echo ebi > dst_node

# Get path between src_node and dst_node. This is only
# necessary after updating the node endpoints.
echo 1 > get

# Set desired BW to 1GBps avg and 2GBps peak.
echo 1000000 > avg_bw
echo 2000000 > peak_bw

# Vote for avg_bw and peak_bw on the latest path from "get".
# Voting for multiple paths is possible by repeating this
# process for different nodes endpoints.
echo 1 > commit
test-client control
FileExample value동작
src_nodechm_appsSource endpoint
dst_nodeebiDestination endpoint
get1Endpoint 변경 뒤 path 획득
avg_bw1000000Average 1 GBps
peak_bw2000000Peak 2 GBps
commit1최신 path에 bandwidth vote

CPU→DDR example의 debugfs file과 값입니다.

test-client bandwidth vote
Write src_nodeWrite dst_nodeWrite 1 to getSet avg_bwSet peak_bwWrite 1 to commit다른 endpoint로 반복 가능

Endpoint 설정에서 vote commit까지의 순서입니다.