wire / wire-format / io-uring-sqe

io_uring Submission Queue Entry (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.

wire-format kind wire-format status standard verification verified tier B wire-format@1

aka: io_uring Submission Queue Entry (SQE)

wire format

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.

fieldsizemeaning
opcode1 byteOperation: 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 ... .
flags1 byteIOSQE_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).
ioprio2 bytesI/O priority (ioprio_set(2) encoding).
fd4 bytes (int)File descriptor (or fixed-file index if IOSQE_FIXED_FILE).
off / addr28 bytes (__u64)File offset for read/write; or secondary address for some ops.
addr8 bytes (__u64)Pointer to buffer / iovec array / pathname, depending on opcode.
len4 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_data8 bytes (__u64)Opaque value echoed back in the CQE; used to correlate completions.
buf_index / buf_group2 bytes (__u16)Fixed buffer index or buffer group for IOSQE_BUFFER_SELECT.
personality2 bytes (__u16)Registered personality (credentials) index, or 0 for current.
splice_fd_in4 bytes (int)Source fd for splice/tee operations.
addr38 bytes (__u64)Third address (renameat new path, xattr name, etc.).
__pad2[1]8 bytesPadding 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


provenance

agent: curl -H 'accept: application/json' wire.phall.io/wire-format/io-uring-sqe or /wire-format/io-uring-sqe.json