I am having trouble understanding the device-model and PCIe topology on my system. I've listed the output I've been looking at and attempted to explain my mental-model of what's there in hopes it helps highlight what I'm not understanding.
My output
$: lspci -t
-[0000:00]-+-00.0
+-00.2
+-01.0
+-01.1-[01-03]----00.0-[02-03]----00.0-[03]--+-00.0 # 1
| \-00.1 # 2
+-01.2-[04-0b]----00.0-[05-0b]--+-01.0-[06]----00.0
| +-04.0-[07]----00.0
| +-05.0-[08]----00.0
| +-08.0-[09]--+-00.0
| | +-00.1
| | \-00.3
| +-09.0-[0a]----00.0
| \-0a.0-[0b]----00.0
# ...
$: lspci
00:00.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Renoir/Cezanne Root Complex
# ...
00:01.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Renoir PCIe Dummy Host Bridge
00:01.1 PCI bridge: Advanced Micro Devices, Inc. [AMD] Renoir PCIe GPP Bridge
# ...
01:00.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 XL Upstream Port of PCI Express Switch (rev c0)
02:00.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 XL Downstream Port of PCI Express Switch
03:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Navi 21 [Radeon RX 6800/6800 XT / 6900 XT] (rev c0)
03:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Navi 21 HDMI Audio [Radeon RX 6800/6800 XT / 6900 XT]
# ...
$ ls /sys/bus/pci/devices/
# ...
0000:00:01.0 -> ../../../devices/pci0000:00/0000:00:01.0/
0000:00:01.1 -> ../../../devices/pci0000:00/0000:00:01.1/ # 3
0000:00:01.2 -> ../../../devices/pci0000:00/0000:00:01.2/
# ...
0000:01:00.0 -> ../../../devices/pci0000:00/0000:00:01.1/0000:01:00.0/ # 4
0000:02:00.0 -> ../../../devices/pci0000:00/0000:00:01.1/0000:01:00.0/0000:02:00.0/ #5
0000:03:00.0 -> ../../../devices/pci0000:00/0000:00:01.1/0000:01:00.0/0000:02:00.0/0000:03:00.0/
0000:03:00.1 -> ../../../devices/pci0000:00/0000:00:01.1/0000:01:00.0/0000:02:00.0/0000:03:00.1/
# ...
Attempt at explaining
Device 00:00.0
is the Controller of the only bus that interfaces with the CPU, and it controls all traffic on bus 00. The CPU can interface with 00:00.0
directly in order to configure how it controls bus 00, but otherwise, it is essentially a passive tunnel for the CPU to communicate with other devices on the bus.
Device 00:01
is a physical controller on bus 00 in a "child" role (in that it operates as any other device on bus 00). It makes available 3 different functions:
- 00:01.0 Host bridge ... PCIe Dummy Host Bridge
- 00:01.1 a bridge to bus 01
- 00:01.2 a bridge to bus 02
I interpret 00:01.0 presumably as being a configuration/control type of interface for the other 2 functions. Is this a reasonable assumption?
For the bridges, from the links in /sys/bus/pci/devices, we see that 00:01.1
points to a device of the same name directly on bus 00. Also, 01:00.0
points to a device nested under 00:01.1
(lines denoted 3 and 4).
At this point, I am thinking that 01:00.0
is a bus controller (similar conceptually to 00:00.0
) which needs to send all of its communication through 00:01.1
to get to the CPU.
However, 02:00.0
is further nested within 01:00.0
and there is no such similar bridge device to connect the buses. I was expecting bus 02 to either:
- mirror the previous nesting. For example, I thought there would be 2 devices:
01:01.0
(Dummy) and01:01.1
(bridge), and that the bridge would be nested in the directory first, and then would come bus 02. - or that buses 02 and 03 would be in the same directory as bus 01 e.g:
line 5:
0000:02:00.0 -> ../../../devices/pci0000:00/0000:00:01.1/0000:01:00.0/0000:02:00.0/
my expectation for what it would look like for case 1:
0000:02:00.0 -> ../../../devices/pci0000:00/0000:00:01.1/0000:01:00.0/0000:01:01.1/0000:02:00.0/
my expectation for what it would look like for case 2:
0000:02:00.0 -> ../../../devices/pci0000:00/0000:00:01.1/0000:02:00.0/
Questions
- How can I understand the topological structure for buses 1, 2, and 3?
- Noting that bus 3 isn't actually a bus (it is a VGA controller), how can it exist on its own bus? The Kernel driver in use for this device is
amdgpu
and I double checked that this is indeed a driver which registers itself as a pci driver.
Does the CPU/operating system interact with 00:00.0
only for configuration purposes