PCIe Chapter 8: Link Training and Reliable Delivery

One adjacent LinkTime runs downwards. Training and credit checks precede transmission. Acknowledgement and receive-space updates serve separate purposes; their illustrated order is an example.Endpoint 03:00.0Switch port 02:01.0Train and initialize this LinkCheck receive-buffer creditsSend packet; keep replay copyCheck packet; acknowledge receptionLater in this example: advertise released space
Authored normal-flow example for Base 6.0 Non-Flit Mode, which provides reliable delivery of individual transaction packets. Acknowledgement and credit updates have separate purposes; their illustrated relative order is not a protocol requirement.

PCIe transmission depends on Link training, receive-buffer credits, and reliable delivery. This chapter uses evidence from both ends of one Link to distinguish supported speeds, the configured limit, and the negotiated result, then separates credit accounting (receive-buffer space) from replay (link-level retransmission).

Full Chinese tutorial · 繁體中文 · Course roadmap

Reading route: Figure 4-48 for training → Figure 3-2 for data-link initialization → Figures 7-38, 7-39, and 7-29 for speed → Tables 2-44/2-45 for buffer credits → Figures 3-17, 3-21, and 3-22 for delivery and acknowledgement.

Link training and Function readiness are separate stages

The Physical Layer Link Training and Status State Machine (LTSSM) establishes receive synchronization, Lane relationships, and Link width. The main initial path is Detect, Polling, Configuration, and L0. Configuration here is a training state, not Base Address Register (BAR) programming. Recovery restores synchronization or changes speed. Its entry reason and subsequent state explain which operation is taking place.

During initial Link establishment, once the Physical Layer is operational, the Data Link Layer still completes applicable Feature Exchange and Virtual Channel 0 (VC0, the default transmission resource group) Flow Control initialization before DL_Active (the active data-link state). Configuration readiness, BAR (device-resource base address) setup, and Direct Memory Access (DMA) preparation are separate conditions. Data Link Layer Packets (DLLPs) remain between adjacent Link partners; Transaction Layer Packets (TLPs) can traverse Switches to another component.

BAR
Base Address Register
State-machine reading route

§3.1–§3.4, Figures 3-1/3-2 (pp.263–276); §4.2.6.1–§4.2.6.5 (pp.444–445), Figure 4-48 (p.454), Table 4-48 (p.453); §6.6.1 (p.721).

Read supported speeds, the target, and current speed

Evidence from both ends of one Link
FieldDownstream PortEndpoint
Link Capabilities 2, 0x9C0x0180001E0x0180001E
Maximum Link Width, decoded8 lanes4 lanes
Link Control 2, 0xA00x0003Its Target is not used here for normal speed control
Link Status, 0x820x20430x0043

Figure 7-38/Table 7-35: (0x0180001E & 0xFE) >> 1 = 0x0F, so both ends support 2.5, 5, 8, and 16 GT/s. Figure 7-39/Table 7-36: Downstream Port Target=3 limits normal operation to 8 GT/s. Figure 7-29/Table 7-26: Current=3 and Width=4 give 8 GT/s ×4, consistent with that limit and the Endpoint width. Maximum implemented width also need not equal physically wired width.

The example Downstream Port supports Link Active reporting, making Status bit 13=1 evidence of DL_Active (the active data-link state). The Endpoint does not implement that reporting; its zero is not evidence of disconnection. Current Speed/Width are undefined when the Link is not up. Retrain Link triggers on a write of 1 and always reads zero; inspect applicable Training/Active status and final Speed/Width instead. Link Training is Reserved in Endpoints.

Fields and applicability

Figure 7-27/Table 7-23 (p.967); Figure 7-29/Table 7-26 (pp.978–979); Figures 7-38/7-39, Tables 7-35/7-36 (pp.998–1002); Retrain Link: Table 7-24 (pp.972–973).

Use LinkUp to decide whether Recovery requires reinitialization

A Link already in DL_Active can pass through Recovery and return to L0 while retaining its data-link state. Find the observed path in Figure 4-48, then read Table 4-48: both Recovery and L0 report LinkUp=1. LinkUp is the Physical Layer indication to the Data Link Layer. Under §3.2.1, DL_Active transitions to DL_Inactive when Physical LinkUp becomes zero. This condition connects the two state machines.

[Simulated data] These teaching records do not represent a particular device or platform.Both cases observe the same Non-Flit Mode Link between 02:01.0 and 03:00.0, initially in DL_Active. Assume a complete record of the transition, with no separate Reset or Link Disable operation. This is a state-history summary, not a Register dump.

On narrow screens, scroll the table horizontally to read all columns.

Follow the Physical Layer path into the data-link rules
Evidence to readCase ACase B
LTSSM main-state pathL0 → Recovery → L0L0 → Recovery → Detect → Polling → Configuration → L0
LinkUp in Table 4-48Remains 1 throughout.Zero in Detect and Polling; still zero on entry to Configuration from Polling, then 1 after Link establishment.
Figure 3-2 / §3.2.1Remains in DL_Active. Transmission may still pause while the Physical Layer cannot accept packets.Enters DL_Inactive, resets data-link state, and discards Retry Buffer contents (saved retransmission copies). On recovery, completes applicable DL_Feature and DL_Init processing before DL_Active.
Next, read §3.4 / §3.4.1This path does not trigger another InitFC sequence.Entering DL_Init starts Flow Control initialization for VC0 again.
LTSSM
Link Training and Status State Machine

Finally, compare software-visible status in Table 7-26. Data Link Layer Link Active is 1 only in DL_Active, and only a Port supporting this reporting provides a meaningful value. The example uses the reporting-capable Downstream Port. Reading 1 before and after the event does not reveal a transition between those samples. DL_Up in Figure 3-2 is a separate status output: DL_Init already reports DL_Up during FC_INIT2, while TLP transmission on that VC must still wait for initialization to complete.

TLP
Transaction Layer Packet
VC
Virtual Channel

Connect Figure 4-48, Table 4-48, and Figure 3-2 to establish whether reinitialization is required. Control writes, errors, and packet records are then needed to explain the Recovery trigger and the outcome of each Transaction.

Sources and applicability

Base 6.0 §4.2.6.4 Recovery Overview (PDF/printed p.445); Table 4-48 Link Status Mapped to the LTSSM (p.453, including footnote 72); Figure 4-48 Main State Diagram for Link Training and Status State Machine (p.454); Figure 3-2 Data Link Control and Management State Machine, §3.2.1 Data Link Control and Management State Machine Rules (pp.265–268); §3.4 Flow Control Initialization Protocol / §3.4.1 Flow Control Initialization State Machine Rules (pp.270–273); Table 7-26 Link Status Register (p.979). PDF viewer and printed page numbers match for these references.

Credits manage space; replay protects this hop

In Non-Flit Mode, each Virtual Channel separately tracks Header and Data credits for Posted, Non-Posted, and Completion traffic: six classes. One Data credit represents 16 bytes; Headers are accounted separately. An authored VC0 (default Virtual Channel) example starts with finite, unscaled available Posted Header (PH)=2 and Posted Data (PD)=5, without competing traffic. A 64-byte Memory Write (MWr) consumes 1 PH (Posted Header) and 4 PD (Posted Data), leaving 1/1. A following 32-byte MWr (Memory Write) requires 1/2 and waits until available PD increases by 1. This is an available-credit ledger, not a standard software-readable Register or a minimum initial advertisement.

A 256-byte Memory Read (MRd) request has no data Payload and needs only one Non-Posted Header (NPH) credit; its return traffic consumes Completion credits in the opposite direction. Sufficient credits do not guarantee immediate scheduling: ordering and arbitration still apply.

Non-Flit sequence numbers, LCRC (Link Cyclic Redundancy Check, the error-checking code), ACK/NAK (positive/negative acknowledgement), and replay provide adjacent-Link reliability. The transmitter retains copies; a NAK (negative acknowledgement) or acknowledgement timeout can cause replay. The receiver handles duplicate copies, and the Transaction Layer does not charge new credits again for the same TLP (Transaction Layer Packet). An ACK (positive acknowledgement) on one hop is neither a transaction Completion nor device-work completion. Posted MWr has no ordinary Completion but still receives Link-level protection.

FC and replay sources

§2.6.1, Tables 2-44/2-45 (pp.236–237); Figures 3-9–3-11 (pp.283–284); §3.1 (p.264), Figure 3-17 (p.288), Figures 3-21/3-22 (pp.299, 303).

Flit Mode uses a fixed transport unit

64 GT/s uses Flit Mode, which can also operate at lower rates. A 256-byte Flit contains 236 bytes for TLPs, 6 for Data Link Layer Payload (DLP), 8 for Cyclic Redundancy Check (CRC), and 6 for Error Correction Code (ECC). TLPs can span Flits, and multiple TLPs can share one Flit; the TLP region is not all application data. Replay operates at Flit granularity. Forward Error Correction (FEC) neither eliminates replay nor corrects every possible error.

Check Flit Mode Supported in PCI Express Capabilities before interpreting Downstream Port Link Status 2. A projection containing only Presence and the Flit bit of 0x4400 means Presence=100b and Flit=1: Link up, with no Device Readiness Status (DRS) received yet. A projection of 0x3400 means negotiation has completed but the Data Link Layer is not active. These are field projections, not full dumps; the Flit bit is meaningful only for Presence=011b, 100b, or 101b.

Flit sources

§4.2.3 (p.340), §4.2.3.3–§4.2.3.4 (pp.351–390), Figure 4-33 (p.383); Table 7-19 (p.955), Figure 7-40/Table 7-37 (pp.1004–1007). This chapter uses Base 6.0 without silently incorporating later Engineering Change Notices (ECNs).

Follow a different packet through the same Link

Which credits does a read request use?

MRd (Memory Read) checks NPH (Non-Posted Header credit); other transmission conditions still apply. (Table 2-45, p.237.)

Where does this Link’s acknowledgement fit in the full path?

ACK (positive acknowledgement) covers adjacent-Link delivery. Final visibility, ownership, and work completion depend on their respective interfaces.

Jia-Chang

Jia-Chang

Human

Comments

  Write a comment ...