A Locked Read is a special kind of Memory Read that is part of an atomic Read-Modify-Write operation — meaning it ensures that no one else can touch that memory location until the operation is complete.

Example use case:


How PCIe Handles This

Unlike ordinary memory reads, a locked read:


Step-by-Step Flow

  1. Root Port Sends a Locked Read Request (MRdLk)

    • The packet includes the memory address and a “lock” indicator.
    • It is routed through switches toward the target memory (or legacy endpoint).
  2. Egress Port Locking

    • At each switch or routing device (called a service point), the egress port used by this request is “locked.”
    • This means no other packets are allowed to traverse that path toward the destination until the locked transaction is completed.
  3. Target Completer Responds

    • The target gathers the data and returns Locked Completion TLPs back to the Requester.
    • These Completions are marked as “locked,” keeping the path locked until they all return.
  4. If an Error Occurs

    • The Completer sends a locked completion without data and sets an error status.
    • The Requester (CPU) understands this means the lock failed.
    • Software decides what to do — retry, abort, or handle the error in some other way.
  5. Unlocking

    • Once the locked Completion(s) are delivered, the path is unlocked so that normal traffic can resume.

Legacy Support


Key Takeaways

PCIe Locked Read Transaction Protocol.png