1

In setting up a domain with virsh, I had always assumed that the "slot" of a PCI card referred to which slot on the motherboard it was in. However, that seems not two be the case, cards in two different physical slots are assigned to the same "slot" by virsh. The first two devices are part of a GTX 1070, the third is a Sonnet PCI usb card.

Also, what are these two different bus IDs? Is the bus ID of the first one 67 or 43?

~$ virsh nodedev-dumpxml pci_0000_43_00_0
<device>
  <name>pci_0000_43_00_0</name>
  <path>/sys/devices/pci0000:40/0000:40:01.3/0000:43:00.0</path>
  <parent>pci_0000_40_01_3</parent>
  <driver>
    <name>nouveau</name>
  </driver>
  <capability type='pci'>
    <domain>0</domain>
    <bus>67</bus>
    <slot>0</slot>
    <function>0</function>
    <product id='0x1b81'>GP104 [GeForce GTX 1070]</product>
    <vendor id='0x10de'>NVIDIA Corporation</vendor>
    <iommuGroup number='39'>
      <address domain='0x0000' bus='0x43' slot='0x00' function='0x0'/>
      <address domain='0x0000' bus='0x43' slot='0x00' function='0x1'/>
    </iommuGroup>
    <pci-express>
      <link validity='cap' port='0' speed='8' width='16'/>
      <link validity='sta' speed='2.5' width='8'/>
    </pci-express>
  </capability>
</device>

~$ virsh nodedev-dumpxml pci_0000_43_00_1
<device>
  <name>pci_0000_43_00_1</name>
  <path>/sys/devices/pci0000:40/0000:40:01.3/0000:43:00.1</path>
  <parent>pci_0000_40_01_3</parent>
  <driver>
    <name>snd_hda_intel</name>
  </driver>
  <capability type='pci'>
    <domain>0</domain>
    <bus>67</bus>
    <slot>0</slot>
    <function>1</function>
    <product id='0x10f0'>GP104 High Definition Audio Controller</product>
    <vendor id='0x10de'>NVIDIA Corporation</vendor>
    <iommuGroup number='39'>
      <address domain='0x0000' bus='0x43' slot='0x00' function='0x0'/>
      <address domain='0x0000' bus='0x43' slot='0x00' function='0x1'/>
    </iommuGroup>
    <pci-express>
      <link validity='cap' port='0' speed='8' width='16'/>
      <link validity='sta' speed='2.5' width='8'/>
    </pci-express>
  </capability>
</device>

~$ virsh nodedev-dumpxml pci_0000_0a_00_0
<device>
  <name>pci_0000_0a_00_0</name>
  <path>/sys/devices/pci0000:00/0000:00:03.1/0000:0a:00.0</path>
  <parent>pci_0000_00_03_1</parent>
  <driver>
    <name>xhci_hcd</name>
  </driver>
  <capability type='pci'>
    <domain>0</domain>
    <bus>10</bus>
    <slot>0</slot>
    <function>0</function>
    <product id='0x1242'>ASM1142 USB 3.1 Host Controller</product>
    <vendor id='0x1b21'>ASMedia Technology Inc.</vendor>
    <iommuGroup number='18'>
      <address domain='0x0000' bus='0x0a' slot='0x00' function='0x0'/>
    </iommuGroup>
    <numa node='0'/>
    <pci-express>
      <link validity='cap' port='1' speed='5' width='2'/>
      <link validity='sta' speed='5' width='2'/>
    </pci-express>
  </capability>
</device>
1

The "bus" refers to a PCI/PCI-X/PCI express bus from the motherboard's chipset, to which devices are attached. This may or may not be via actual slots on the board; for instance, the onboard Ethernet ports are on a separate bus from the expansion slots which accept your video card.

The "slot" refers to a space on the PCI bus to which a single physical device is attached, which is electrically distinct from other "slots" on that bus. For instance, two distinct USB controllers occupying two different slots. Or your video card occupying a different slot than your RAID HBA.

Note that while you asked about two different physical devices using the same slot, nothing you posted in your question demonstrates this happening. Indeed, it does not happen. Slots are physically part of a bus, and slot 0 on one bus is different to slot 0 on another bus.

The "function" refers to a subset of a physical device which provides distinct functionality. For instance, the onboard Ethernet device has separate functions for each physical Ethernet port. Your video card has separate functions for the video controller and the audio device.

With regard to passthrough, a single bus/slot/function identifies a device, or part thereof, which can be passed through separately to a VM.

Finally, 67 and 43 are the same number. The former is decimal, and as implied by it being shown as 0x43, the latter is hexadecimal.

  • Thank you for the very clear explanation, that is exactly what I was looking for. – Stonecraft Feb 6 at 14:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.