Skip to content

Releases

ntex-io-uring v1.2.0

Choose a tag to compare

@fafhrd91 fafhrd91 released this 11 Nov 14:05

Changes

  • Add Submitter::submit_with_args_and_flags(), which also accepts
    EnterFlags::ABS_TIMER and EnterFlags::NO_IOWAIT for the wait; any other
    flag fails with EINVAL

  • Add opcode::GetSockOpt, a getsockopt(2) through IORING_OP_URING_CMD

  • Add opcode::Send::buffer_select(), to send from a provided buffer

  • Submitter::submit*() refresh the cached submission queue head after
    io_uring_enter, so SubmissionQueue::len() and is_full() reflect
    entries consumed by the kernel without a separate sync()

  • SubmitArgs::sigmask() passes the kernel signal set size, _NSIG / 8,
    instead of size_of::<libc::sigset_t>(), which the kernel rejected with
    EINVAL

  • SubmissionQueue::push128() sets the user data of the padding Nop to the
    new squeue::PADDING_USER_DATA (u64::MAX) instead of 0. The padding
    posts a -ECANCELED completion with this user data when an earlier entry of
    its IO_LINK chain fails

  • SubmissionQueue::push128() no longer copies IO_LINK/IO_HARDLINK from
    the previous slot to the padding Nop, matching liburing. When the previous
    entry was a 128-byte entry, that slot held its payload, so the flags were
    read from arbitrary bytes and a link chain could be dropped. A chain of the
    previous entry now ends at the padding, and the 128-byte entry runs
    independently

  • IoUring::from_fd() is available for all entry types and returns
    InvalidInput, without closing the fd, if the SQE128, CQE32,
    SQE_MIXED or CQE_MIXED setup flags do not match the entry types. It
    previously read SQE128 and CQE32 rings at the wrong entry stride. Calls
    that relied on the default entry types may need a type annotation

  • Submitter::register_buffers_update() returns io::Result<usize>, the
    number of buffers updated, like register_files_update(). The kernel stops
    at the first buffer that fails and returns the count updated so far, which
    was discarded, so partial updates reported success

  • Builder::build() and IoUring::from_fd() return InvalidInput for an
    SQE_MIXED ring with fewer than 4 submission queue entries. On a 2-entry
    ring, SubmissionQueue::push128() at the last slot needs a padding slot plus
    two slots and failed permanently

  • Opcode builders build the entry in a local copy and write it to the
    submission queue with one 8-byte store per word when the builder is dropped,
    instead of zeroing the entry and then overwriting its fields. A Recv with
    user data takes about 1.2 ns instead of 3.1 ns. A builder passed to
    mem::forget leaves the first 64 bytes of the entry unchanged

ntex-io-uring v1.0.0

Choose a tag to compare

@fafhrd91 fafhrd91 released this 11 Oct 19:27

Changes

  • opcodes initialize the submission entry in place. X::new(&mut entry, ..)
    resets the entry and writes required fields, setters update it directly, build()
    is removed. Entries can be reused for another operation. new takes
    &mut impl squeue::EntryMarker and resets all 128 bytes of an Entry128

  • SubmissionQueue::push() takes a closure that initializes the queue slot
    in place with an opcode. If the queue is full it returns PushError<F>,
    which holds the closure. push_multiple(), push_unchecked() and
    try_push_inline() are removed, has_space() takes no arguments

  • EntryMarker requires AsMut<Entry>

  • buf_group() on Read, Readv, Recv and RecvMsg is replaced by
    buffer_select(), which also sets the BUFFER_SELECT flag

  • MsgRingSendFd::opcode_flags() ORs flags like other flag setters

  • squeue::Entry::get_opcode() returns u8

  • squeue::Entry and Entry128 by-value builders flags(), user_data() and
    personality() are replaced by in-place set_flags(), set_user_data() and
    set_personality(), clear_flags() takes &mut self. Added get_flags()
    and get_personality()

  • sys bindings regenerated from Linux 7.2 uapi headers

  • EpollCtl::new() takes a regular epfd, the kernel doesn't support fixed epoll files

  • Fadvise and Madvise pass lengths larger than u32 in the 64-bit field
    instead of truncating them

  • WaitId::infop() takes *mut siginfo_t

  • Submitter::register_ifq() takes &mut io_uring_zcrx_ifq_reg, the kernel writes
    results back into it

  • Remove deprecated IoUring::submission_shared()

  • Document all opcode constructors and setters, fix opcode docs

  • Fix opcode::ReadMulti clearing FIXED_FILE for fixed file descriptors

  • Timeout, LinkTimeout and TimeoutUpdate flags() OR flags, PollAdd::multi()
    keeps other poll flags

  • MsgRingData and MsgRingSendFd accept a fixed (registered) ring fd

  • CancelBuilder can match by opcode and combine user_data, fd and opcode
    criteria: CancelBuilder::opcode(), match_user_data(), match_fd(), match_opcode()

  • Add Builder::setup_sqe_mixed(), Parameters::is_setup_sqe_mixed() and
    SubmissionQueue::push128() for 128-byte entries in a 64-byte queue, add
    opcode::Nop128 and opcode::UringCmd128

  • Add missing op setters: Nop inject_result(), file(), buf_index(),
    task_work(), cqe32(); PollAdd::level(); nanos() and
    TimeoutFlags::IMMEDIATE_ARG for timeouts; ioprio() for Accept,
    AcceptMulti, RecvMulti, SendBundle, RecvBundle, RecvMultiBundle;
    AcceptMulti::addr(); len() for RecvBundle and RecvMultiBundle;
    total_len() for RecvMulti and RecvMultiBundle; buf_index() for Send,
    Recv and SendMsgZc; vectorized() for Send and SendZc; pi_attr() for
    read/write ops; flags() for UringCmd16 and UringCmd80. Export types::io_uring_attr_pi