]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
io_uring/uring_cmd: add support for IORING_SETUP_CQE_MIXED
authorJens Axboe <axboe@kernel.dk>
Thu, 7 Aug 2025 20:24:18 +0000 (14:24 -0600)
committerJens Axboe <axboe@kernel.dk>
Wed, 27 Aug 2025 17:24:15 +0000 (11:24 -0600)
Certain users of uring_cmd currently require fixed 32b CQE support,
which is propagated through IO_URING_F_CQE32. Allow
IORING_SETUP_CQE_MIXED to cover that case as well, so not all CQEs
posted need to be 32b in size.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/cmd_net.c
io_uring/uring_cmd.c

index 3866fe6ff541d5677396746df5d66512cd281572..27a09aa4c9d0b41f797d165d99c7c8ca06c4ec9e 100644 (file)
@@ -4,6 +4,7 @@
 #include <net/sock.h>
 
 #include "uring_cmd.h"
+#include "io_uring.h"
 
 static inline int io_uring_cmd_getsockopt(struct socket *sock,
                                          struct io_uring_cmd *cmd,
@@ -73,7 +74,7 @@ static bool io_process_timestamp_skb(struct io_uring_cmd *cmd, struct sock *sk,
 
        cqe->user_data = 0;
        cqe->res = tskey;
-       cqe->flags = IORING_CQE_F_MORE;
+       cqe->flags = IORING_CQE_F_MORE | ctx_cqe32_flags(cmd_to_io_kiocb(cmd)->ctx);
        cqe->flags |= tstype << IORING_TIMESTAMP_TYPE_SHIFT;
        if (ret == SOF_TIMESTAMPING_TX_HARDWARE)
                cqe->flags |= IORING_CQE_F_TSTAMP_HW;
index 482cc5be1f8d3908b1f6036c80d36e3a3720b38a..ff1d029633b864a15109262b35f6cb676cb9acdb 100644 (file)
@@ -242,7 +242,7 @@ int io_uring_cmd(struct io_kiocb *req, unsigned int issue_flags)
 
        if (ctx->flags & IORING_SETUP_SQE128)
                issue_flags |= IO_URING_F_SQE128;
-       if (ctx->flags & IORING_SETUP_CQE32)
+       if (ctx->flags & (IORING_SETUP_CQE32 | IORING_SETUP_CQE_MIXED))
                issue_flags |= IO_URING_F_CQE32;
        if (io_is_compat(ctx))
                issue_flags |= IO_URING_F_COMPAT;