All Transaction Layer Packet types: encoding, format, use cases, and system applications
TLP Header DW0 (Byte 0):
┌─────────────────────────────────────────────────────────────────┐
│ Bit 7 │ Bit 6 │ Bit 5 │ Bit 4 │ Bit 3 │ Bit 2 │ Bit 1 │ Bit 0 │
│ Fmt[1] │ Fmt[0] │ Type[4]│ Type[3]│ Type[2]│ Type[1]│ Type[0]│ T9 │
└─────────────────────────────────────────────────────────────────┘
Fmt[2:0] (including bit from elsewhere):
00 = 3DW header, no data
01 = 4DW header, no data
10 = 3DW header, with data
11 = 4DW header, with data
Type[4:0] + Fmt determines full TLP type
| Fmt | Type[4:0] | TLP | Description | Class |
|---|---|---|---|---|
| 00 | 0 0000 | MRd | Memory Read (32-bit) | Non-Posted |
| 01 | 0 0000 | MRd | Memory Read (64-bit) | Non-Posted |
| 00 | 0 0001 | MRdLk | Memory Read Locked (32-bit) | Non-Posted |
| 01 | 0 0001 | MRdLk | Memory Read Locked (64-bit) | Non-Posted |
| 10 | 0 0000 | MWr | Memory Write (32-bit) | Posted |
| 11 | 0 0000 | MWr | Memory Write (64-bit) | Posted |
| 00 | 0 0010 | IORd | I/O Read | Non-Posted |
| 10 | 0 0010 | IOWr | I/O Write | Non-Posted |
| 00 | 0 0100 | CfgRd0 | Config Read Type 0 | Non-Posted |
| 10 | 0 0100 | CfgWr0 | Config Write Type 0 | Non-Posted |
| 00 | 0 0101 | CfgRd1 | Config Read Type 1 | Non-Posted |
| 10 | 0 0101 | CfgWr1 | Config Write Type 1 | Non-Posted |
| 00 | 1 0r00 | Msg | Message (various) | Posted |
| 10 | 1 0r00 | MsgD | Message with Data | Posted |
| 00 | 0 1010 | Cpl | Completion (no data) | Completion |
| 10 | 0 1010 | CplD | Completion with Data | Completion |
| 00 | 0 1011 | CplLk | Completion Locked (no data) | Completion |
| 10 | 0 1011 | CplDLk | Completion Locked with Data | Completion |
What: Request to read data from memory address
When: Device wants to read system memory (DMA read)
Where: Any memory-mapped region
Why: Fetch data for processing
What: Write data to memory address
When: Device wants to write to system memory (DMA write)
Where: Any memory-mapped region
Why: Store computed results, transfer data
What: Locked memory read for RMW sequences
When: Legacy atomic operations
Why: Deprecated - use AtomicOps instead
| Fmt | Type | Operation | Operand Size |
|---|---|---|---|
| 01 | 0 1100 | FetchAdd (32-bit) | 32 bits |
| 11 | 0 1100 | FetchAdd (64-bit) | 64 bits |
| 01 | 0 1101 | Swap (32-bit) | 32 bits |
| 11 | 0 1101 | Swap (64-bit) | 64 bits |
| 01 | 0 1110 | CAS (32-bit) | 64 bits (cmp + swp) |
| 11 | 0 1110 | CAS (64-bit) | 128 bits (cmp + swp) |
| 11 | 0 1111 | CAS (128-bit) | 256 bits (cmp + swp) |
What: Read/write to device's configuration space
When: Device enumeration, driver configuration
Where: Terminates at target device
What: Configuration transaction to be routed
When: Accessing devices behind bridges
Where: Converted to Type 0 at target bridge
Type 0 Address Format:
┌─────────────────────────────────────────────────────────────────┐
│ 31:12 │ 11:8 │ 7:2 │ 1:0 │
│ Rsvd │ Ext Reg │ Register Number │ 00 │
└─────────────────────────────────────────────────────────────────┘
Type 1 Address Format:
┌─────────────────────────────────────────────────────────────────┐
│ 31:24 │ 23:16 │ 15:11 │ 10:8 │ 7:2 │ 1:0 │
│ Rsvd │ Bus │ Device │ Function │ Reg │ 01 │
└─────────────────────────────────────────────────────────────────┘
What: Access legacy I/O port space
When: Legacy device compatibility
Why: Support older devices without MMIO
What: Response without data
When: I/O Write, Config Write acknowledgment
What: Response containing requested data
When: Memory Read, Config Read, AtomicOp
| Code | Status | Meaning |
|---|---|---|
| 000 | SC (Successful Completion) | Request completed successfully |
| 001 | UR (Unsupported Request) | Request not supported |
| 010 | CRS (Config Retry Status) | Device not ready, retry later |
| 100 | CA (Completer Abort) | Completer cannot complete |
| r[2:0] | Routing | Description |
|---|---|---|
| 000 | Routed to Root Complex | Goes to RC |
| 001 | Routed by Address | Uses address field |
| 010 | Routed by ID | Uses Bus/Dev/Func |
| 011 | Broadcast from RC | RC broadcasts downstream |
| 100 | Local | Terminates at receiver |
| 101 | Gathered to RC | Aggregated upstream |
| TLP Type | Description | Credit Class |
|---|---|---|
| UIOMRd | UIO Memory Read | Non-Posted |
| UIOMWr | UIO Memory Write | Posted or Non-Posted |
| UIORdCpl | UIO Read Completion | Completion |
| UIORdCplD | UIO Read Completion with Data | Completion |
| UIOWrCpl | UIO Write Completion | Completion |
Processed and removed at each link endpoint. Contains per-link information.
Preserved from requester to completer. Contains end-to-end information.
TLP with Prefix:
┌──────────────────────────────────────────────────────────────┐
│ E2E Prefix 0 │ E2E Prefix 1 │ Local Prefix │ TLP Header ... │
│ (4 DW) │ (4 DW) │ (1 DW) │ │
└──────────────────────────────────────────────────────────────┘
Prefix First DW:
┌──────────────────────────────────────────────────────────────┐
│ Fmt=100/101 │ Type[4:0] │ Prefix-specific content │
│ E2E/Local │ │ │
└──────────────────────────────────────────────────────────────┘
| Use Case | TLP Types Used | Notes |
|---|---|---|
| DMA Read | MRd → CplD | Device reads system memory |
| DMA Write | MWr | Device writes system memory |
| MMIO Read | MRd → CplD | CPU reads device register |
| MMIO Write | MWr | CPU writes device register |
| Device Enumeration | CfgRd0/1 → CplD | Read config space |
| MSI/MSI-X | MWr | Interrupt via memory write |
| Lock-free Queue | AtomicOp (CAS) → CplD | Compare-and-swap |
| Reference Count | AtomicOp (FetchAdd) → CplD | Atomic increment |
| Power Event | Msg (PM_PME) | Wake signal |
| Error Report | Msg (ERR_*) | Error notification |
| CXL Memory | DfMRd → DfCplD | Deferrable for latency hiding |