Project

General

Profile

Actions

Bug #11867

closed

PCIe expansion slots mis-labelled in topo

Added by Rob Johnston over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

I noticed that the labels for PCIe devices in the topo snapshot were incorrect and appeared to be off-by-one on the Joyent-M12G5 in the SF lab.

The system has 7 PCIe expansion slots and has PCIe cards installed in slots 1, 2, 4 and 6. However, in topo these cards are labelled as being in slots 2, 3, 5 and 7. After digging into how topo assigns the labels, I found that it uses logic like the following:

1) Determine the slot id of the device. To do this it first looks at the slot-names devinfo property, which is derived from the IRQ routing table as defined by IEEE 1275 - see pci_slot_names_prop() and tries to scrape the slot id off of the encoded string.

If that fails, (which isn't the case here) it tries to determine the slot-id from the phsyical-slot# devinfo prop.

2) Once it has a slot id, it cross-references it with the type 0x9 SMBIOS records and then sets the label to the locator string from the SMBIOS record with the same slot id.

This whole mechanism relies on SMBIOS and slot-names agreeing on the slot id numbering. But on this system, the slot-names props number the slots from 1 to 7 - which is what we'd expect as slot id 0 should be reserved for on-board devices. But the type 0x9 SMBIOS records use slot id's 0 to 6.

As an example of this mis-match, there is an LSI HBA in the 2nd slot. The string that we scrape the slot id out of in slot-names property for this device is "Slot2":

        name='slot-names' type=int items=3
            value=00000001.746f6c53.00000032

But that ends up matching to the following SMBIOS record:


ID    SIZE TYPE
15    41   SMB_TYPE_SLOT (type 9) (upgradeable system slot)

  Location Tag: CPU1 SLOT 3 PCI-E 3.0 X8

  Reference Designator: CPU1 SLOT 3 PCI-E 3.0 X8
  Slot ID: 0x2
  Type: 0xb5 (PCI Exp. Gen 3 x8)
  Width: 0xb (8x or x8)
  Usage: 0x3 (available)
  Length: 0x3 (short length)
  Slot Characteristics 1: 0xc
        SMB_SLCH1_33V (provides 3.3V)
        SMB_SLCH1_SHARED (opening shared with other slot)
  Slot Characteristics 2: 0x1
        SMB_SLCH2_PME (slot supports PME# signal)
  Segment Group: 0
  Bus Number: 255
  Device/Function Number: 0
Actions

Also available in: Atom PDF