Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp711423rwr; Thu, 20 Apr 2023 05:36:01 -0700 (PDT) X-Google-Smtp-Source: AKy350bPbZpJg89lcvBOZO7IAL73TdZFBgQOihDcpRuH+88gzw6e5JBB7XzjCVTTmnzbFVgOmVJO X-Received: by 2002:a05:6a20:72a6:b0:eb:69b3:116c with SMTP id o38-20020a056a2072a600b000eb69b3116cmr2535721pzk.52.1681994161428; Thu, 20 Apr 2023 05:36:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681994161; cv=none; d=google.com; s=arc-20160816; b=p3twZgYLCAJNKq39fTn5N0VDHfHlXN9cclONFKPNgBOTzxbuoNNM+jZPkF/iSmJgBt nUWwT2pbjnqHonmi6lpo3sQyYmtl3P/c5/GuUmpbHc9ZESxLUOA+L1ApCVqbcwSSlzNd bNMQj5p3ZaT8DdGV1ltXw/aHzehAx4/2WFZj53VG4z2fj4uhycHnGxhksnAX+B+NC/JQ lwouc/iy9ZrPtinFMs2ReVcZVrGWmHWWupCrF6EHGTj/vXg+FDye2ytzC//3HejcJYKr AArayUzS53sY5q/hezFEBvXxAuUSms6IsLn8k5DR5t1bshblT8B6Y+YEr471gUsYZras tZVQ== 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=yjHuZR1FiTy+CNjCS37PaZAWquM3kFyxRb+Dk2fFwZc=; b=yIHsRtjwE+zn0wzcWjVwMU7qNvn+0gfKmnmRTo5RpSv58SQwrsOu/SeiTxHu0p9d9K oEs8bY+1A/aVQC5Mgu7np7qjGs5UBJOpfbzPUdKlGtzDdqNaJRpu1msDrud+GVZSekIE CKyOELSMDiy4yDEnE5AFcy8f3Nkxn912mwY7S7bfxfR1g0JUQ6XLtOZn74sQWlQD1SrH VxME9ugpH+mMeHyQBGOlwmUCRIz7V6aPR4Z5yzmBJf4TqyDJ7P9+qDAGsj3Q1OUGzs+d v8FtJAnOzCEIb+jdjOmiMsqX8qBpHAKYkMGjlIdJKagAnbhB5MrgSbaxmthz9VxTwsA5 cg7A== 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 o3-20020a63fb03000000b004faeaac4dacsi1577026pgh.753.2023.04.20.05.35.36; Thu, 20 Apr 2023 05:36:01 -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 S233116AbjDTMcD (ORCPT + 99 others); Thu, 20 Apr 2023 08:32:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbjDTMcA (ORCPT ); Thu, 20 Apr 2023 08:32:00 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 757F37A8F; Thu, 20 Apr 2023 05:31:44 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 7BF2B68AFE; Thu, 20 Apr 2023 14:31:39 +0200 (CEST) Date: Thu, 20 Apr 2023 14:31:39 +0200 From: Christoph Hellwig To: Breno Leitao Cc: Christoph Hellwig , 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, kbusch@kernel.org, ming.lei@redhat.com Subject: Re: [PATCH 1/2] io_uring: Pass whole sqe to commands Message-ID: <20230420123139.GA32030@lst.de> References: <20230419102930.2979231-1-leitao@debian.org> <20230419102930.2979231-2-leitao@debian.org> <20230420045712.GA4239@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Thu, Apr 20, 2023 at 05:29:18AM -0700, Breno Leitao wrote: > > > - cmd_size = uring_cmd_pdu_size(req->ctx->flags & IORING_SETUP_SQE128); > > > + if (req->ctx->flags & IORING_SETUP_SQE128) > > > + size <<= 1; > > > > > > Why does this stop using uring_cmd_pdu_size()? > > Before, only the cmd payload (sqe->cmd) was being copied to the async > structure. We are copying over the whole sqe now, since we can use SQE > fields inside the ioctl callbacks (instead of only cmd fields). So, the > copy now is 64 bytes for single SQE or 128 for double SQEs. That's the point of this series and I get it. But why do we remove the nice and self-documenting helper that returns once or twice the sizeof of the SQE structure and instead add a magic open coded left shift?