-
If I call io_uring_submit() and it returns an error (from io_uring_enter()), what is the state of the SQEs being submitted? Is it guaranteed that none have been submitted? Are the SQEs automatically re-used (is the SQE ring rewound to the point before submission)? If the SQEs aren't submitted, Is there any easy way to traverse the SQEs to perform cleanup of associated application resources on failure? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
io_uring_enter(2) will return either an error or a number of submitted requests. If you get an error, none were submitted and the SQ ring is in the same state as it was before you made that call. On older kernels, you can get a return value that is positive but less than what you asked for. In that case, the return value is the number of SQEs that were consumed, with the rest being untouched. For newer kernels, you can set |
Beta Was this translation helpful? Give feedback.
-
@bateyejoe please mark this as answered if it answers your question, or submit a followup. Don't leave things dangling. |
Beta Was this translation helpful? Give feedback.
io_uring_enter(2) will return either an error or a number of submitted requests. If you get an error, none were submitted and the SQ ring is in the same state as it was before you made that call. On older kernels, you can get a return value that is positive but less than what you asked for. In that case, the return value is the number of SQEs that were consumed, with the rest being untouched. For newer kernels, you can set
IORING_SETUP_SUBMIT_ALL
in which case io_uring_enter(2) will always empty the ring, just posting CQEs for errors.