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

Target cleanup #119

Merged
merged 8 commits into from
Mar 18, 2025
Merged

Target cleanup #119

merged 8 commits into from
Mar 18, 2025

Conversation

ming1
Copy link
Collaborator

@ming1 ming1 commented Mar 18, 2025

This PR is part of #116, let merge the prepare part first.

ming1 added 8 commits March 18, 2025 01:34
No functional change.

Add comment on this new helper too.

Reviewed-by: Ronnie Sahlberg <[email protected]>
Signed-off-by: Ming Lei <[email protected]>
Add central helper for handling both read and write, which shares
lots of code.

No functional change.

Reviewed-by: Ronnie Sahlberg <[email protected]>
Signed-off-by: Ming Lei <[email protected]>
This variable is useless, so remove it.

Reviewed-by: Ronnie Sahlberg <[email protected]>
Signed-off-by: Ming Lei <[email protected]>
Add two target data flag:

UBLK_IO_TGT_BUF
UBLK_IO_TGT_IO

The former means this uring OP is for buffer operation, and the latter
means this uring OP is for normal IO operation, and we should store
io result for normal IO operation.

And IO command is supposed to be complete when all operations are done,
so use local variable to count how many uring OPs are submitted &
completed.

Also add ublksrv_tgt_io_done() as default handler for ->tgt_io_done()

Reviewed-by: Ronnie Sahlberg <[email protected]>
Signed-off-by: Ming Lei <[email protected]>
Reviewed-by: Ronnie Sahlberg <[email protected]>
Signed-off-by: Ming Lei <[email protected]>
It should be possible for running out of sqe, especially with ublk zero
copy feature, so add one helper for dealing with this situation.

Reviewed-by: Ronnie Sahlberg <[email protected]>
Signed-off-by: Ming Lei <[email protected]>
So far USER_COPY doesn't need to pass buffer address, but still need
to allocate buffer.

And ZERO_COPY needn't to pass and allocate buffer.

Reviewed-by: Ronnie Sahlberg <[email protected]>
Signed-off-by: Ming Lei <[email protected]>
@ming1 ming1 merged commit 50faf94 into master Mar 18, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant