Re: [PATCH 1/2] io_uring/cmd: split io_uring_cmd_set_res() from io_uring_cmd_done()
Ming Lei <[email protected]>
| Newsgroups | org.infradead.lists.linux-nvme,dev.linux.lists.fuse-devel,org.kernel.vger.io-uring,org.kernel.vger.linux-block,org.kernel.vger.linux-btrfs,org.kernel.vger.linux-kernel,org.kernel.vger.linux-scsi |
|---|---|
| Message-ID | <CACVXFVOLBVVGwfo+mbn+4jnGKZS66dL_2ghsKiaT6buscWJg6w@mail.gmail.com> |
On Thu, Aug 27, 2026 at 4:44 PM Caleb Sander Mateos <[email protected]> wrote: > > On Thu, Aug 27, 2026 at 1:05 PM Joanne Koong <[email protected]> wrote: > > > > Hi Caleb, > > > > On Thu, Aug 27, 2026 at 11:57 AM Caleb Sander Mateos > > <[email protected]> wrote: > > > > > > In preparation for setting the io_uring NVMe passthru CQE results from > > > the blk-mq request completion rather than the task work callback, split > > > out functions io_uring_cmd_set_res{,32}() from io_uring_cmd_done{,32}(). > > > This allows io_uring_cmd_done{,32}() and __io_uring_cmd_done() to be > > > consolidated into a single CQE-size-agnostic function with 3 fewer > > > arguments than __io_uring_cmd_done(). > > > > > > > The conversion looks logically correct to me but the interface feels a > > bit annoying / fragile on the caller side. > > > > Is there a way nvme can get what it needs without changing the other > > callers? Would it work to just keep the existing > > io_uring_cmd_done{,32}() as is and add a separate API for special > > callers like nvme, eg: > > > > void io_uring_cmd_set_res32(struct io_uring_cmd *cmd, s32 ret, u64 res2); > > void __io_uring_cmd_done(struct io_uring_cmd *cmd, unsigned issue_flags); > > > > where io_uring_cmd_done{,32} would then just be inline wrappers over > > those? afaict, then only the nvme callsite would have to change and > > fuse, btrfs, block, ublk, and scsi_bsg could just stay as is. Do you > > think something like that makes sense to do? Yeah, this way is definitely much better from a driver viewpoint. Thanks, Ming Lei