Electronic – What limits the number of buses, devices and functions on a PCI bus

pci

I am learning the PCI/PCIe bus. I learned that:

  • A PCI hierarchy can support at most 256 buses.
  • A PCI bus can support at most 32 devices.
  • A PCI device can have at most 8 functions.

I checked the Configuration Header Type 0.

enter image description here

There's a Device ID field which spans 2 bytes. 2^16 is much greater than 256.

So where do the 256, 32 and 8 restrictions come from?

Best Answer

I found an answer:

In addition to the normal memory-mapped and I/O port spaces, each device function on the bus has a configuration space, which is 256 bytes long, addressable by knowing the eight-bit PCI bus, five-bit device, and three-bit function numbers for the device (commonly referred to as the BDF or B/D/F, as abbreviated from bus/device/function). This allows up to 256 buses, each with up to 32 devices, each supporting eight functions.

enter image description here

Related Topic