PCIe Chapter 1: Topology, Transaction Roles, and Per-Link Observations

Start with the components, Ports, and Links in one topology. Follow a Memory Read and its response to distinguish topological names from transfer roles, then use configuration fields to compare capability, current operation, and software identity.

Find Function 03:00.1All BDFs are in Segment 0000. Solid lines are external Links; dashed lines are internal logical connections.Root Port00:01.0 · 01–04Switch Upstream Port01:00.0 · 02–04Downstream Port A02:01.0 · 03–03Downstream Port B02:02.0 · 04–04Endpoint A03:00.0 / 03:00.1Endpoint B04:00.0LRInternal Bus 02 (logical)LALB
An authored snapshot in Segment 0000. Solid lines are external Links; dashed lines are internal logical connections. Endpoint A has two Functions sharing one Link. Base 6.0 Figures 1-3/7-2, printed/PDF pp.107 and 904.

Full Chinese tutorial and topology diagram · Course roadmap · 繁體中文

Record cards, Functions, and Links as different objects

A component is one physical package. A Device is a collection of Functions sharing a Bus Number and Device Number within a hierarchy. A Function is individually addressable in Configuration Space; a Port interfaces a component to a Link.

A Link comprises two adjacent Ports and their interconnecting Lanes. Each Lane has one transmit differential pair and one receive differential pair. An x4 Link has four Lanes. In this example, A's two Functions share one Port and LA; two configuration targets do not create two external Links.

The diagram uses Endpoint A as a label for the component providing Endpoint Functions. Formally, Endpoint is a Function type. Card assembly, packages, configuration targets, and external connections answer different questions.

Base 6.0, Terms and Acronyms: component, Device, Function, Lane, Link, and Port, document/PDF pp.83–85, 87, 89; §1.2, pp.100–102.

Which roles remain the same during a Read and its response?

The Switch Upstream Port faces the Root Complex; its Downstream Ports face the downstream branches. These names follow topology. The Requester initiates the transaction, while the Completer handles the original Request and produces the required response. Transmitter and Receiver describe an individual Link transfer.

Follow one Read across two Links

Select a step to highlight its part of the diagram. The full diagram and all explanations remain visible. Use the arrow keys within the step controls.

Follow the Request from A to the host, then the Completion back. Reassign the transmitting and receiving ends for each Link transfer. LA and LR are the Link labels used in this chapter.

Transaction roles and directions for one Memory ReadAn Endpoint Request traverses LA to the Switch Downstream Port, then LR from the Switch Upstream Port to the Root Port. The Completion returns over the same two Links. Dashed horizontal arrows denote internal Switch forwarding.Endpoint A PortFunction 1Switch DP ADownstream PortSwitch UPUpstream PortRoot PortRoot ComplexLA: Memory ReadSwitch forwardingLR: Memory ReadLR: CompletionSwitch forwardingLA: CompletionRequest: Upstream → Root Complex · Completion: Downstream → Endpoint
Author-created sequence diagram based on the cited rules. Read from top to bottom; spacing does not represent measured latency. Solid arrows cross LA or LR; dashed arrows show internal Switch forwarding. DP and UP mean Downstream Port and Upstream Port.

Port names follow topology. Transmitter and Receiver follow a particular transfer. The Requester for the same Read does not change when it starts receiving its Completion.

  1. A sends the Request over LA

    The teaching example reads host memory and receives one Completion. Arbitration, replay, and unrelated traffic are omitted.

    Function 1 in Endpoint A is the Requester, the Function that initiates the transaction. On LA, A's Port is the Transmitter and Switch Downstream Port A is the Receiver. The Request moves upstream, toward the Root Complex.

    Base 6.0 Terms and Acronyms — Requester、Receiver、Transmitter、Upstream,document/PDF pages 90、93–94;Figure 1-3,p.107。

  2. The Switch forwards the Request over LR

    The observation point moves from LA to LR. The Switch forwards this Request rather than originating another transaction.

    The Switch sends the Request from its Upstream Port to the Root Port. The transmitting and receiving Ports have changed, but Function 1 in A remains the original Requester. Internal forwarding does not add an external Link.

    Base 6.0 §1.3.3/Figure 1-3,p.107;§2.2.6.2,p.157 — the Switch preserves the Transaction ID。

  3. The host-side Completer returns a Completion over LR

    The example assumes the Read was handled and a data response is being returned. A transfer on one Link alone is not evidence that every transaction succeeded.

    The Completer, the Function that handles the Request and produces its response, is on the Root Complex side. The Root Port now transmits and the Switch Upstream Port receives. Traffic moves downstream; the Upstream Port keeps its topological name.

    Base 6.0 Terms and Acronyms — Completer、Completion、Downstream、Receiving/Transmitting Port,document/PDF pages 82–84、90、93。

  4. The Completion returns to A over LA

    This is the return path of the same Read. Completion-field and integrity checks are developed in the transaction chapters.

    Switch Downstream Port A transmits the Completion and A's Port receives it. Function 1 in A is still the original Requester, now receiving its response. Requester does not mean the end currently transmitting a packet.

    Base 6.0 Terms and Acronyms — Requester、Completer、Completion;§1.3.3/Figure 1-3,document/PDF pages 82–83、90、107。

The example stays within one Root Port's downstream path. It does not generalize ordinary Switch forwarding to the special rules for Root Complex forwarding between Root Ports.

Base 6.0, Terms and Acronyms, document/PDF pp.82–84, 90, 93–94; §1.3.1, pp.103–104; §1.3.3/Figure 1-3, p.107; §2.2.6.2, p.157.

Does A's 64.0 GT/s capability describe the entire host path?

Compare the two Ports on each Link, then record current speed and width separately. These decoded teaching values assume the Links are up and both ends were observed at the same time. Target settings, training history, and board wiring are not supplied.

Teaching snapshot: capability, common limits, and current results
LinkMaximum speed / width at each endCommon maximum speed and width limitMatching current reports
LRRoot Port: 32.0 GT/s, x8
Switch Upstream Port: 32.0 GT/s, x8
32.0 GT/s, x832.0 GT/s, x8
LADownstream Port A: 64.0 GT/s, x8
Endpoint A Port: 64.0 GT/s, x8
64.0 GT/s, x816.0 GT/s, x4
LBDownstream Port B: 16.0 GT/s, x4
Endpoint B Port: 16.0 GT/s, x4
16.0 GT/s, x48.0 GT/s, x4

Read LA first. Both Ports support 64.0 GT/s and x8, but currently operate at 16.0 GT/s and x4. Capability and current operation are different observations. Explaining this result requires valid control settings, wiring information, and training history.

Then follow LR. The host path also crosses LR, whose two Ports support up to 32.0 GT/s. Each Link trains and operates separately; the path does not negotiate one shared speed. Endpoint capability alone cannot describe the intervening Link.

This table does not predict application performance. Workload, other branch traffic, packet overhead, and transport behavior also affect progress.

  1. Locate capability fields
    Figure 7-27/Table 7-23: Max Link Speed and Maximum Link Width. Figure 7-38/Table 7-35: Supported Link Speeds Vector.
  2. Locate current results
    Figure 7-29/Table 7-26: Current Link Speed and Negotiated Link Width. Their definitions depend on the Link being up.
  3. Return each value to its Link
    Compare adjacent Partners before moving to the next Link. Keep controls, current results, and event records separate.

This is a specification-reading route, not a training timeline. The complete field-offset and speed-decoding example remains in Chapter 0.

Capability and status sources

Base 6.0 §7.5.3.6 Link Capabilities Register (Offset 0Ch), Figure 7-27/Table 7-23, document/PDF pp.966–969; p.967 permits Maximum Link Width to exceed actual wiring. §7.5.3.18 Link Capabilities 2 Register (Offset 2Ch), Figure 7-38/Table 7-35, p.998, defines Supported Link Speeds Vector. Each example Port supports all rates from 2.5 GT/s through its maximum. §7.5.3.8 Link Status Register (Offset 12h), Figure 7-29/Table 7-26, pp.977–979, defines current results and applicability. Per-Link initialization is described in §1.2, p.102.

Is a PCI/PCI-X Bridge the same component as a Switch?

No. A PCI Express to PCI/PCI-X Bridge connects a PCI Express fabric to a PCI/PCI-X hierarchy. A Switch instead appears as an assembly of virtual PCI-to-PCI Bridges forwarding transactions among PCIe Ports. Both can expose Bridge structures in Configuration Space, so a Bridge Header alone does not establish the component type: check Device/Port Type and the actual downstream connection.

Teaching example: if a topology shows a PCI Express to PCI/PCI-X Bridge below a PCIe Port, identify its PCIe side and PCI/PCI-X side before selecting protocol and configuration rules. Do not draw the downstream PCI/PCI-X bus as another PCIe Link, or infer a Switch Downstream Port from Header Type alone. This is an identification starting point; the complete conversion and exceptions require the applicable Bridge specification.

Base 6.0 §§1.3.3 and 1.3.5, Figure 1-3, pp.106–108; Device/Port Type: §7.5.3.2.

Can Endpoints under different Root Ports always communicate?

Teaching example: Endpoint A and B are below different Root Ports of the same Root Complex (RC). Figure 1-2 places them in different hierarchy domains, so A's access to B must cross the RC. Base 6.0 §1.3.1 makes peer-to-peer routing between hierarchy domains optional and implementation-dependent. Enumerating both Endpoints does not establish that the RC offers this path.

When supported, an RC can use different designs: for example, take ownership of a Request, reform packets as needed and handle returning Completions, or use an internal physical or virtual Switch. Section 1.3.1 generally permits an RC to split packets while routing between domains; §1.3.3 prohibits a Switch from splitting one packet into smaller packets. Each remains subject to its applicable packet rules.

There are exceptions: an RC must not split a Deferrable Memory Write Request; splitting a Vendor-Defined Message is subject to 128-byte boundary conditions. Practical analysis also needs platform routing, Bridge Windows, the target BAR and access policy. The topology alone establishes the path through the RC, not delivery to B.

BAR
Base Address Register

Base 6.0 §1.3 and Figure 1-2, pp.102–103; §§1.3.1 and 1.3.3, pp.103–104 and 106–107; Deferrable Memory Write: §6.32.

Why does an Endpoint sometimes have no Link partner?

The add-in card in the earlier example is an Endpoint connected outside a Port. Figure 1-2 also shows a Root Complex Integrated Endpoint (RCiEP) inside the Root Complex. It is still a Function that supports Configuration Requests, but it does not appear in the external hierarchy domains exposed by Root Ports or inside Switches.

Teaching example: suppose a readable Function identifies its Device/Port Type as RCiEP. Check fields applicable to that type: an RCiEP must not implement Link Capabilities, Link Control, Link Status, or their version 2 registers. Missing those registers does not establish that an external Link failed. A different Device/Port Type needs its own applicability rules.

An RCiEP may be associated with an optional Root Complex Event Collector (RCEC), which terminates error and PME (Power Management Event) messages from associated RCiEPs. Check the RCEC's Endpoint Association Extended Capability to establish an association. RCECs are optional; do not assume every RCiEP has one. If an RCiEP is associated with an RCEC, it must signal PME and errors through that RCEC and cannot be associated with more than one.

All three Endpoint types use a Type 0 Configuration Header, but their constraints differ. Compare §§1.3.2.1–1.3.2.3 before applying a field-specific rule.

On a phone, scroll the table horizontally to see all columns.

Function typeI/O Request ruleMemory Requester addressing capability
Legacy EndpointMay generate I/O Requests and may support them as CompleterNot required to generate addresses at or above 4 GB
PCI Express EndpointMust not generate I/O Requests or depend on OS allocation of I/O resources claimed through BARsMust be capable of generating addresses greater than 4 GB
RCiEPMust not generate I/O Requests or require I/O resources claimed through BARsMust generate addresses covering what the Host can handle as Completer

These rules describe Function roles and capabilities. The address used by one Request is not the Function's complete addressing capability.

Base 6.0 §1.3 and Figure 1-2, pp.102–103; §§1.3.2.1–1.3.2.3 and 1.3.4, pp.104–106 and 108; Device/Port Type: §7.5.3.2.

Which two fields establish a Function's role?

At the selected Function, read the 8-bit Header Type at offset 0x0E. The low seven bits select the header layout and bit 7 indicates possible multiple Functions. Then locate the PCI Express Capability and read its 16-bit register at base + 0x02; Device/Port Type in bits 7:4 identifies the role. The first field selects the layout used to read the second.

Decode the header format separately from the PCIe role
TargetHeader Type readDevice/Port Type fieldInterpretation
Endpoint A, Function 00x800x0Type 0 header; may have multiple Functions; PCI Express Endpoint.
Root Port0x010x4Type 1 header; Root Port.
Switch Upstream Port0x010x5Type 1 header; Switch Upstream Port.
Switch Downstream Port0x010x6Type 1 header; Switch Downstream Port.
Header format: 0x80 & 0x7F = 0
Multi-Function Device: (0x80 & 0x80) >> 7 = 1
Device/Port Type: (PCIe_Capabilities & 0x00F0) >> 4

The value 0x80 means neither “Type 128” nor “eight Functions are present.” A set Multi-Function Device bit means that the device may contain multiple Functions. Actual Function presence still needs discovery evidence. Endpoint A here means the component providing Endpoint Functions; the example separately assumes that both Function 0 and Function 1 of that component have been found.

Which figures and tables should be read first?

Start with Base 6.0 §7.5.1.1.9, Figure 7-8 and Table 7-7 (pp.924–925), to separate the header format from bit 7. Then use Figure 7-21 (p.952) to locate the Register within the Capability, followed by Figure 7-23 and Table 7-19 (pp.953–954) for Device/Port Type. A Type 1 header identifies the bridge layout but does not by itself distinguish a Root Port from a Switch Port.

Device/Port Type identifies a Function type. An RCiEP has a Type 0 Header but must not implement the listed Link Capabilities/Control/Status registers or their corresponding 2 registers. Before interpreting Data Link Layer Link Active, check Reporting Capable: a hardwired zero can mean reporting is not implemented, rather than an inactive Link. (Base 6.0 §1.3.2.3, pp.105–106; Table 7-19, pp.953–954; Tables 7-23 and 7-26, pp.969, 979.)

Which downstream path reaches 0000:03:00.1?

The example places a Root Port and a Switch with two Downstream Ports in Segment 0000. Endpoint A's two Functions are on Bus 03, while Endpoint B is on Bus 04. The table is a snapshot of an already configured topology. This chapter interprets the result; assigning Bus Numbers belongs to the enumeration chapter.

Teaching snapshot: Bridge BDFs and downstream Bus ranges (all numbers are hexadecimal)
Bridge roleBDF in Segment 0000SecondarySubordinateDownstream components in this example
Root Port00:01.00104The Switch and both of its branches.
Switch Upstream Port01:00.00204The two Downstream Ports on internal Bus 02.
Switch Downstream Port A02:01.00303Endpoint A: 03:00.0 and 03:00.1.
Switch Downstream Port B02:02.00404Endpoint B: 04:00.0.
BDF
Bus/Device/Function

Secondary Bus Number identifies the Bus immediately downstream of a Bridge. Subordinate Bus Number bounds the upper end of its downstream Bus Number range. Target Bus 03 is within the Root Port's 01–04, the Upstream Port's 02–04, and Downstream Port A's 03–03 ranges. Downstream Port B covers only 04–04, so it is outside the path to this target.

These ranges check the known topology; they do not establish that every number in a range has a populated Bus. A Bridge's own BDF (Bus, Device, and Function identifier) also differs from the Bus it leads to: 02:01.0 is on Bus 02 and has Secondary 03. This chapter does not derive a Bridge's own BDF from Primary Bus Number. Base 6.0 retains that field for legacy compatibility, and PCIe generally does not use it.

BDF
Bus/Device/Function
Where are the downstream Bus Number fields?

Base 6.0 §7.5.1.3, Figure 7-14 (p.936), shows the Type 1 Header. Secondary and Subordinate are 8-bit fields at byte offsets 0x19 and 0x1A, respectively; their meanings are in §7.5.1.3.3–§7.5.1.3.4 (p.937). The neighboring Primary field is at 0x18, with its PCIe compatibility explanation in §7.5.1.3.2 on the same page.

What information do BDF, Segment, and Requester ID retain?

Under conventional addressing, BDF contains an 8-bit Bus Number, a 5-bit Device Number, and a 3-bit Function Number. The first four digits of 0000:03:00.1 identify the Segment; the remaining 03:00.1 is the BDF within that Segment. These numbers describe a logical identification location, not a physical slot number.

Matching or similar numbers can refer to different Functions
IdentifierObject in this exampleDistinction to preserve
0000:03:00.0Endpoint A, Function 0.The next row shares its Bus and Device but has a different Function.
0000:03:00.1Endpoint A, Function 1.Use this Function's own Configuration Space reads.
0001:03:00.0An Endpoint in another Segment.Its BDF matches the first row, but its Segment differs.

As a further teaching assumption, 03:00.0 has also been discovered in Segment 0001. This is a second logical scope created for the example, not a downstream branch of the preceding table. Dropping the Segment would incorrectly merge distinct records.

When 0000:03:00.1 originates a Request, its 16-bit Requester ID is formed as follows in this example:

Requester ID = (Bus << 8) | (Device << 3) | Function
             = (0x03 << 8) | (0x00 << 3) | 0x1
             = 0x0301

Example deduction: 0x0301 preserves the BDF but does not encode Segment 0000 into those 16 bits. This conclusion applies only to the Requester ID field. It does not mean that all PCIe packets lack Segment information: some Base 6.0 Flit Mode packets have separate related fields. BDF is also not a permanent hardware identity. If records come from different configurations at different times, matching or changed BDF values alone cannot establish whether they describe the same physical device.

Specification locations for identification scope and bit allocation

Conventional BDF: Base 6.0 §7.3.1 (p.911), §2.2.4.2 and Table 2-8 (p.147), and Figures 2-20 and 2-22 (p.148). Requester ID: §2.2.6.2 (pp.156–157); p.156 describes the 16-bit identifier and Bus/Device Numbers that can change at runtime, while p.157 separately discusses Segment fields. Segment Group scope: Firmware 3.3 §1.3 (pp.8–9) and §4.3.2.3 (p.47).

What evidence should the next observation include?

For a speed/width report, retain the Port, its direct Partner, the time, and the field name. For a tool's Endpoint label, return to Header Type and Device/Port Type. For one captured Request, identify the Link and direction before assigning transfer roles. These records let later training, error, and Completion evidence refer to the same object.

The simulated snapshot supplies neither a full training history nor a unique fault diagnosis. BDF is not used as a permanent hardware identity.

With these identifiers understood, the next step is a systematic approach to querying a Function's Configuration Space and Capabilities. The full Chapter 1 Chinese tutorial provides the topology diagram, expanded interpretation, and source references. Continue with Chapter 2 on Configuration Space and Capabilities.

Jia-Chang

Jia-Chang

Human

Comments

  Write a comment ...