* Libublk-rs v0.1.0
@ 2023-08-14 2:56 Ming Lei
2023-08-14 18:23 ` Gabriel Krisman Bertazi
0 siblings, 1 reply; 3+ messages in thread
From: Ming Lei @ 2023-08-14 2:56 UTC (permalink / raw)
To: linux-block, io-uring, Andreas Hindborg, Shinichiro Kawasaki,
German Maglione, Stefano Garzarella, Joe Thornber
Cc: ming.lei
Hello,
Libublk-rs(Rust)[1][2] 0.1.0 is released.
The original idea is to use Rust to write ublk target for covering all
kinds of block queue limits/parameters combination easily when talking
with Andreas and Shinichiro about blktests in LSFMM/BPF 2023.
Finally it is evolved into one generic library. Attributed to Rust's
some modern language features, libublk interfaces are pretty simple:
- one closure(tgt_init) for user to customize device by providing all
kind of parameter
- the other closure(io handling) for user to handling IO which is
completely io_uring CQE driven: a) IO command CQE from ublk driver,
b) target IO CQE originated from target io handling code, c) eventfd
CQE if IO is offloaded to other context
With low level APIs, <50 LoC can build one ublk-null, and if high level
APIs are used, 30 LoC is enough.
Performance is basically aligned with pure C ublk implementation[3].
The library has been verified on null, ramdisk, loop and zoned target.
The plan is to support async/await in 0.2 or 0.3 so that libublk can
be used to build complicated target easily and efficiently.
Thanks Andreas for reviewing and providing lots of good ideas for
improvement & cleanup. Thanks German Maglione for some suggestions, such
as eventfd support. Thanks Joe for providing excellent Rust programming
guide.
Any feedback is welcome!
[1] https://crates.io/crates/libublk
[2] https://github.com/ming1/libublk-rs
[3] https://github.com/osandov/blktests/blob/master/src/miniublk.c
Thanks,
Ming
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Libublk-rs v0.1.0
2023-08-14 2:56 Libublk-rs v0.1.0 Ming Lei
@ 2023-08-14 18:23 ` Gabriel Krisman Bertazi
2023-08-15 1:17 ` Ming Lei
0 siblings, 1 reply; 3+ messages in thread
From: Gabriel Krisman Bertazi @ 2023-08-14 18:23 UTC (permalink / raw)
To: Ming Lei
Cc: linux-block, io-uring, Andreas Hindborg, Shinichiro Kawasaki,
German Maglione, Stefano Garzarella, Joe Thornber
Ming Lei <[email protected]> writes:
> Hello,
>
> Libublk-rs(Rust)[1][2] 0.1.0 is released.
Hi Ming,
Do you intend to effectively deprecate the code in ubdsrv in favor of
libublk-rs or do you intend to keep the C library? I'm asking because
I'm looking into how to enable ublk in distributions.
Thanks,
>
> The original idea is to use Rust to write ublk target for covering all
> kinds of block queue limits/parameters combination easily when talking
> with Andreas and Shinichiro about blktests in LSFMM/BPF 2023.
>
> Finally it is evolved into one generic library. Attributed to Rust's
> some modern language features, libublk interfaces are pretty simple:
>
> - one closure(tgt_init) for user to customize device by providing all
> kind of parameter
>
> - the other closure(io handling) for user to handling IO which is
> completely io_uring CQE driven: a) IO command CQE from ublk driver,
> b) target IO CQE originated from target io handling code, c) eventfd
> CQE if IO is offloaded to other context
>
> With low level APIs, <50 LoC can build one ublk-null, and if high level
> APIs are used, 30 LoC is enough.
>
> Performance is basically aligned with pure C ublk implementation[3].
>
> The library has been verified on null, ramdisk, loop and zoned target.
> The plan is to support async/await in 0.2 or 0.3 so that libublk can
> be used to build complicated target easily and efficiently.
>
> Thanks Andreas for reviewing and providing lots of good ideas for
> improvement & cleanup. Thanks German Maglione for some suggestions, such
> as eventfd support. Thanks Joe for providing excellent Rust programming
> guide.
>
> Any feedback is welcome!
>
> [1] https://crates.io/crates/libublk
> [2] https://github.com/ming1/libublk-rs
> [3] https://github.com/osandov/blktests/blob/master/src/miniublk.c
>
> Thanks,
> Ming
>
--
Gabriel Krisman Bertazi
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Libublk-rs v0.1.0
2023-08-14 18:23 ` Gabriel Krisman Bertazi
@ 2023-08-15 1:17 ` Ming Lei
0 siblings, 0 replies; 3+ messages in thread
From: Ming Lei @ 2023-08-15 1:17 UTC (permalink / raw)
To: Gabriel Krisman Bertazi
Cc: linux-block, io-uring, Andreas Hindborg, Shinichiro Kawasaki,
German Maglione, Stefano Garzarella, Joe Thornber, ming.lei
Hi Gabriel,
On Mon, Aug 14, 2023 at 02:23:14PM -0400, Gabriel Krisman Bertazi wrote:
> Ming Lei <[email protected]> writes:
>
> > Hello,
> >
> > Libublk-rs(Rust)[1][2] 0.1.0 is released.
>
> Hi Ming,
>
> Do you intend to effectively deprecate the code in ubdsrv in favor of
> libublk-rs or do you intend to keep the C library? I'm asking because
> I'm looking into how to enable ublk in distributions.
So far, there are users of C ubdsrv library, and both are maintained
and co-exist, so C library is still kept.
Thanks
Ming
>
> Thanks,
>
> >
> > The original idea is to use Rust to write ublk target for covering all
> > kinds of block queue limits/parameters combination easily when talking
> > with Andreas and Shinichiro about blktests in LSFMM/BPF 2023.
> >
> > Finally it is evolved into one generic library. Attributed to Rust's
> > some modern language features, libublk interfaces are pretty simple:
> >
> > - one closure(tgt_init) for user to customize device by providing all
> > kind of parameter
> >
> > - the other closure(io handling) for user to handling IO which is
> > completely io_uring CQE driven: a) IO command CQE from ublk driver,
> > b) target IO CQE originated from target io handling code, c) eventfd
> > CQE if IO is offloaded to other context
> >
> > With low level APIs, <50 LoC can build one ublk-null, and if high level
> > APIs are used, 30 LoC is enough.
> >
> > Performance is basically aligned with pure C ublk implementation[3].
> >
> > The library has been verified on null, ramdisk, loop and zoned target.
> > The plan is to support async/await in 0.2 or 0.3 so that libublk can
> > be used to build complicated target easily and efficiently.
> >
> > Thanks Andreas for reviewing and providing lots of good ideas for
> > improvement & cleanup. Thanks German Maglione for some suggestions, such
> > as eventfd support. Thanks Joe for providing excellent Rust programming
> > guide.
> >
> > Any feedback is welcome!
> >
> > [1] https://crates.io/crates/libublk
> > [2] https://github.com/ming1/libublk-rs
> > [3] https://github.com/osandov/blktests/blob/master/src/miniublk.c
> >
> > Thanks,
> > Ming
> >
>
> --
> Gabriel Krisman Bertazi
>
--
Ming
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-08-15 1:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-14 2:56 Libublk-rs v0.1.0 Ming Lei
2023-08-14 18:23 ` Gabriel Krisman Bertazi
2023-08-15 1:17 ` Ming Lei
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox