Conversation
Now we can reply on ublksrv_is_recovering(), and needn't to pass this parameter any more. Signed-off-by: Ming Lei <tom.leiming@gmail.com>
This variable will be cleared in __nbd_handle_io_bg(), so no need to do it in nbd_handle_send_bg(). Signed-off-by: Ming Lei <tom.leiming@gmail.com>
We have nbd_queue_data->chained_send_ios already, so no necessary to maintain another variable just for showing if this current send chain is active. It can be replaced with checking against `nbd_queue_data->chained_send_ios` and `nbd_queue_data->chain_active`. The point is that `->chain_active` is more readable and easier to maintain. Signed-off-by: Ming Lei <tom.leiming@gmail.com>
It is more readable to call nbd_handle_send_bg() and nbd_handle_recv_bg() directly. Signed-off-by: Ming Lei <tom.leiming@gmail.com>
It is just fine to use io_uring_prep_sendmsg*() to send message with single vector. 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>
Not necessary to add the two flag for deciding if the io_uring OP belongs to normal UBLK_IO_* io command, and we have carried the exact ublk op code in ->userdata. So remove the two. So far: UBLK_IO_OP_* < 0x20 _IO_NR(UBLK_U_IO_*) > 0x20: register io buffer, unregister io buffer UBLK_USER_COPY_READ: 0x80 UBLK_USER_COPY_WRITE: 0x81 Add is_ublk_io_cmd() helper for checking if the io_uring OP belongs to normal ublk io command. In this way, the target data field in ->user_data can be reserved for future usage, such as the ublk stripe usage: https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/testing/selftests/ublk/stripe.c#n148 Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Move -EAGAIN handling out of ublksrv_tgt_process_cqe(), and the handling has to be done after the whole sqe series are done. Meantime improve error handling for loop, any failure in this sqe series will fail the loop io command. Signed-off-by: Ming Lei <tom.leiming@gmail.com>
51f5501 to
b79a944
Compare
…esc * sync with ublk kernel selftest change: https://lore.kernel.org/linux-block/20250328194230.2726862-1-csander@purestorage.com/ Signed-off-by: Ming Lei <tom.leiming@gmail.com>
- add two uapi register/unregister buffer cmd code - add uapi dma alignment parameter, which is usually needed, otherwise zc may fail, so it is one soft dependency. - register buffer table - pass zero buffer address and not allocate user buffer for zc ublk zero copy requires linux kernel v6.15. Reviewed-by: Ronnie Sahlberg <rsahlberg@whamcloud.com> Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Add helpers for enabling zero copy. Add zero copy command line. By default disable zero copy for the three targets. Signed-off-by: Ming Lei <tom.leiming@gmail.com>
ublk zero copy feature is introduced in linux kernel v6.15, so try to add the support on null target first. Reviewed-by: Ronnie Sahlberg <rsahlberg@whamcloud.com> Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Enable zero copy support, and set default dma alignment as 511 which should cover all hardware. In the future, segment limit can be setup by aligning with backing file device for reaching good perf. Reviewed-by: Ronnie Sahlberg <rsahlberg@whamcloud.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.
No description provided.