【问题标题】:Understanding segment group, bus, device and function numbers from SMBIOS从 SMBIOS 了解段组、总线、设备和功能编号
【发布时间】:2014-01-25 07:35:32
【问题描述】:

目标

我正在尝试以编程方式找出特定 PCIe 设备连接在哪个物理插槽上。前提是我有一张卡的 PCI-ID,它肯定占用了一个插槽,解决方案是找出哪个卡。

请注意,我只对在 PCI Express 总线上工作感兴趣,尽管我认为设备识别/枚举过程与旧 PCI 相同。

尝试

SMBIOS 包含有关可用主板插槽的信息。可以从 linux 命令行检查这些信息:

$ sudo dmidecode -t slot
# dmidecode 2.11
SMBIOS 2.7 present.

Handle 0x003A, DMI type 9, 17 bytes
System Slot Information
    Designation: PCIEX16_1
    Type: x16 PCI Express x16
    Current Usage: In Use
    Length: Short
    ID: 1
    Characteristics:
        3.3 V is provided
        Opening is shared
        PME signal is supported
    Bus Address: 0000:03:02.0

Handle 0x003B, DMI type 9, 17 bytes
System Slot Information
    Designation: PCIEX16_2
    Type: x8 PCI Express x8
    Current Usage: In Use
    Length: Short
    ID: 2
    Characteristics:
        3.3 V is provided
        Opening is shared
        PME signal is supported
    Bus Address: 0000:04:02.2

Handle 0x003C, DMI type 9, 17 bytes
System Slot Information
    Designation: PCIEX16_3
    Type: x16 PCI Express x16
    Current Usage: In Use
    Length: Short
    ID: 3
    Characteristics:
        3.3 V is provided
        Opening is shared
        PME signal is supported
    Bus Address: 0000:05:03.0

但是,我在 PCI 总线 (lspci) 中找不到任何 PCI ID 为 0000:03:02.0、0000:04:02.2 或 0000:05:03.0 的设备。我通过手动检查知道如下:

  1. 卡0000:03:00.0 在第一个插槽中。 PCI 桥似乎是0000:00:02.0
  2. 卡0000:04:00.0 在第二个插槽中。 PCI 桥似乎是0000:00:02.2
  3. 卡0000:05:00.0 位于第三个插槽中。 PCI 桥似乎是0000:00:03.0

所以这里出现了一个模式。从 SMBIOS 结构来看,总线号是给插入的卡的总线号,但设备/功能号与对应的 PCI 桥接器相同。

这种模式只是我主板上的巧合还是背后有原因?它是华硕主板,带有 AMI BIOS。我读到一些 BIOS 没有提供有关其插槽的准确信息,所以我想知道我可以实现多少通用性。

非常感谢任何提示或指向参考文档的指针。

【问题讨论】:

  • C2H5OH:你找到了答案。??
  • 我所做的尝试似乎有效,但是我无法在超过三个主板上进行测试。由于我不必再从事该项目,因此我没有进一步调查。

标签: linux bios pci pci-e


【解决方案1】:

您可能会发现lspci 命令很有帮助。这是一个示例输出:

# lspci -v -t
-[0000:00]-+-00.0  Intel Corporation 5500 I/O Hub to ESI Port
           +-01.0-[01]--+-00.0  Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet
           |            \-00.1  Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet
           +-03.0-[02]--+-00.0  Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet
           |            \-00.1  Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet
           +-07.0-[04]----00.0  LSI Logic / Symbios Logic MegaRAID SAS 2108 [Liberator]
           +-09.0-[05]----00.0  LSI Logic / Symbios Logic MegaRAID SAS 2108 [Liberator]
           +-14.0  Intel Corporation 7500/5520/5500/X58 I/O Hub System Management Registers
           +-14.1  Intel Corporation 7500/5520/5500/X58 I/O Hub GPIO and Scratch Pad Registers
           +-14.2  Intel Corporation 7500/5520/5500/X58 I/O Hub Control Status and RAS Registers
           +-1a.0  Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #4
           +-1a.1  Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #5
           +-1a.7  Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #2
           +-1c.0-[03]----00.0  LSI Logic / Symbios Logic MegaRAID SAS 2108 [Liberator]
           +-1d.0  Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #1
           +-1d.1  Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #2
           +-1d.7  Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #1
           +-1e.0-[06]----03.0  Matrox Electronics Systems Ltd. MGA G200eW WPCM450
           +-1f.0  Intel Corporation 82801IB (ICH9) LPC Interface Controller
           \-1f.2  Intel Corporation 82801IB (ICH9) 2 port SATA Controller [IDE mode]

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-29
    • 2010-12-21
    • 2020-05-01
    • 2016-09-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多