diff options
| author | Keith Busch <kbusch@kernel.org> | 2025-09-19 12:38:58 -0700 | 
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2025-09-20 06:26:38 -0600 | 
| commit | 79525b51acc1c8e331ab47eb131a99f5370a76c2 (patch) | |
| tree | d3e32455ec12777b572c7c16007940f659257e51 /include | |
| parent | 7ea24326e72dad7cd326bedd8442c162ae23df9d (diff) | |
io_uring: fix nvme's 32b cqes on mixed cq
The nvme uring_cmd only uses 32b CQEs. If the ring uses a mixed CQ, then
we need to make sure we flag the completion as a 32b CQE.
On the other hand, if nvme uring_cmd was using a dedicated 32b CQE, the
posting was missing the extra memcpy because it only applied to bit CQEs
on a mixed CQ.
Fixes: e26dca67fde1943 ("io_uring: add support for IORING_SETUP_CQE_MIXED")
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/io_uring/cmd.h | 20 | 
1 files changed, 16 insertions, 4 deletions
diff --git a/include/linux/io_uring/cmd.h b/include/linux/io_uring/cmd.h index c8185f54fde9..02d50f08f668 100644 --- a/include/linux/io_uring/cmd.h +++ b/include/linux/io_uring/cmd.h @@ -56,8 +56,8 @@ int io_uring_cmd_import_fixed_vec(struct io_uring_cmd *ioucmd,   * Note: the caller should never hard code @issue_flags and is only allowed   * to pass the mask provided by the core io_uring code.   */ -void io_uring_cmd_done(struct io_uring_cmd *cmd, s32 ret, u64 res2, -			unsigned issue_flags); +void __io_uring_cmd_done(struct io_uring_cmd *cmd, s32 ret, u64 res2, +			 unsigned issue_flags, bool is_cqe32);  void __io_uring_cmd_do_in_task(struct io_uring_cmd *ioucmd,  			    io_uring_cmd_tw_t task_work_cb, @@ -104,8 +104,8 @@ static inline int io_uring_cmd_import_fixed_vec(struct io_uring_cmd *ioucmd,  {  	return -EOPNOTSUPP;  } -static inline void io_uring_cmd_done(struct io_uring_cmd *cmd, s32 ret, -		u64 ret2, unsigned issue_flags) +static inline void __io_uring_cmd_done(struct io_uring_cmd *cmd, s32 ret, +		u64 ret2, unsigned issue_flags, bool is_cqe32)  {  }  static inline void __io_uring_cmd_do_in_task(struct io_uring_cmd *ioucmd, @@ -159,6 +159,18 @@ static inline void *io_uring_cmd_ctx_handle(struct io_uring_cmd *cmd)  	return cmd_to_io_kiocb(cmd)->ctx;  } +static inline void io_uring_cmd_done(struct io_uring_cmd *ioucmd, s32 ret, +				     u64 res2, unsigned issue_flags) +{ +	return __io_uring_cmd_done(ioucmd, ret, res2, issue_flags, false); +} + +static inline void io_uring_cmd_done32(struct io_uring_cmd *ioucmd, s32 ret, +				       u64 res2, unsigned issue_flags) +{ +	return __io_uring_cmd_done(ioucmd, ret, res2, issue_flags, true); +} +  int io_buffer_register_bvec(struct io_uring_cmd *cmd, struct request *rq,  			    void (*release)(void *), unsigned int index,  			    unsigned int issue_flags);  | 
