multi-interleave.rst 14 KB

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