class SQE#
Submission Queue Entry (SQE)
Example
>>> sqe = io_uring_get_sqe(ring) >>> io_uring_prep_nop(sqe) True >>> sqe.user_data = 1 >>> sqe.opcode, sqe.flags (0, 0)
Setup used to run this example
'io_uring_get_probe_ring', 'io_uring_ring_dontfork', 'io_uring_queue_exit', 'io_uring_register', 'io_uring_set_iowait', 'io_uring_sq_ready', 'io_uring_sq_space_left', 'io_uring_sqring_wait', 'io_uring_get_sqe', 'io_uring_get_events', 'io_uring_close_ring_fd', 'io_uring_register_ring_fd', 'io_uring_unregister_ring_fd', 'io_uring_register_personality', 'io_uring_unregister_personality', 'io_uring_unregister_files', 'io_uring_register_eventfd', 'io_uring_unregister_eventfd', 'io_uring_register_buffers', 'io_uring_buf_ring_head', 'io_uring_register_iowq_aff', 'io_uring_register_iowq_max_workers', 'io_uring_cq_has_overflow', 'io_uring_cq_eventfd_enabled', 'io_uring_cq_eventfd_toggle', 'BufReg', 'Napi', 'ClockRegister', 'Bpf', 'SQE', 'SiginfoT', 'io_uring_prep_waitid', 'io_uring_prep_cancel', 'io_uring_prep_cancel64', 'ZcrxIfqReg', ) # fmt: skip def ring(ns): make_ring(ns)
Note
- Points into the ring's submission queue (or an
Sqetemplate):RuntimeErroronce the ring has exited or was initialized again.
property opcode: int#
The IORING_OP_* the entry was prepped with.
property flags: int#
The entry's IOSQE_* flags.
Flags
IOSQE_FIXED_FILEfd is an index into the registered files (a direct descriptor). 5.1+IOSQE_IO_DRAINStarts after every earlier request completed; later ones wait for it. 5.2+IOSQE_IO_LINKThe next SQE starts only after this one completes (a chain). 5.3+IOSQE_IO_HARDLINKIOSQE_IO_LINK that keeps the chain going after a failed result. 5.5+IOSQE_ASYNCHand to a worker thread at once, no non-blocking attempt first. 5.6+IOSQE_BUFFER_SELECTTake a provided buffer of buf_group when the data is ready. 5.7+IOSQE_CQE_SKIP_SUCCESSNo completion when the request succeeds. 5.17+ (IORING_FEAT_CQE_SKIP)
Note
IOSQE_IO_LINK: a chain runs one request after the other and ends at the first SQE without the flag; a submit ends it too (even if its last SQE has the flag). Any error or unexpected result (a short read) breaks the chain: the requests not started yet complete withOSError: ECANCELED.IOSQE_IO_HARDLINKimpliesIOSQE_IO_LINKand runs the rest anyway. Chains and single requests outside them run in parallel.IOSQE_BUFFER_SELECT: the completion hasIORING_CQE_F_BUFFERset and the buffer id incqe.flags >> IORING_CQE_BUFFER_SHIFT;OSError: ENOBUFSwhen the group is empty. A used buffer is gone from the group until it is provided again.IOSQE_CQE_SKIP_SUCCESS: a failed request posts as usual, and withoutIOSQE_IO_HARDLINKthe linked ones after it post nothing. Not to be mixed withIOSQE_IO_DRAINin one ring (the kernel fails later drains). SeeRingfor what Liburing refuses at the submit.IOSQE_FIXED_FILEon an operation without fixed file support:OSError: EBADF.
property ioprio: int#
The entry's I/O priority (ioprio_set values, for reads and writes). Network and accept requests reuse the field for their own flags (IORING_RECVSEND_*, IORING_ACCEPT_*), set by their preps.
property fd: int#
The file descriptor the entry works on; with IOSQE_FIXED_FILE in flags the index of a registered file (a direct descriptor) instead.
property len: int#
The entry's len field (e.g. bytes to read, or number of iovec).
property user_data: int#
The user_data of the entry, given back as cqe.user_data in its completion(s): any 64-bit value, 0 and duplicates included (see Ring; after the submit this reads as the ring's index for it).
property personality: int#
The registered personality id (io_uring_register_personality) whose credentials the request runs with (0: none, the submitting thread's; IORING_FEAT_CUR_PERSONALITY).