On Sat, Apr 26, 2025 at 03:42:59PM -0700, Caleb Sander Mateos wrote: > On Sat, Apr 26, 2025 at 2:41 AM Ming Lei <ming.lei@xxxxxxxxxx> wrote: > > > > UBLK_F_SUPPORT_ZERO_COPY requires ublk server to issue explicit buffer > > register/unregister uring_cmd for each IO, this way is not only inefficient, > > but also introduce dependency between buffer consumer and buffer register/ > > unregister uring_cmd, please see tools/testing/selftests/ublk/stripe.c > > in which backing file IO has to be issued one by one by IOSQE_IO_LINK. > > This is a great idea! This is very similiar to something I proposed off-list, and the feedback back then was this won't work because the back-end ring that wants to use the zero-copy buffer isn't the same as the ublk server ring recieving notification of a new command; the ublk driver has no idea which uring to register the bvec with. Also, this is using the request "tag" as the io_uring buf index, which wouldn't work when the ublk server ring handles multiple ublk devices due to the tag collisions. If you're can make those trade-offs, then this is a great simplification to the whole thing.