History

io_uring: add support for 128-byte SQEs

Normal SQEs are 64-bytes in length, which is fine for all the commands we support. However, in preparation for supporting passthrough IO, provide an option for setting up a ring with 128-byte SQEs. We continue to use the same type for io_uring_sqe, it's marked and commented with a zero sized array pad at the end. This provides up to 80 bytes of data for a passthrough command - 64 bytes for the extra added data, and 16 bytes available at the end of the existing SQE.

Jens Axboe committed 4 years ago

Commit ebdeb7c1 parent b5ba65d2 files · +19 −3Browse files

Showing the changes to include/uapi (1 of 2 files). Show all

Unified · Split

include/uapi/linux/io_uring.h+8−0
@@ -63,6 +63,12 @@ struct io_uring_sqe { · 62 unmodified lines
6363 };
6464 __u64 addr3;
6565 __u64 __pad2[1];
66+
67+ /*
68+ * If the ring is initialized with IORING_SETUP_SQE128, then this field
69+ * contains 64-bytes of padding, doubling the size of the SQE.
70+ */
71+ __u64 __big_sqe_pad[0];
6672 };
6773
6874 enum {
@@ -119,6 +125,8 @@ enum { · 50 unmodified lines
119125 */
120126 #define IORING_SETUP_TASKRUN_FLAG (1U << 9)
121127
128+#define IORING_SETUP_SQE128 (1U << 10) /* SQEs are 128 byte */
129+
122130 enum io_uring_op {
123131 IORING_OP_NOP,
124132 IORING_OP_READV,