Auto buf reg(UBLK_F_AUTO_BUF_REG) for supporting zero copy#18
Closed
Auto buf reg(UBLK_F_AUTO_BUF_REG) for supporting zero copy#18
Conversation
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. Signed-off-by: Ming Lei <tom.leiming@gmail.com>
The build started failing with unresolved import errors related to `zcrx` (zero-copy receive) types from the `io-uring` crate. This is because a dependency update requires a newer version of `io-uring` which in turn relies on features from a more recent `liburing` than is available by default in the GitHub Actions runner. This change fixes the build by adding a CI step to clone, configure, and install the latest version of `liburing` from source before the main build begins. This ensures the necessary definitions are available to `bindgen` during compilation. 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 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.
Support ublk zero copy feature of UBLK_F_AUTO_BUF_REG/UBLK_F_SUPPORT_ZERO_COPY.