Re: [RFC PATCH v3 5/6] io_uring/cmd: allow reusing SQE storage for completion data
From: Yang Xiuwei
Date: Sun Nov 08 2026 - 21:52:10 EST
Hi Yingjie,
On Sat, 7 Nov 2026 at 09:50, Yingjie Wang wrote:
> uring_cmd requests already allocate enough asynchronous state to hold a
> copied 128-byte SQE. Once a driver has consumed every SQE field and
> committed to asynchronous completion, that storage is no longer needed.
> Add a helper that transfers the storage to the driver until command
> completion without growing the request or adding an allocation.
io_async_cmd is io_uring's own async state. sqes[] is what
io_uring_cmd_sqe_copy() points ioucmd->sqe at. Giving that buffer to
scsi_bsg couples the driver to the io_uring layout and lifetime.
Preallocating the buffer in bsg itself may be a better fit.
Thanks,
Yang Xiuwei