Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5433166rwl; Tue, 11 Apr 2023 05:32:50 -0700 (PDT) X-Google-Smtp-Source: AKy350a/pJ7nRjiRe0dk1aJXQ4hRXXi5hecduQfw6xfyLT57os3Y+fAf07oAtaMU6YdaYgWY3dZ9 X-Received: by 2002:a17:906:cb18:b0:947:a3ed:df91 with SMTP id lk24-20020a170906cb1800b00947a3eddf91mr13097317ejb.70.1681216369956; Tue, 11 Apr 2023 05:32:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681216369; cv=none; d=google.com; s=arc-20160816; b=mydnqYx2TEinF0brYcGsTIBU8ceNlFZ5YDPnRfUUR5Rz3/RelZ2a30QoVewfC7ojgG 7Qzy2H7Nr7fVD9QCn6zniIbXoi3JsZIpbxpWiBYkj/lIyDCSo9h/tjPEF8FQdAkQXUbi 69YrOq+Z1Dm+eBx22HZoCWWBZ9pmMilS5MN+OjAuPvDgH08ckkIGAdJAg7CTPy3GdD2E AfFgxK8wryo2LA3Plxt2FxPVkz5SKKu6RTUDq26MFqo+4LKf4J99Al87bKctb2qLYcDj 4vvQ8fGryh2VkAiJqCGJsiNVN43ZAO04RgPVPZu+CpvzeYljGda9az24nwUwdMfZ4TQg NapQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=Iv40Wkjx2Hf7U9sldsgemiXt0WJwZLPB7N5j/0A4xtA=; b=It8qyJCYGYkQw7zMFTW9qIlSa9YDEORtVstLbyTGlejRtPxFFRWCWof76lGftR8eW9 7sf/Y/Gd4TAgvAu3wscbfGbZ5iLKO4SdJhUiI5jgh9boE0YzzlNkdMrH57n5TDVoAiz8 ACGe978u4bDcOCFOJvgBuK1r9OdzKJl2QdVo4L5iyCtZGvPUM5Hws1keb5agjIC6IeO8 LzdtBUVGM4mA2R/SsONhHiXJwN3iMMRvjKzStbkGTtBqbcyZ8shkz97aEeHdMxmnA0gJ n0UT2rtqTsaiM9VQJIzb3N9nmaKfior21SCtx7BPUTeZYp4ru8isxgDXC1xSO9yipNka 6BqA== 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 nb4-20020a1709071c8400b009334edab100si15405151ejc.49.2023.04.11.05.32.24; Tue, 11 Apr 2023 05:32:49 -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 S229701AbjDKMW4 (ORCPT + 99 others); Tue, 11 Apr 2023 08:22:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229477AbjDKMWz (ORCPT ); Tue, 11 Apr 2023 08:22:55 -0400 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F4291717; Tue, 11 Apr 2023 05:22:54 -0700 (PDT) Received: by mail-wr1-f48.google.com with SMTP id o18so7362008wro.12; Tue, 11 Apr 2023 05:22:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681215773; x=1683807773; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Iv40Wkjx2Hf7U9sldsgemiXt0WJwZLPB7N5j/0A4xtA=; b=yv4FJ7t6tme8poClQGeqViG0BYanEaNJrCPxFd4FDeaaoxmXm/xOYMJ5BxgzUzeQbN 9WxiTJMtsTeKAkQCSbJbO3ovTRyjKM2fx5csKwnggmr89SOKSqnjysbkG6IQAK1M5R/b Des5g8hwGnWo1/d0dK7Ga5egdQBqUQIJTAFbi8JDyaISSxu3rDKuelKYThLn5QbsOaox c4S9Qs3Idm1/sWqtqJczM+390EWLqDdbtUsGjgXA4ovxYxzSvQuqnm4ZYSI8kolDBTOe WGidI36hhHpsFNoi0s7m4JfLanDQ9Z/cfHj5Vl2ggj+234P+vxp9EOKwCoYaTU/6UIhE u1Vw== X-Gm-Message-State: AAQBX9fZBbec4jy4wzuXaOolPtwcKsOc/XaGC95kFGzJ/x5fRUl6OfGU dojTg9rS0M0neuwov4aorJc= X-Received: by 2002:a5d:4f83:0:b0:2e4:6197:21b3 with SMTP id d3-20020a5d4f83000000b002e4619721b3mr7751336wru.55.1681215772861; Tue, 11 Apr 2023 05:22:52 -0700 (PDT) Received: from gmail.com (fwdproxy-cln-015.fbsv.net. [2a03:2880:31ff:f::face:b00c]) by smtp.gmail.com with ESMTPSA id a5-20020a5d4d45000000b002c3f81c51b6sm14480806wru.90.2023.04.11.05.22.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Apr 2023 05:22:52 -0700 (PDT) Date: Tue, 11 Apr 2023 05:22:50 -0700 From: Breno Leitao To: Keith Busch Cc: asml.silence@gmail.com, axboe@kernel.dk, davem@davemloft.net, dccp@vger.kernel.org, dsahern@kernel.org, edumazet@google.com, io-uring@vger.kernel.org, kuba@kernel.org, leit@fb.com, linux-kernel@vger.kernel.org, marcelo.leitner@gmail.com, matthieu.baerts@tessares.net, mptcp@lists.linux.dev, netdev@vger.kernel.org, pabeni@redhat.com, willemdebruijn.kernel@gmail.com Subject: Re: [PATCH RFC] io_uring: Pass whole sqe to commands Message-ID: References: <20230406144330.1932798-1-leitao@debian.org> <20230406165705.3161734-1-leitao@debian.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=0.5 required=5.0 tests=FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no 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 07, 2023 at 12:51:44PM -0600, Keith Busch wrote: > > @@ -63,14 +63,15 @@ EXPORT_SYMBOL_GPL(io_uring_cmd_done); > > int io_uring_cmd_prep_async(struct io_kiocb *req) > > { > > struct io_uring_cmd *ioucmd = io_kiocb_to_cmd(req, struct io_uring_cmd); > > - size_t cmd_size; > > + size_t size = sizeof(struct io_uring_sqe); > > > > BUILD_BUG_ON(uring_cmd_pdu_size(0) != 16); > > BUILD_BUG_ON(uring_cmd_pdu_size(1) != 80); > > One minor suggestion. The above is the only user of uring_cmd_pdu_size() now, > which is kind of a convoluted way to enfoce the offset of the 'cmd' field. It > may be more clear to replace these with: I agree with you here. Basically it is a bug if the payload (pdu) size is is different than 16 for single SQE or != 80 for extended SQE. So, basically it is checking for two things: * the cmd offset is 48 * the io_uring_sqe struct is 64 Since this is a uapi, I am not confidence that they will change at all. I can replace the code with your suggestion. > BUILD_BUG_ON(offsetof(struct io_uring_sqe, cmd) == 48); It should be "offset(struct io_uring_sqe, cmd) != 48)", right? Thanks for the review!