Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp5225646rwr; Mon, 24 Apr 2023 00:22:22 -0700 (PDT) X-Google-Smtp-Source: AKy350b3NolHE94fOPbP3S79N3k2pelNPPB9fdTOptQ/EBp9H0x6Xq2NAgtmqMd703+x49N1Dk6c X-Received: by 2002:a17:902:dac4:b0:1a9:5c41:3f8e with SMTP id q4-20020a170902dac400b001a95c413f8emr8165914plx.42.1682320941817; Mon, 24 Apr 2023 00:22:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682320941; cv=none; d=google.com; s=arc-20160816; b=dFvbxcBtwIJqWW2taHiMQy/HtLcZ6+cf4E365GDVvnGNpIhNPGjI4U9bL755+C3oVX BS427MpYnW1UWfVenqULg5qid39xRjjL/2phh9p0tmV0iHeMLjJ3exTOvAaDxMy+zPik 2Ol90AsVcjvJ3TG1ACSJIUFj14hpZVoF2gwTsv9NuisU0gvOU1lMOtAJyepHeOd1qaIl 3xQrTE43C9bd7qIm1oXlimdlpMo4dQNughMTiOYu72eqVLeuyywoPksFDSfXJUXb0yd/ 4oDqt56kwOoxyVm86lwqfqtxKXweYq/mEPCGQTgqHRQDJ3y3Ubv0sHb1LCXieMXnT4mb INCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=fseJLh0s4wRO8NUaIPlXod9oMTQhV6Es9zj48ztLADg=; b=HgcHbrjjex9r3FmG52xMiZxgEw7UjwPEbjr10LfI2LbtKdEuh5sxEALH2kJc0HgpVN 5RZG8IH8gkmVUqY9NnnUsyuvGyhM+s2w4PW/tQx74nUA7accUPg18QWJGxgQZGZdACJv HUd63E/BrrOCYnJ6HXrQqOt0ZrJIxOlXtqkvBcM55ZeQ+BxgbP2X4+TZE4w9QHr5syce 0bKEr1hMCL/4TefXStH1FJdV954GfofHvWrILc/BTbXLy5jRdRoR+hJEI7Fxz6A7VHh9 PVpnDyTXIxfXZI43QF03GHPkS47CfBuZB1Qf6DAGs4rnKfq5jTcW1LO+LSjobhUTN6xC FeEA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q12-20020a17090311cc00b001a64e7b7026si11446237plh.438.2023.04.24.00.22.07; Mon, 24 Apr 2023 00:22:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231289AbjDXHTn (ORCPT + 99 others); Mon, 24 Apr 2023 03:19:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229547AbjDXHTm (ORCPT ); Mon, 24 Apr 2023 03:19:42 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43FCEE66; Mon, 24 Apr 2023 00:19:41 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 52A536732D; Mon, 24 Apr 2023 09:19:37 +0200 (CEST) Date: Mon, 24 Apr 2023 09:19:37 +0200 From: Christoph Hellwig To: Breno Leitao Cc: io-uring@vger.kernel.org, linux-nvme@lists.infradead.org, asml.silence@gmail.com, axboe@kernel.dk, leit@fb.com, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, sagi@grimberg.me, hch@lst.de, kbusch@kernel.org, ming.lei@redhat.com Subject: Re: [PATCH v2 1/3] io_uring: Create a helper to return the SQE size Message-ID: <20230424071937.GA13287@lst.de> References: <20230421114440.3343473-1-leitao@debian.org> <20230421114440.3343473-2-leitao@debian.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230421114440.3343473-2-leitao@debian.org> User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); }