public inbox for [email protected]
 help / color / mirror / Atom feed
* libublk-rs: v0.2 with async/await support
@ 2023-10-30  3:20 Ming Lei
  0 siblings, 0 replies; only message in thread
From: Ming Lei @ 2023-10-30  3:20 UTC (permalink / raw)
  To: io-uring, linux-block; +Cc: ming.lei, ublk

Hi,

libublk-rs v0.2 is released:

https://crates.io/crates/libublk
https://github.com/ming1/libublk-rs

Changes:

- support async/await for generic async fn(don't depend on runtime) and io_uring.
- unprivileged ublk
- queue idle handle
- almost all features in libublksrv are supported in libublk-rs now
- command line support for examples

Now each io command can be handled in dedicated io task as following,
and it looks like sync programming, but everything is handled in async
style:

         let mut cmd_op = libublk::sys::UBLK_IO_FETCH_REQ;
         let mut result = 0;
         let addr = std::ptr::null_mut();
         loop {
             if q.submit_io_cmd(tag, cmd_op, addr, result).await
                 == libublk::sys::UBLK_IO_RES_ABORT
             {
                 break;
             }

             // io_uring async is preferred
             result = handle_io_cmd(&q, tag).await;
             cmd_op = libublk::sys::UBLK_IO_COMMIT_AND_FETCH_REQ;
         }

Roadmap:
1) write more complicated targets with async/await

- re-write qcow2 with clean async/await implementation in rublk project which
depends on libublk

	https://crates.io/crates/rublk
	https://github.com/ming1/rublk

2) tens of thousands of ublk device support
- switch control command to async/await, and make ublk device in one
  thread with single blocking point

- shared task: one task can create multiple ublk devices

- shared uring: create multiple ublk device with single uring.

3) support tokio async, especially for non-io_uring target io handling


Thanks,
Ming


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-10-30  3:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-30  3:20 libublk-rs: v0.2 with async/await support Ming Lei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox