Flexible I/O Tester development
 help / color / mirror / Atom feed
From: Ankit Kumar <ankit.kumar@samsung.com>
To: axboe@kernel.dk
Cc: fio@vger.kernel.org, krish.reddy@samsung.com,
	joshi.k@samsung.com, anuj20.g@samsung.com
Subject: [PATCH v2 1/8] io_uring.h: add IORING_SETUP_SQE128 and IORING_SETUP_CQE32
Date: Thu, 26 May 2022 20:18:02 +0530	[thread overview]
Message-ID: <20220526144809.14877-2-ankit.kumar@samsung.com> (raw)
In-Reply-To: <20220526144809.14877-1-ankit.kumar@samsung.com>

From: Anuj Gupta <anuj20.g@samsung.com>

This asks the kernel to setup a ring with 128-byte SQE and
32-byte CQE entries. It may fail with -EINVAL if the kernel
doesn't support this feature. If the kernel does support this
feature, then the ring will support big-sqe/big-cqe entries
which some commands may require.

Signed-off-by: Anuj Gupta <anuj20.g@samsung.com>
---
 os/linux/io_uring.h | 36 +++++++++++++++++++++++++++++++++++-
 1 file changed, 35 insertions(+), 1 deletion(-)

diff --git a/os/linux/io_uring.h b/os/linux/io_uring.h
index 42b2fe84..2fa66135 100644
--- a/os/linux/io_uring.h
+++ b/os/linux/io_uring.h
@@ -60,7 +60,17 @@ struct io_uring_sqe {
 		__s32	splice_fd_in;
 		__u32	file_index;
 	};
-	__u64	__pad2[2];
+	union {
+		struct {
+			__u64	addr3;
+			__u64	__pad2[1];
+		};
+		/*
+		 * If the ring is initialized with IORING_SETUP_SQE128, then
+		 * this field is used for 80 bytes of arbitrary command data
+		 */
+		__u8	cmd[0];
+	};
 };
 
 enum {
@@ -101,6 +111,24 @@ enum {
 #define IORING_SETUP_CLAMP	(1U << 4)	/* clamp SQ/CQ ring sizes */
 #define IORING_SETUP_ATTACH_WQ	(1U << 5)	/* attach to existing wq */
 #define IORING_SETUP_R_DISABLED	(1U << 6)	/* start with ring disabled */
+#define IORING_SETUP_SUBMIT_ALL	(1U << 7)	/* continue submit on error */
+/*
+ * Cooperative task running. When requests complete, they often require
+ * forcing the submitter to transition to the kernel to complete. If this
+ * flag is set, work will be done when the task transitions anyway, rather
+ * than force an inter-processor interrupt reschedule. This avoids interrupting
+ * a task running in userspace, and saves an IPI.
+ */
+#define IORING_SETUP_COOP_TASKRUN	(1U << 8)
+/*
+ * If COOP_TASKRUN is set, get notified if task work is available for
+ * running and a kernel transition would be needed to run it. This sets
+ * IORING_SQ_TASKRUN in the sq ring flags. Not valid with COOP_TASKRUN.
+ */
+#define IORING_SETUP_TASKRUN_FLAG	(1U << 9)
+
+#define IORING_SETUP_SQE128		(1U << 10) /* SQEs are 128 byte */
+#define IORING_SETUP_CQE32		(1U << 11) /* CQEs are 32 byte */
 
 enum {
 	IORING_OP_NOP,
@@ -192,6 +220,12 @@ struct io_uring_cqe {
 	__u64	user_data;	/* sqe->data submission passed back */
 	__s32	res;		/* result code for this event */
 	__u32	flags;
+
+	/*
+	 * If the ring is initialized with IORING_SETUP_CQE32, then this field
+	 * contains 16-bytes of padding, doubling the size of the CQE.
+	 */
+	__u64 big_cqe[];
 };
 
 /*
-- 
2.17.1


  reply	other threads:[~2022-05-26 16:48 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20220526145343epcas5p362cd1b702fc0d11d21bca2880d6e288c@epcas5p3.samsung.com>
2022-05-26 14:48 ` [PATCH v2 0/8] Add support for uring passthrough commands Ankit Kumar
2022-05-26 14:48   ` Ankit Kumar [this message]
2022-05-26 14:48   ` [PATCH v2 2/8] configure: check nvme uring command support Ankit Kumar
2022-05-26 14:48   ` [PATCH v2 3/8] nvme: add nvme opcodes, structures and helper functions Ankit Kumar
2022-05-27  7:29     ` Kanchan Joshi
2022-05-27 12:24       ` Jens Axboe
2022-05-27 13:21         ` Ankit Kumar
2022-05-27 14:45     ` Vincent Fu
2022-05-27 14:54       ` Jens Axboe
2022-05-27 18:07         ` Jens Axboe
2022-05-26 14:48   ` [PATCH v2 4/8] engines/io_uring: add new I/O engine for uring passthrough support Ankit Kumar
2022-05-27  6:37     ` Kanchan Joshi
2022-05-26 14:48   ` [PATCH v2 5/8] docs: document options for io_uring_cmd I/O engine Ankit Kumar
2022-05-27  6:54     ` Kanchan Joshi
2022-05-27 13:26       ` Ankit Kumar
2022-05-27 15:19     ` Vincent Fu
2022-05-26 14:48   ` [PATCH v2 6/8] zbd: Check for direct flag only if its block device Ankit Kumar
2022-05-27 16:15     ` Vincent Fu
2022-05-30 10:14     ` Shinichiro Kawasaki
2022-05-26 14:48   ` [PATCH v2 7/8] engines/io_uring: Enable zone device support for io_uring_cmd I/O engine Ankit Kumar
2022-05-27 17:23     ` Vincent Fu
2022-05-26 14:48   ` [PATCH v2 8/8] examples: add 2 example job file for io_uring_cmd engine Ankit Kumar
2022-05-27 17:30     ` Vincent Fu
2022-05-27 18:05       ` Jens Axboe
2022-05-27  7:02   ` [PATCH v2 0/8] Add support for uring passthrough commands Kanchan Joshi
2022-05-27 13:24     ` Ankit Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220526144809.14877-2-ankit.kumar@samsung.com \
    --to=ankit.kumar@samsung.com \
    --cc=anuj20.g@samsung.com \
    --cc=axboe@kernel.dk \
    --cc=fio@vger.kernel.org \
    --cc=joshi.k@samsung.com \
    --cc=krish.reddy@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox