lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230421114440.3343473-2-leitao@debian.org>
Date:   Fri, 21 Apr 2023 04:44:38 -0700
From:   Breno Leitao <leitao@...ian.org>
To:     io-uring@...r.kernel.org, linux-nvme@...ts.infradead.org,
        asml.silence@...il.com, axboe@...nel.dk
Cc:     leit@...com, linux-kernel@...r.kernel.org,
        linux-block@...r.kernel.org, sagi@...mberg.me, hch@....de,
        kbusch@...nel.org, ming.lei@...hat.com
Subject: [PATCH v2 1/3] io_uring: Create a helper to return the SQE size

Create a simple helper that returns the size of the SQE. The SQE could
have two size, depending of the flags.

If IO_URING_SETUP_SQE128 flag is set, then return a double SQE,
otherwise returns the sizeof of io_uring_sqe (64 bytes).

Signed-off-by: Breno Leitao <leitao@...ian.org>
---
 io_uring/io_uring.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/io_uring/io_uring.h b/io_uring/io_uring.h
index 25515d69d205..25597a771929 100644
--- a/io_uring/io_uring.h
+++ b/io_uring/io_uring.h
@@ -394,4 +394,7 @@ static inline void io_req_queue_tw_complete(struct io_kiocb *req, s32 res)
 	io_req_task_work_add(req);
 }
 
+#define uring_sqe_size(ctx) \
+	((1 + !!(ctx->flags & IORING_SETUP_SQE128)) * sizeof(struct io_uring_sqe))
+
 #endif
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ