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: <20230424071937.GA13287@lst.de>
Date:   Mon, 24 Apr 2023 09:19:37 +0200
From:   Christoph Hellwig <hch@....de>
To:     Breno Leitao <leitao@...ian.org>
Cc:     io-uring@...r.kernel.org, linux-nvme@...ts.infradead.org,
        asml.silence@...il.com, axboe@...nel.dk, 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: Re: [PATCH v2 1/3] io_uring: Create a helper to return the SQE size

On Fri, Apr 21, 2023 at 04:44:38AM -0700, Breno Leitao wrote:
> +#define uring_sqe_size(ctx) \
> +	((1 + !!(ctx->flags & IORING_SETUP_SQE128)) * sizeof(struct io_uring_sqe))

Please turn this into an actually readable inline function:

/*
 * IORING_SETUP_SQE128 contexts allocate twice the normal SQE size for each
 * slot.
 */
static inline size_t uring_sqe_size(struct io_ring_ctx *ctx)
{
	if (ctx->flags & IORING_SETUP_SQE128)
		return 2 * sizeof(struct io_uring_sqe);
	return sizeof(struct io_uring_sqe);
}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ