From: Jens Axboe Date: Sat, 3 Sep 2022 17:02:10 +0000 (-0600) Subject: t/io_uring: enable support for registered buffers for passthrough X-Git-Tag: fio-3.33~45 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=021ce718f5ae4bfd5f4e42290993578adb7c7bd5;p=fio.git t/io_uring: enable support for registered buffers for passthrough Signed-off-by: Jens Axboe --- diff --git a/os/linux/io_uring.h b/os/linux/io_uring.h index 6604e736..c7a24ad8 100644 --- a/os/linux/io_uring.h +++ b/os/linux/io_uring.h @@ -46,6 +46,7 @@ struct io_uring_sqe { __u32 rename_flags; __u32 unlink_flags; __u32 hardlink_flags; + __u32 uring_cmd_flags; }; __u64 user_data; /* data to be passed back at completion time */ /* pack this to avoid bogus arm OABI complaints */ @@ -197,6 +198,13 @@ enum { IORING_OP_LAST, }; +/* + * sqe->uring_cmd_flags + * IORING_URING_CMD_FIXED use registered buffer; pass thig flag + * along with setting sqe->buf_index. + */ +#define IORING_URING_CMD_FIXED (1U << 0) + /* * sqe->fsync_flags */ diff --git a/t/io_uring.c b/t/io_uring.c index 3bce9e7e..b9353ac8 100644 --- a/t/io_uring.c +++ b/t/io_uring.c @@ -650,6 +650,10 @@ static void init_io_pt(struct submitter *s, unsigned index) cmd->cdw12 = nlb; cmd->addr = (unsigned long) s->iovecs[index].iov_base; cmd->data_len = bs; + if (fixedbufs) { + sqe->uring_cmd_flags = IORING_URING_CMD_FIXED; + sqe->buf_index = index; + } cmd->nsid = f->nsid; cmd->opcode = 2; }