lspci 输出中的主机桥与 pci 桥是什么?

lspci 输出中的主机桥与 pci 桥是什么?

我试图了解我的系统上的 pcie 拓扑和 lspci 的输出。

我的 lspci 输出和 pci 拓扑树:

00:00.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Renoir/Cezanne Root Complex
00:00.2 IOMMU: Advanced Micro Devices, Inc. [AMD] Renoir/Cezanne IOMMU
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
00:01.2 PCI bridge: Advanced Micro Devices, Inc. [AMD] Renoir/Cezanne PCIe GPP Bridge
00:02.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Renoir PCIe Dummy Host Bridge
00:08.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Renoir PCIe Dummy Host Bridge
00:08.1 PCI bridge: Advanced Micro Devices, Inc. [AMD] Renoir Internal PCIe GPP Bridge to Bus
00:08.2 PCI bridge: Advanced Micro Devices, Inc. [AMD] Renoir Internal PCIe GPP Bridge to Bus
00:14.0 SMBus: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller (rev 51)
00:14.3 ISA bridge: Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge (rev 51)
00:18.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Cezanne Data Fabric; Function 0
00:18.1 Host bridge: Advanced Micro Devices, Inc. [AMD] Cezanne Data Fabric; Function 1
00:18.2 Host bridge: Advanced Micro Devices, Inc. [AMD] Cezanne Data Fabric; Function 2
00:18.3 Host bridge: Advanced Micro Devices, Inc. [AMD] Cezanne Data Fabric; Function 3
00:18.4 Host bridge: Advanced Micro Devices, Inc. [AMD] Cezanne Data Fabric; Function 4
00:18.5 Host bridge: Advanced Micro Devices, Inc. [AMD] Cezanne Data Fabric; Function 5
00:18.6 Host bridge: Advanced Micro Devices, Inc. [AMD] Cezanne Data Fabric; Function 6
00:18.7 Host bridge: Advanced Micro Devices, Inc. [AMD] Cezanne Data Fabric; Function 7
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]
04:00.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] Matisse Switch Upstream
05:01.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] Matisse PCIe GPP Bridge
05:04.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] Matisse PCIe GPP Bridge
05:05.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] Matisse PCIe GPP Bridge
05:08.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] Matisse PCIe GPP Bridge
05:09.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] Matisse PCIe GPP Bridge
05:0a.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] Matisse PCIe GPP Bridge
06:00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd NVMe SSD Controller SM981/PM981/PM983
07:00.0 Network controller: Intel Corporation Wireless-AC 9260 (rev 29)
08:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 26)
09:00.0 Non-Essential Instrumentation [1300]: Advanced Micro Devices, Inc. [AMD] Starship/Matisse Reserved SPP
09:00.1 USB controller: Advanced Micro Devices, Inc. [AMD] Matisse USB 3.0 Host Controller
09:00.3 USB controller: Advanced Micro Devices, Inc. [AMD] Matisse USB 3.0 Host Controller
0a:00.0 SATA controller: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] (rev 51)
0b:00.0 SATA controller: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] (rev 51)
0c:00.0 Non-Essential Instrumentation [1300]: Advanced Micro Devices, Inc. [AMD] Zeppelin/Raven/Raven2 PCIe Dummy Function (rev c9)
0c:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Renoir Radeon High Definition Audio Controller
0c:00.2 Encryption controller: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 10h-1fh) Platform Security Processor
0c:00.3 USB controller: Advanced Micro Devices, Inc. [AMD] Renoir/Cezanne USB 3.1
0c:00.4 USB controller: Advanced Micro Devices, Inc. [AMD] Renoir/Cezanne USB 3.1
0c:00.6 Audio device: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 10h-1fh) HD Audio Controller
0d:00.0 SATA controller: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] (rev 81)

$ tree -d --matchdirs -I '[a-z]*'  /sys/devices/pci0000\:00//sys/devices/pci0000:00/
├── 0000:00:00.0
├── 0000:00:00.2
├── 0000:00:01.0
├── 0000:00:01.1
│   ├── 0000:00:01.1:pcie010
│   └── 0000:01:00.0
│       ├── 0000:01:00.0:pcie102
│       └── 0000:02:00.0
│           ├── 0000:02:00.0:pcie202
│           ├── 0000:02:00.0:pcie210
│           ├── 0000:03:00.0
│           └── 0000:03:00.1
├── 0000:00:01.2
│   ├── 0000:00:01.2:pcie010
│   └── 0000:04:00.0
│       ├── 0000:05:01.0
│       │   ├── 0000:05:01.0:pcie202
│       │   ├── 0000:05:01.0:pcie210
│       │   └── 0000:06:00.0
│       ├── 0000:05:04.0
│       │   ├── 0000:05:04.0:pcie202
│       │   ├── 0000:05:04.0:pcie210
│       │   └── 0000:07:00.0
│       ├── 0000:05:05.0
│       │   ├── 0000:05:05.0:pcie202
│       │   ├── 0000:05:05.0:pcie210
│       │   └── 0000:08:00.0
│       ├── 0000:05:08.0
│       │   ├── 0000:05:08.0:pcie210
│       │   ├── 0000:09:00.0
│       │   ├── 0000:09:00.1
│       │   └── 0000:09:00.3
│       ├── 0000:05:09.0
│       │   ├── 0000:05:09.0:pcie210
│       │   └── 0000:0a:00.0
│       └── 0000:05:0a.0
│           ├── 0000:05:0a.0:pcie210
│           └── 0000:0b:00.0
├── 0000:00:02.0
├── 0000:00:08.0
├── 0000:00:08.1
│   ├── 0000:00:08.1:pcie010
│   ├── 0000:0c:00.0
│   ├── 0000:0c:00.1
│   ├── 0000:0c:00.2
│   ├── 0000:0c:00.3
│   ├── 0000:0c:00.4
│   └── 0000:0c:00.6
├── 0000:00:08.2
│   ├── 0000:00:08.2:pcie010
│   └── 0000:0d:00.0
├── 0000:00:14.0
├── 0000:00:14.3
│   └── PNP0800:00
├── 0000:00:18.0
├── 0000:00:18.1
├── 0000:00:18.2
├── 0000:00:18.3
├── 0000:00:18.4
├── 0000:00:18.5
├── 0000:00:18.6
└── 0000:00:18.7

据我所知,PCI 桥接器(例如 00:01.1)仅出现在它们所连接的主总线上。该桥连接到总线 01,02,03,仅在总线 00 上的输出中指示。然后,当进行枚举时,总线 01 上的第一个设备将被赋予设备编号 00。设备 01:00.0 也是一个PCI桥,但我相信这是其他PCI 桥(与总线 02 类似),而总线 03 专门由 VGA/音频设备使用,它创建 2 个功能(用于 VGA 控制器和音频设备)。这准确吗?

为了理解主机桥,我想我需要首先了解 lspci 输出的上下文。我的理解是,有一个根联合体(通常在CPU本身)将CPU总线转换为外设空间。

CPU 中的根复合体是否由 00:00.0 主机桥...根复合体表示?我想澄清这一点有两个原因:

  1. 这与前面提到的仅在设备所连接的主总线上分配设备的逻辑不一致。在这种情况下,我意识到总线 00 之上没有主总线,但我一直假设该设备将被单独处理并直接由 CPU 寻址(并且不需要分配设备号)。

  2. 我不明白为什么根复合体会与输出中不是根复合体的其他主机桥共享相同的设备类(它们都是 Renoir PCIe 虚拟主机桥)。

继续这一点,我注意到这些主桥都没有连接到任何其他总线。这是否仅仅是因为硬件没有连接到任何东西,并且这些桥尽管未被使用却出现在输出中?看到它们是 PCIe 桥接器,如果它们是 PCIe 桥接器,设备类别是否会更改为“PCI 桥接器”?

答案1

在这里回答我自己的问题:

之前,我的困惑是因为没有从根本上理解 PCIe 的工作原理。了解 PCIe 以及如何枚举拓扑可以解决我的大部分问题。

本文包括一张很好地说明它的图像:示例拓扑

主要要点是每个 P2P 连接都会有自己的总线号。如图所示,交换机有 2 层 P2P 连接:

  1. 上游端口(每个交换机只有 1 个),将上游端口连接到其自己的内部总线
  2. 将其内部总线连接到下游的下游端口

根联合体在枚举总线编号的方式上没有什么不同。根联合体有一条内部总线,每次都是总线 0(在单个根联合体系统上)。任何连接到其中的设备都将成为总线 0 上的设备,并且任何 P2P 连接都将被分配自己的总线号。

对于 PCIe 的深入介绍,我发现 MindShare 发布的《PCI Express 技术 3.0》一文很有价值。

答案2

当涉及到总线编号时,它并不总是按照您期望的顺序发生。

[ken@m10plus ~]$ sudo lspci -tv
-[0000:00]-+-00.0  Intel Corporation 8th/9th Gen Core Processor Host Bridge/DRAM Registers [Coffee Lake]
           +-01.0-[07]----00.0  Sandisk Corp WD Blue SN550 NVMe SSD
           +-12.0  Intel Corporation Cannon Lake PCH Thermal Controller
           +-14.0  Intel Corporation Cannon Lake PCH USB 3.1 xHCI Host Controller
           +-14.2  Intel Corporation Cannon Lake PCH Shared SRAM
           +-16.0  Intel Corporation Cannon Lake PCH HECI Controller
           +-16.4  Intel Corporation Cannon Lake PCH HECI Controller #2
           +-1b.0-[06]--
           +-1c.0-[02]--+-00.0  Intel Corporation I350 Gigabit Network Connection
           |            +-00.1  Intel Corporation I350 Gigabit Network Connection
           |            +-00.2  Intel Corporation I350 Gigabit Network Connection
           |            \-00.3  Intel Corporation I350 Gigabit Network Connection
           +-1d.0-[01]--+-00.0  Hewlett-Packard Company Integrated Lights-Out Standard Slave Instrumentation & System Support
           |            +-00.1  Matrox Electronics Systems Ltd. MGA G200eH3
           |            +-00.2  Hewlett-Packard Company Integrated Lights-Out Standard Management Processor Support and Messaging
           |            \-00.4  Hewlett-Packard Company iLO5 Virtual USB Controller
           +-1d.1-[03]--
           +-1d.2-[04]--
           +-1d.3-[05]--
           +-1f.0  Intel Corporation Device a30a
           \-1f.5  Intel Corporation Cannon Lake PCH SPI Controller
[ken@m10plus ~]$

对于我查看过的每个系统,我发现您需要首先找到一条通往 VGA 卡的路径,以便它通常使用总线 1。该系统是 HPE gen10+ 微型服务器,在我查看过的其他服务器上,然后是总线数字似乎更加混乱。

相关内容