On Sat, Apr 26, 2025 at 10:04:46PM -0600, Keith Busch wrote: > On Sun, Apr 27, 2025 at 11:10:30AM +0800, Ming Lei wrote: > > On Sat, Apr 26, 2025 at 08:34:40PM -0600, Keith Busch wrote: > > > > > > This is very similiar to something I proposed off-list, and the feedback > > > > Looks we both think of it, :-) > > Yeah, for real. I was a bit dismayed when I learned of such use cases. > So much simplicity and elegance went away... That is reality, and probably these use cases may be addressed elegantly too in future... > > > > 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. > > > > The io_uring fd & buffer index can be provided from 'ublksrv_io_cmd'. > > > > https://lore.kernel.org/linux-block/aA2RNG3-WzuQqEN6@fedora/ > > > > If we only support IORING_ENTER_REGISTERED_RING, 32bit is enough for > > io_uring fd & buffer index, and there is still 64bits available if not > > taking UBLK_F_ZONED into account. > > We still need a registered sparse table for the backend ring. I think > maybe a simple ida from the ublk driver to select an index may let the > daemon register something reasonably small. Yeah, I think it is reasonable to let userspace register the sparse table, and we can document it in UAPI. thanks, Ming