R 3.3 : The Golden Rule of Ordering: Why PCIe Receivers Mandate Strict TLP Sequences.

In the PCIe Data Link Layer, preventing data corruption via LCRC checks is only half the battle. The other half is ensuring packets don’t disappear into thin air. To solve this, the architecture enforces a strict, unbreakable law: Transaction Layer Packets (TLPs) must be successfully received in the exact order they were transmitted.

Here is a closer look at why this “golden rule” is so critical to PCIe architecture, and the aggressive steps the receiver takes to enforce it.

The Origin: Why Order Matters

Why is in-order delivery so critical? The ordering requirements for PCIe transactions are actually inherited from the original PCI specification and the Producer/Consumer programming model.

A receiver is required to strictly preserve this original sequence to maintain correct program flow. More importantly, keeping packets in order prevents potentially fatal system errors, avoiding complex deadlock and livelock conditions that can crash a system.

Enforcing the Rule: The NEXT_RCV_SEQ Counter

To ensure packets are arriving precisely in order, the receiver utilizes a 12-bit tracking counter known as NEXT_RCV_SEQ (Next Receive Sequence). This counter tracks the exact Sequence Number the receiver expects to see next.

Every time a TLP arrives, the receiver compares the packet’s embedded Sequence Number against its NEXT_RCV_SEQ count. Based on this check, the receiver enforces the ordering rule through three distinct scenarios:

  • 1. The Perfect Match (In-Sequence): If the TLP’s Sequence Number perfectly matches the NEXT_RCV_SEQ count, the packet arrived exactly when expected. It is accepted and forwarded to the Transaction Layer, and the expected sequence counter is incremented by one.
  • 2. Catching a Lost Packet (Out-of-Sequence): If the incoming number is logically larger (later) than the expected count—for example, expecting packet 30 but receiving packet 31—the receiver instantly knows a packet was lost or dropped earlier. Because TLPs must be accepted in order, the receiver discards this out-of-sequence packet, regardless of whether it had any actual data errors. A “Nak” is then scheduled to force the transmitter to replay the missing data.
  • 3. The Harmless Duplicate: If the incoming number is logically smaller (earlier) than expected, it is a duplicate TLP that the receiver has already processed. The receiver silently discards the duplicate and sends an Ack containing the Sequence Number of the last good TLP it received, reminding the transmitter of its furthest progress.

The Waiting Game: Discarding the Pipeline

The receiver’s dedication to the golden rule is absolute. When the receiver detects a bad or missing TLP, it doesn’t just discard the single out-of-sequence packet. It actively discards all new TLPs that follow it in the pipeline. The receiver will stubbornly drop every single TLP it receives while waiting for the lost or corrupted packet to be successfully replayed by the transmitter.

Summary The golden rule of ordering is the ultimate safety net for PCIe data flow. By requiring that TLPs arrive sequentially and strictly discarding any packet that jumps the line, the Data Link Layer guarantees that a missing packet will never slip through unnoticed, ensuring a perfectly ordered, reliable flow of information.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top