wire / wire-format / io-uring-sqe
An io_uring SQE is a 64-byte structure submitted to the kernel via the submission queue ring. It encodes the operation (opcode), flags, file descriptor, offset, buffer address/length, and user data. The kernel reads SQEs from the SQ ring and completes them into CQEs.
aka: io_uring Submission Queue Entry (SQE)
spec: Linux kernel (io_uring)
An io_uring SQE is a 64-byte structure submitted to the kernel via the submission queue ring. It encodes the operation (opcode), flags, file descriptor, offset, buffer address/length, and user data. The kernel reads SQEs from the SQ ring and completes them into CQEs.
| field | size | meaning |
|---|---|---|
| opcode | 1 byte | Operation: 0 NOP, 1 READV, 2 WRITEV, 3 FSYNC, 4 READ_FIXED, 5 WRITE_FIXED, 5 IORING_OP_POLL_ADD, 6 POLL_REMOVE, 7 SYNC_FILE_RANGE, 8 SENDMSG, 9 RECVMSG, 10 TIMEOUT, 11 TIMEOUT_REMOVE, 12 ACCEPT, 13 ASYNC_CANCEL, 14 LINK_TIMEOUT, 15 CONNECT, 16 FALLOCATE, 17 OPENAT, 18 CLOSE, 19 FILES_UPDATE, 20 STATX, 21 READ, 22 WRITE, 23 FADVISE, 24 MADVISE, 25 SEND, 26 RECV, 27 OPENAT2, 28 EPOLL_CTL, 29 SPLICE, 30 PROVIDE_BUFFERS, 31 REMOVE_BUFFERS, 32 TEE, 33 SHUTDOWN, 34 RENAMEAT, 35 UNLINKAT, 36 MKDIRAT, 37 SYMLINKAT, 38 LINKAT, 39 MSG_RING, 40 FSETXATTR, 41 SETXATTR, 42 FGETXATTR, 43 GETXATTR, 44 SOCKET, 45 ... . |
| flags | 1 byte | IOSQE_FIXED_FILE (1<<0), IOSQE_IO_DRAIN (1<<1), IOSQE_IO_LINK (1<<2), IOSQE_IO_HARDLINK (1<<3), IOSQE_ASYNC (1<<4), IOSQE_BUFFER_SELECT (1<<5), IOSQE_CQE_SKIP_SUCCESS (1<<6). |
| ioprio | 2 bytes | I/O priority (ioprio_set(2) encoding). |
| fd | 4 bytes (int) | File descriptor (or fixed-file index if IOSQE_FIXED_FILE). |
| off / addr2 | 8 bytes (__u64) | File offset for read/write; or secondary address for some ops. |
| addr | 8 bytes (__u64) | Pointer to buffer / iovec array / pathname, depending on opcode. |
| len | 4 bytes (__u32) | Buffer length or iovec count. |
| rw_flags / poll_events / ... | 4 bytes (__u32) | Op-specific flags (e.g. read/write flags, poll events, accept flags). |
| user_data | 8 bytes (__u64) | Opaque value echoed back in the CQE; used to correlate completions. |
| buf_index / buf_group | 2 bytes (__u16) | Fixed buffer index or buffer group for IOSQE_BUFFER_SELECT. |
| personality | 2 bytes (__u16) | Registered personality (credentials) index, or 0 for current. |
| splice_fd_in | 4 bytes (int) | Source fd for splice/tee operations. |
| addr3 | 8 bytes (__u64) | Third address (renameat new path, xattr name, etc.). |
| __pad2[1] | 8 bytes | Padding to 64 bytes. |
example:
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 00 00 00 00 00
NOP SQE (opcode 0), all zeros except user_data
agent: curl -H 'accept: application/json' wire.phall.io/wire-format/io-uring-sqe
or /wire-format/io-uring-sqe.json