Auto buf reg(UBLK_F_AUTO_BUF_REG) for supporting zero copy#19
Merged
Conversation
Fix the following build warnings by making the elided lifetimes explicit in function signatures, as suggested by the compiler: warning: hiding a lifetime that's elided elsewhere is confusing --> src/ctrl.rs:960:18 warning: hiding a lifetime that's elided elsewhere is confusing --> src/ctrl.rs:964:22 warning: hiding a lifetime that's elided elsewhere is confusing --> src/io.rs:538:32 Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
This commit introduces support for the `UBLK_F_AUTO_BUF_REG` feature. This allows for automatic registration and unregistration of I/O buffers with the underlying `io_uring` instance, simplifying the implementation of ublk server backends. With this feature, the buffer registration information is encoded into the `addr` field of the `io_uring` submission queue entry (SQE), avoiding the need for separate commands to register and unregister buffers. This can improve performance by reducing the number of `uring_cmd` calls. Key changes include: - A new `UBLK_F_AUTO_BUF_REG` device flag to enable the feature. - `UBLK_U_IO_REGISTER_IO_BUF` and `UBLK_U_IO_UNREGISTER_IO_BUF` ioctls to support a fallback path for manual buffer registration. - A new `submit_io_cmd_with_auto_buf_reg` method in `UblkQueue` to handle I/O submission with auto-registration data. - A comprehensive test suite to validate the new zero-copy functionality, including success, failure, and fallback scenarios. This simplifies the development of zero-copy ublk targets and provides a more efficient data path. Switch to reply on io-uring v0.7.4 which can provides register_buffers_sparse() which is required for supporting auto buffer registration. Signed-off-by: Ming Lei <tom.leiming@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.