Notes on PCIe
- Notes on PCIe
- PCIe Basics and Background
- How multiple root complexes are handled
- Interpreting PCIe Device to CPU Locality Information
- What is the PCIe PHY
- Human readable overview of how PCIe works
- How does ID-based Ordering (IDO) Work?
- How does transaction ordering work?
- What is a PCIe Root Complex?
- How does PCIe Enumeration Work?
- NVMe over PCIe vs Other Protocols
- What is a PCIe Function?
- PCIe-Bus and NUMA Node Correlation
- How does the root complex work?
- What is PCIe P2P?
- What is Relaxed Ordering
- What is a traffic class (TC)?
- PCIe BAR Register
- How NVMe Drive Opcodes Work
- How does SR-IOV work?
- PCIe Bridge vs Switch
- PCIe Configuration Space
- PCIe Switches
- How to Check CPU Affinity
PCIe Basics and Background
Section titled “PCIe Basics and Background”https://pcisig.com/sites/default/files/files/PCI_Express_Basics_Background.pdf#page=26
How multiple root complexes are handled
Section titled “How multiple root complexes are handled”Interpreting PCIe Device to CPU Locality Information
Section titled “Interpreting PCIe Device to CPU Locality Information”https://dshcherb.github.io/2019/02/02/interpreting-pcie-device-to-cpu-locality-information.html
What is the PCIe PHY
Section titled “What is the PCIe PHY”https://www.linkedin.com/pulse/pci-express-depth-physical-layer-luigi-c-filho-/
Human readable overview of how PCIe works
Section titled “Human readable overview of how PCIe works”http://xillybus.com/tutorials/pci-express-tlp-pcie-primer-tutorial-guide-1/ http://xillybus.com/tutorials/pci-express-tlp-pcie-primer-tutorial-guide-2
How does ID-based Ordering (IDO) Work?
Section titled “How does ID-based Ordering (IDO) Work?”https://blog.csdn.net/weixin_48180416/article/details/115790068
How does transaction ordering work?
Section titled “How does transaction ordering work?”What is a PCIe Root Complex?
Section titled “What is a PCIe Root Complex?”https://www.quora.com/What-is-a-PCIe-root-complex?share=1
How does PCIe Enumeration Work?
Section titled “How does PCIe Enumeration Work?”NVMe over PCIe vs Other Protocols
Section titled “NVMe over PCIe vs Other Protocols”What is a PCIe Function?
Section titled “What is a PCIe Function?”PCIe-Bus and NUMA Node Correlation
Section titled “PCIe-Bus and NUMA Node Correlation”How does the root complex work?
Section titled “How does the root complex work?”What is PCIe P2P?
Section titled “What is PCIe P2P?”https://xilinx.github.io/XRT/master/html/p2p.html
What is Relaxed Ordering
Section titled “What is Relaxed Ordering”What is a traffic class (TC)?
Section titled “What is a traffic class (TC)?”https://www.oreilly.com/library/view/pci-express-system/0321156307/0321156307_ch06lev1sec6.html
PCIe BAR Register
Section titled “PCIe BAR Register”How NVMe Drive Opcodes Work
Section titled “How NVMe Drive Opcodes Work”https://stackoverflow.com/questions/30190050/what-is-the-base-address-register-bar-in-pcie https://stackoverflow.com/questions/19006632/how-is-a-pci-pcie-bar-size-determined
- BIOS/OS discovers whether PCIe device exists
- Places the addresses for mmio or I/O port addresses in NVMe drive‘s BAR registers (which it figures out from the configuration registers)
- It seems from the documentation I found NVMe does this through 64bit mmio
- Driver establishes the admin queue via BAR0. The admin queue’s base addresses are in ASQ and ACQ respectively
- I submit commands to the admin submission queue to establish I/O queues.
- Send/receive data via I/O queues.
How does SR-IOV work?
Section titled “How does SR-IOV work?”Architecture: https://docs.microsoft.com/en-us/windows-hardware/drivers/network/sr-iov-architecture
PCIe Bridge vs Switch
Section titled “PCIe Bridge vs Switch”wke…@gmail.com wrote:
I would appreciate of someone can explain the difference between a PCI bridge and a PCI switch.
With good ol’ PCI, a single bus can have many devices. A PCI bridge is a device that connects multiple buses together, which is something that was very seldom needed.
PCI Express looks, for software, very similar to PCI, but is electrically a point-to-point connection, i.e., a PCIe bus has exactly two devices.
To connect PCIe with PCI, you need a PCI/PCIe or PCIe/PCI bridge.
If you have a single PCIe connector and multiple PCIe devices, you need a PCIe switch. A single PCIe connection still is between exactly two devices, so a PCIe switch consists of a (virtual) PCI bridge for the upstream PCIe connection, and one (virtual) PCI bridge for each downstream PCIe connection.
Regards, Clemens
PCIe Configuration Space
Section titled “PCIe Configuration Space”https://bitwiseanne.wordpress.com/2020/05/15/pcie-101-the-root-complex-and-the-endpoint/
PCIe Switches
Section titled “PCIe Switches”How to Check CPU Affinity
Section titled “How to Check CPU Affinity”[root@r7525 ~]# cat /sys/class/pci_bus/0000\:00/cpulistaffinity24-31,88-95[root@r7525 ~]# lscpu | grep -i numaNUMA node(s): 8NUMA node0 CPU(s): 0-7,64-71NUMA node1 CPU(s): 8-15,72-79NUMA node2 CPU(s): 16-23,80-87NUMA node3 CPU(s): 24-31,88-95NUMA node4 CPU(s): 32-39,96-103NUMA node5 CPU(s): 40-47,104-111NUMA node6 CPU(s): 48-55,112-119NUMA node7 CPU(s): 56-63,120-127You can check the CPU affinity of a PCIe bus and then see what processor it is aligned to by referencing the processor ranges.