wire / wire-format / nvme-command
NVMe commands are 64-byte structures submitted via submission queues (SQ). The command: opcode (1 byte), flags (1 byte), command ID (2 bytes), NSID (4 bytes), reserved (4 bytes), metadata pointer (8 bytes), data pointers (PRP1, PRP2, 8 bytes each), and 24 bytes of command-specific (CDW10-CDW15). Common opcodes: 0x00 Flush, 0x01 Write, 0x02 Read, 0x04 Write Uncorrectable, 0x05 Compare, 0x06 Write Zeroes, 0x08 Dataset Management, 0x09 Verify, 0x0C Copy.
aka: NVMe (NVM Express) command structure
spec: NVMe 2.0 specification
NVMe commands are 64-byte structures submitted via submission queues (SQ). The command: opcode (1 byte), flags (1 byte), command ID (2 bytes), NSID (4 bytes), reserved (4 bytes), metadata pointer (8 bytes), data pointers (PRP1, PRP2, 8 bytes each), and 24 bytes of command-specific (CDW10-CDW15). Common opcodes: 0x00 Flush, 0x01 Write, 0x02 Read, 0x04 Write Uncorrectable, 0x05 Compare, 0x06 Write Zeroes, 0x08 Dataset Management, 0x09 Verify, 0x0C Copy.
| field | size | meaning |
|---|---|---|
| Opcode | 1 byte | 0x00 Flush, 0x01 Write, 0x02 Read, 0x04 Write Uncorrectable, 0x05 Compare, 0x06 Write Zeroes, 0x08 Dataset Management, 0x09 Verify, 0x0C Copy. Admin commands: 0x00 Delete I/O Submission Queue, 0x01 Create I/O Submission Queue, 0x02 Get Log Page, 0x04 Delete I/O Completion Queue, 0x05 Create I/O Completion Queue, 0x06 Identify, 0x08 Abort, 0x09 Set Features, 0x0A Get Features, 0x0C Asynchronous Event Request, 0x10 Firmware Commit, 0x11 Firmware Image Download, 0x14 Keep Alive, 0x18 Directive Send, 0x19 Directive Receive, 0x1C Virtualization Management, 0x1D NVMe-MI Send, 0x1E NVMe-MI Receive. |
| Flags (FUSE) | 1 byte | Bit 0: FUSE (fused operation), bits 1-2: reserved, bits 3-7: PSDT (PRP/SGL data transfer type). |
| Command ID | 2 bytes (uint16) | Command identifier (echoed in the completion queue entry). |
| NSID | 4 bytes (uint32) | Namespace ID (1-based; 0xFFFFFFFF for all namespaces). |
| Reserved | 4 bytes | Reserved (must be 0). |
| Metadata pointer (MPTR) | 8 bytes (uint64) | Physical address of metadata (for end-to-end data protection). |
| PRP1 | 8 bytes (uint64) | Physical Region Page entry 1 (data buffer address, page-aligned). |
| PRP2 / SGL | 8 bytes (uint64) | PRP2 (second page) or SGL descriptor (if PSDT indicates SGL). |
| CDW10-CDW15 | 24 bytes (6 x uint32) | Command-specific: for Read/Write: starting LBA (CDW10-11), number of logical blocks (CDW12), ... . |
example:
02 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
NVMe Read command (opcode 0x02), command ID 0, NSID 1
agent: curl -H 'accept: application/json' wire.phall.io/wire-format/nvme-command
or /wire-format/nvme-command.json