Documentation/driver-api/cxl/linux/example-configurations/hb-interleave.rst GitHub 원문 ↗

Linux 6.18.37 · Driver API / CXL / Linux / Example Configurations

Inter-Host-Bridge Interleave

두 CXL Host Bridge와 두 Memory Expander에 걸친 2-way interleave의 root, port, endpoint decoder 및 region mapping을 풀이합니다.

Source pathDocumentation/driver-api/cxl/linux/example-configurations/hb-interleave.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약과 해설

hb-interleave.rst:1-314

이 예제는 네 Host Bridge 가운데 `port1`과 `port3`에만 Memory Expander가 연결된 system에서 `decoder0.0`이 두 bridge를 256-byte 단위로 interleave하는 과정을 보여 줍니다. 각 bridge decoder는 endpoint 하나를 선택하고 `region0`의 mapping position이 `mem0`과 `mem1`의 endpoint decoder를 결합합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2
3 ============================
4 Inter-Host-Bridge Interleave
5 ============================
6 This cxl-cli configuration dump shows the following host configuration:
7
8 * A single socket system with one CXL root
9 * CXL Root has Four (4) CXL Host Bridges
10 * Two CXL Host Bridges have a single CXL Memory Expander Attached
11 * The CXL root is configured to interleave across the two host bridges.
12
13 This output is generated by :code:`cxl list -v` and describes the relationships
14 between objects exposed in :code:`/sys/bus/cxl/devices/`.
15
16 ::
17
18 [
19 {
20 "bus":"root0",
21 "provider":"ACPI.CXL",
22 "nr_dports":4,
23 "dports":[
24 {
25 "dport":"pci0000:00",
26 "alias":"ACPI0016:01",
27 "id":0
28 },
29 {
30 "dport":"pci0000:a8",
31 "alias":"ACPI0016:02",
32 "id":4
33 },
34 {
35 "dport":"pci0000:2a",
36 "alias":"ACPI0016:03",
37 "id":1
38 },
39 {
40 "dport":"pci0000:d2",
41 "alias":"ACPI0016:00",
42 "id":5
43 }
44 ],
45
46 This chunk shows the CXL "bus" (root0) has 4 downstream ports attached to CXL
47 Host Bridges. The `Root` can be considered the singular upstream port attached
48 to the platform's memory controller - which routes memory requests to it.
49
50 The `ports:root0` section lays out how each of these downstream ports are
51 configured. If a port is not configured (id's 0 and 1), they are omitted.
52
53 ::
54
55 "ports:root0":[
56 {
57 "port":"port1",
58 "host":"pci0000:d2",
59 "depth":1,
60 "nr_dports":3,
61 "dports":[
62 {
63 "dport":"0000:d2:01.1",
64 "alias":"device:02",
65 "id":0
66 },
67 {
68 "dport":"0000:d2:01.3",
69 "alias":"device:05",
70 "id":2
71 },
72 {
73 "dport":"0000:d2:07.1",
74 "alias":"device:0d",
75 "id":113
76 }
77 ],
78
79 This chunk shows the available downstream ports associated with the CXL Host
80 Bridge :code:`port1`. In this case, :code:`port1` has 3 available downstream
81 ports: :code:`dport1`, :code:`dport2`, and :code:`dport113`..
82
83 ::
84
85 "endpoints:port1":[
86 {
87 "endpoint":"endpoint5",
88 "host":"mem0",
89 "parent_dport":"0000:d2:01.1",
90 "depth":2,
91 "memdev":{
92 "memdev":"mem0",
93 "ram_size":137438953472,
94 "serial":0,
95 "numa_node":0,
96 "host":"0000:d3:00.0"
97 },
98 "decoders:endpoint5":[
99 {
100 "decoder":"decoder5.0",
101 "resource":825975898112,
102 "size":274877906944,
103 "interleave_ways":2,
104 "interleave_granularity":256,
105 "region":"region0",
106 "dpa_resource":0,
107 "dpa_size":137438953472,
108 "mode":"ram"
109 }
110 ]
111 }
112 ],
113
114 This chunk shows the endpoints attached to the host bridge :code:`port1`.
115
116 :code:`endpoint5` contains a single configured decoder :code:`decoder5.0`
117 which has the same interleave configuration as :code:`region0` (shown later).
118
119 Next we have the decodesr belonging to the host bridge:
120
121 ::
122
123 "decoders:port1":[
124 {
125 "decoder":"decoder1.0",
126 "resource":825975898112,
127 "size":274877906944,
128 "interleave_ways":1,
129 "region":"region0",
130 "nr_targets":1,
131 "targets":[
132 {
133 "target":"0000:d2:01.1",
134 "alias":"device:02",
135 "position":0,
136 "id":0
137 }
138 ]
139 }
140 ]
141 },
142
143 Host Bridge :code:`port1` has a single decoder (:code:`decoder1.0`), whose only
144 target is :code:`dport1` - which is attached to :code:`endpoint5`.
145
146 The following chunk shows a similar configuration for Host Bridge :code:`port3`,
147 the second host bridge with a memory device attached.
148
149 ::
150
151 {
152 "port":"port3",
153 "host":"pci0000:a8",
154 "depth":1,
155 "nr_dports":1,
156 "dports":[
157 {
158 "dport":"0000:a8:01.1",
159 "alias":"device:c3",
160 "id":0
161 }
162 ],
163 "endpoints:port3":[
164 {
165 "endpoint":"endpoint6",
166 "host":"mem1",
167 "parent_dport":"0000:a8:01.1",
168 "depth":2,
169 "memdev":{
170 "memdev":"mem1",
171 "ram_size":137438953472,
172 "serial":0,
173 "numa_node":0,
174 "host":"0000:a9:00.0"
175 },
176 "decoders:endpoint6":[
177 {
178 "decoder":"decoder6.0",
179 "resource":825975898112,
180 "size":274877906944,
181 "interleave_ways":2,
182 "interleave_granularity":256,
183 "region":"region0",
184 "dpa_resource":0,
185 "dpa_size":137438953472,
186 "mode":"ram"
187 }
188 ]
189 }
190 ],
191 "decoders:port3":[
192 {
193 "decoder":"decoder3.0",
194 "resource":825975898112,
195 "size":274877906944,
196 "interleave_ways":1,
197 "region":"region0",
198 "nr_targets":1,
199 "targets":[
200 {
201 "target":"0000:a8:01.1",
202 "alias":"device:c3",
203 "position":0,
204 "id":0
205 }
206 ]
207 }
208 ]
209 },
210
211
212 The next chunk shows the two CXL host bridges without attached endpoints.
213
214 ::
215
216 {
217 "port":"port2",
218 "host":"pci0000:00",
219 "depth":1,
220 "nr_dports":2,
221 "dports":[
222 {
223 "dport":"0000:00:01.3",
224 "alias":"device:55",
225 "id":2
226 },
227 {
228 "dport":"0000:00:07.1",
229 "alias":"device:5d",
230 "id":113
231 }
232 ]
233 },
234 {
235 "port":"port4",
236 "host":"pci0000:2a",
237 "depth":1,
238 "nr_dports":1,
239 "dports":[
240 {
241 "dport":"0000:2a:01.1",
242 "alias":"device:d0",
243 "id":0
244 }
245 ]
246 }
247 ],
248
249 Next we have the `Root Decoders` belonging to :code:`root0`. This root decoder
250 applies the interleave across the downstream ports :code:`port1` and
251 :code:`port3` - with a granularity of 256 bytes.
252
253 This information is generated by the CXL driver reading the ACPI CEDT CMFWS.
254
255 ::
256
257 "decoders:root0":[
258 {
259 "decoder":"decoder0.0",
260 "resource":825975898112,
261 "size":274877906944,
262 "interleave_ways":2,
263 "interleave_granularity":256,
264 "max_available_extent":0,
265 "volatile_capable":true,
266 "nr_targets":2,
267 "targets":[
268 {
269 "target":"pci0000:a8",
270 "alias":"ACPI0016:02",
271 "position":1,
272 "id":4
273 },
274 {
275 "target":"pci0000:d2",
276 "alias":"ACPI0016:00",
277 "position":0,
278 "id":5
279 }
280 ],
281
282 Finally we have the `Memory Region` associated with the `Root Decoder`
283 :code:`decoder0.0`. This region describes the overall interleave configuration
284 of the interleave set.
285
286 ::
287
288 "regions:decoder0.0":[
289 {
290 "region":"region0",
291 "resource":825975898112,
292 "size":274877906944,
293 "type":"ram",
294 "interleave_ways":2,
295 "interleave_granularity":256,
296 "decode_state":"commit",
297 "mappings":[
298 {
299 "position":1,
300 "memdev":"mem1",
301 "decoder":"decoder6.0"
302 },
303 {
304 "position":0,
305 "memdev":"mem0",
306 "decoder":"decoder5.0"
307 }
308 ]
309 }
310 ]
311 }
312 ]
313 }
314 ]
315

3. 한국어 전문 번역

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

Host Bridge 사이의 interleave 구성

1-17
.. SPDX-License-Identifier: GPL-2.0

이 `Inter-Host-Bridge Interleave`의 `cxl-cli` configuration dump는 다음 host 구성을 보여 줍니다.

  • CXL root가 하나인 single-socket system입니다.
  • CXL Root에는 CXL Host Bridge가 네 개 있습니다.
  • 그중 두 CXL Host Bridge에 CXL Memory Expander가 하나씩 연결되어 있습니다.
  • CXL root는 두 host bridge에 걸쳐 interleave하도록 구성되어 있습니다.

이 출력은 `cxl list -v`로 생성했으며 `/sys/bus/cxl/devices/`에 노출되는 object 사이의 관계를 설명합니다.

CXL root bus와 downstream port

18-52
[
  {
      "bus":"root0",
      "provider":"ACPI.CXL",
      "nr_dports":4,
      "dports":[
          {
              "dport":"pci0000:00",
              "alias":"ACPI0016:01",
              "id":0
          },
          {
              "dport":"pci0000:a8",
              "alias":"ACPI0016:02",
              "id":4
          },
          {
              "dport":"pci0000:2a",
              "alias":"ACPI0016:03",
              "id":1
          },
          {
              "dport":"pci0000:d2",
              "alias":"ACPI0016:00",
              "id":5
          }
      ],

이 부분은 CXL `bus`인 `root0`에 CXL Host Bridge로 연결되는 downstream port 네 개가 있음을 보여 줍니다. `Root`는 platform memory controller에 연결된 하나의 upstream port로 볼 수 있으며, memory controller는 memory request를 이 port로 routing합니다.

`ports:root0` section은 각 downstream port의 구성을 펼쳐 보여 줍니다. 구성되지 않은 port, 즉 ID 0과 1은 이 section에서 생략됩니다.

Host Bridge port1의 downstream port

53-82
"ports:root0":[
    {
        "port":"port1",
        "host":"pci0000:d2",
        "depth":1,
        "nr_dports":3,
        "dports":[
            {
                "dport":"0000:d2:01.1",
                "alias":"device:02",
                "id":0
            },
            {
                "dport":"0000:d2:01.3",
                "alias":"device:05",
                "id":2
            },
            {
                "dport":"0000:d2:07.1",
                "alias":"device:0d",
                "id":113
            }
        ],

이 부분은 CXL Host Bridge `port1`에 연결된 사용 가능한 downstream port를 보여 줍니다. 여기서 `port1`에는 `dport1`, `dport2`, `dport113`이라는 downstream port 세 개가 있습니다.

port1의 endpoint5와 endpoint decoder

83-120
"endpoints:port1":[
    {
        "endpoint":"endpoint5",
        "host":"mem0",
        "parent_dport":"0000:d2:01.1",
        "depth":2,
        "memdev":{
            "memdev":"mem0",
            "ram_size":137438953472,
            "serial":0,
            "numa_node":0,
            "host":"0000:d3:00.0"
        },
        "decoders:endpoint5":[
            {
                "decoder":"decoder5.0",
                "resource":825975898112,
                "size":274877906944,
                "interleave_ways":2,
                "interleave_granularity":256,
                "region":"region0",
                "dpa_resource":0,
                "dpa_size":137438953472,
                "mode":"ram"
            }
        ]
    }
],

이 부분은 host bridge `port1`에 연결된 endpoint를 보여 줍니다.

`endpoint5`에는 구성된 decoder `decoder5.0`이 하나 있습니다. 이 decoder는 뒤에서 나오는 `region0`과 같은 interleave 구성, 즉 2-way와 256-byte granularity를 사용합니다. 전체 region size는 274877906944 byte이고 이 endpoint가 담당하는 DPA size는 137438953472 byte이며 mode는 `ram`입니다.

다음으로 host bridge 자체에 속한 decoder 구성이 이어집니다.

port1의 host bridge decoder

121-148
    "decoders:port1":[
        {
            "decoder":"decoder1.0",
            "resource":825975898112,
            "size":274877906944,
            "interleave_ways":1,
            "region":"region0",
            "nr_targets":1,
            "targets":[
                {
                    "target":"0000:d2:01.1",
                    "alias":"device:02",
                    "position":0,
                    "id":0
                }
            ]
        }
    ]
},

Host Bridge `port1`에는 decoder `decoder1.0`이 하나 있습니다. 유일한 target은 `dport1`인 `0000:d2:01.1`이며, 이 port에는 `endpoint5`가 연결되어 있습니다.

이어서 memory device가 연결된 두 번째 host bridge인 `port3`의 유사한 구성을 보여 줍니다.

Host Bridge port3과 endpoint6

149-211
{
    "port":"port3",
    "host":"pci0000:a8",
    "depth":1,
    "nr_dports":1,
    "dports":[
        {
            "dport":"0000:a8:01.1",
            "alias":"device:c3",
            "id":0
        }
    ],
    "endpoints:port3":[
        {
            "endpoint":"endpoint6",
            "host":"mem1",
            "parent_dport":"0000:a8:01.1",
            "depth":2,
            "memdev":{
                "memdev":"mem1",
                "ram_size":137438953472,
                "serial":0,
                "numa_node":0,
                "host":"0000:a9:00.0"
            },
            "decoders:endpoint6":[
                {
                    "decoder":"decoder6.0",
                    "resource":825975898112,
                    "size":274877906944,
                    "interleave_ways":2,
                    "interleave_granularity":256,
                    "region":"region0",
                    "dpa_resource":0,
                    "dpa_size":137438953472,
                    "mode":"ram"
                }
            ]
        }
    ],
    "decoders:port3":[
        {
            "decoder":"decoder3.0",
            "resource":825975898112,
            "size":274877906944,
            "interleave_ways":1,
            "region":"region0",
            "nr_targets":1,
            "targets":[
                {
                    "target":"0000:a8:01.1",
                    "alias":"device:c3",
                    "position":0,
                    "id":0
                }
            ]
        }
    ]
},

`port3`에는 downstream port `0000:a8:01.1` 하나와 `mem1`을 host로 하는 `endpoint6`이 있습니다. endpoint decoder `decoder6.0`은 `region0`에 참여하며 `decoder5.0`과 마찬가지로 2-way, 256-byte granularity, 274877906944-byte region을 decode합니다.

`decoder6.0`의 DPA 범위는 0에서 시작해 137438953472 byte를 담당합니다. Host Bridge decoder `decoder3.0`은 1-way로 동작하며 유일한 target인 `0000:a8:01.1`을 통해 `endpoint6`으로 request를 보냅니다.

Endpoint가 없는 두 Host Bridge

212-248

다음 부분은 endpoint가 연결되지 않은 CXL host bridge 두 개를 보여 줍니다.

    {
        "port":"port2",
        "host":"pci0000:00",
        "depth":1,
        "nr_dports":2,
        "dports":[
            {
                "dport":"0000:00:01.3",
                "alias":"device:55",
                "id":2
            },
            {
                "dport":"0000:00:07.1",
                "alias":"device:5d",
                "id":113
            }
        ]
    },
    {
        "port":"port4",
        "host":"pci0000:2a",
        "depth":1,
        "nr_dports":1,
        "dports":[
            {
                "dport":"0000:2a:01.1",
                "alias":"device:d0",
                "id":0
            }
        ]
    }
],

`port2`에는 downstream port 두 개가 있고 `port4`에는 하나가 있지만, 어느 쪽에도 endpoint나 구성된 decoder가 표시되지 않습니다.

root0의 Root Decoder

249-281

다음은 `root0`에 속한 `Root Decoder`입니다. 이 root decoder는 downstream port `port1`과 `port3`에 걸쳐 256-byte granularity로 interleave를 적용합니다.

이 정보는 CXL driver가 ACPI CEDT의 CFMWS를 읽어 생성합니다. 원문에는 이 구조 이름이 `CMFWS`로 표기되어 있습니다.

"decoders:root0":[
    {
        "decoder":"decoder0.0",
        "resource":825975898112,
        "size":274877906944,
        "interleave_ways":2,
        "interleave_granularity":256,
        "max_available_extent":0,
        "volatile_capable":true,
        "nr_targets":2,
        "targets":[
            {
                "target":"pci0000:a8",
                "alias":"ACPI0016:02",
                "position":1,
                "id":4
            },
            {
                "target":"pci0000:d2",
                "alias":"ACPI0016:00",
                "position":0,
                "id":5
            }
        ],

`decoder0.0`은 2-way interleave를 사용하며 target position 0에는 `pci0000:d2`의 `port1`, position 1에는 `pci0000:a8`의 `port3`을 둡니다. 두 target ID는 각각 5와 4입니다.

Root Decoder의 Memory Region

282-314

마지막은 `Root Decoder` `decoder0.0`과 연결된 `Memory Region`입니다. 이 region은 interleave set 전체의 구성을 설명합니다.

              "regions:decoder0.0":[
                  {
                      "region":"region0",
                      "resource":825975898112,
                      "size":274877906944,
                      "type":"ram",
                      "interleave_ways":2,
                      "interleave_granularity":256,
                      "decode_state":"commit",
                      "mappings":[
                          {
                              "position":1,
                              "memdev":"mem1",
                              "decoder":"decoder6.0"
                          },
                          {
                              "position":0,
                              "memdev":"mem0",
                              "decoder":"decoder5.0"
                          }
                      ]
                  }
              ]
          }
      ]
  }
]

`region0`은 274877906944-byte RAM region이며 2-way, 256-byte granularity로 `commit`된 상태입니다. mapping position 0은 `mem0`의 `decoder5.0`, position 1은 `mem1`의 `decoder6.0`입니다.

따라서 root decoder가 HPA request를 두 host bridge 사이에 나누고, 각 host bridge decoder가 하나의 endpoint를 선택하며, endpoint decoder가 자기 장치의 DPA 절반을 제공하는 구성이 완성됩니다.