Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GIT PULL] Support using a ring exclusively via registered index #664

Merged
merged 7 commits into from
Feb 21, 2023

Commits on Feb 16, 2023

  1. src/register.c: Call __sys_io_uring_register via a helper taking the …

    …ring
    
    In preparation for allowing register via a registered ring fd.
    
    Signed-off-by: Josh Triplett <josh@joshtriplett.org>
    joshtriplett committed Feb 16, 2023
    Configuration menu
    Copy the full SHA
    7d7a0fe View commit details
    Browse the repository at this point in the history
  2. Error on duplicate ring fd registration

    This avoids overwriting and leaking a registered ring fd.
    
    Signed-off-by: Josh Triplett <josh@joshtriplett.org>
    joshtriplett committed Feb 16, 2023
    Configuration menu
    Copy the full SHA
    6b2cd35 View commit details
    Browse the repository at this point in the history

Commits on Feb 19, 2023

  1. Support using IORING_REGISTER_USE_REGISTERED_RING

    Use it if the kernel supports IORING_FEAT_REG_REG_RING and the user
    registered the ring fd.
    
    Signed-off-by: Josh Triplett <josh@joshtriplett.org>
    joshtriplett committed Feb 19, 2023
    Configuration menu
    Copy the full SHA
    3db49cb View commit details
    Browse the repository at this point in the history
  2. Support closing the ring fd and using it exclusively via registered i…

    …ndex
    
    Add io_uring_close_fd to close the ring fd, and perform all subsequent
    operations via registered index only.
    
    Require the kernel to support IORING_FEAT_REG_REG_RING, to allow for
    subsequent io_uring_register operations as well.
    
    Signed-off-by: Josh Triplett <josh@joshtriplett.org>
    joshtriplett committed Feb 19, 2023
    Configuration menu
    Copy the full SHA
    2bfd4d5 View commit details
    Browse the repository at this point in the history
  3. Add example of closing a ring fd and using it via registered index

    Based on io_uring-test, modified to use io_uring_close_ring_fd.
    
    Signed-off-by: Josh Triplett <josh@joshtriplett.org>
    joshtriplett committed Feb 19, 2023
    Configuration menu
    Copy the full SHA
    bc11155 View commit details
    Browse the repository at this point in the history
  4. test: Add test for io_uring_register with a registered ring

    Make sure an io_uring_register operation works after
    io_uring_close_ring_fd. Also test various error paths.
    
    Tested on a kernel with IORING_REGISTER_USE_REGISTERED_RING support.
    
    Signed-off-by: Josh Triplett <josh@joshtriplett.org>
    joshtriplett committed Feb 19, 2023
    Configuration menu
    Copy the full SHA
    cf5f5f9 View commit details
    Browse the repository at this point in the history
  5. Optimize do_register by combining feature check with internal flag

    Introduce the new internal flag INT_FLAG_REG_REG_RING, set when setting
    INT_FLAG_REG_RING if the kernel supports IORING_FEAT_REG_REG_RING. This
    allows all the register functions to just check INT_FLAG_REG_REG_RING.
    
    Suggested-by: Dylan Yudaken <dylany@meta.com>
    Signed-off-by: Josh Triplett <josh@joshtriplett.org>
    joshtriplett committed Feb 19, 2023
    Configuration menu
    Copy the full SHA
    c0bcc54 View commit details
    Browse the repository at this point in the history