概述
文章主要简述如何获取一台linux 服务器的硬件topo链路
cpu 连接
通过dmidecode 获取 与cpu 直连的 bus address
$sudo dmidecode -t slot
[sudo] password for xlc01934458:
# dmidecode 3.3
Getting SMBIOS data from sysfs.
SMBIOS 3.3.0 present.
Handle 0x0050, DMI type 9, 24 bytes
System Slot Information
Designation: J70_CPU0_1A - Slot x16
Type: x16 PCI Express 3 x16
Current Usage: In Use
Length: Long
ID: 61
Characteristics:
3.3 V is provided
PME signal is supported
Bus Address: 0000:11:00.0
Data Bus Width: 0
Peer Devices: 0
Handle 0x0051, DMI type 9, 24 bytes
System Slot Information
Designation: J40_CPU0_2B - Slot x16
Type: x16 PCI Express 3 x16
Current Usage: In Use
Length: Long
ID: 65
Characteristics:
3.3 V is provided
PME signal is supported
Bus Address: 0000:43:00.0
Data Bus Width: 0
Peer Devices: 0
Handle 0x0052, DMI type 9, 24 bytes
System Slot Information
Designation: J46_CPU1_0B - Slot x16
Type: x16 PCI Express 3 x16
Current Usage: In Use
Length: Long
ID: 41
Characteristics:
3.3 V is provided
PME signal is supported
Bus Address: 0000:82:00.0
Data Bus Width: 0
Peer Devices: 0
Handle 0x0053, DMI type 9, 24 bytes
System Slot Information
Designation: J42_CPU1_1A - Slot x4
Type: x4 PCI Express 3 x4
Current Usage: In Use
Length: Long
ID: 45
Characteristics:
3.3 V is provided
PME signal is supported
Bus Address: 0000:9b:00.0
Data Bus Width: 0
Peer Devices: 0
Handle 0x0054, DMI type 9, 24 bytes
System Slot Information
Designation: J42_CPU1_1A - Slot x4
Type: x4 PCI Express 3 x4
Current Usage: Available
Length: Long
ID: 46
Characteristics:
3.3 V is provided
PME signal is supported
Bus Address: 0000:9a:03.0
Data Bus Width: 0
Peer Devices: 0
Handle 0x0055, DMI type 9, 24 bytes
System Slot Information
Designation: J43_CPU1_2B - Slot x16
Type: x16 PCI Express 3 x16
Current Usage: In Use
Length: Long
ID: 51
Characteristics:
3.3 V is provided
PME signal is supported
Bus Address: 0000:ab:00.0
Data Bus Width: 0
Peer Devices: 0
获取 bus 链路
ll /sys/bus/pci/devices/ 获取 整个链路信息, 如
获取指定bus address 的硬件信息
lspci 获取硬件信息