Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp66178rwr; Wed, 19 Apr 2023 03:34:10 -0700 (PDT) X-Google-Smtp-Source: AKy350bQN4cdmbQjk/071HmIz8qGOavYrq9UxVwRAsebmUxi4DFhoWZBQu2XGmqATR3MXncKw0jO X-Received: by 2002:a17:902:d314:b0:1a6:5274:c1b0 with SMTP id b20-20020a170902d31400b001a65274c1b0mr4732748plc.60.1681900450499; Wed, 19 Apr 2023 03:34:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681900450; cv=none; d=google.com; s=arc-20160816; b=u68huPaR51Hrhdv7Ap5omFdYLrYIMvrwiOfEGMSBDPpQl9BPs0iXxcPxw/fVZI4KHS gdoG8b5WXl4P1AmlaN11Ygw4NI92C9W+8bYuoge+nQgvMCaRYAKZ+lnb2H1T6BEtIQTV oBAz06BJYG1DalwsA4zcO4VPknIIWAFnL5RudbwlYfj9Vt+ihr2fZi6zKwv/NSB3mXfl PrZhr6VWIGoOwfBjUJ2z1/czj1a4I30d87fuz2bPtMs/JSv70xuWkjDSQkcKAnbn+m5U kLjXSdxDIsgbylrXwvqmO7Y4aoKOSrNgJ3LtPXpEOkeiCfcH8YSXchmfb82Kcwj1prXa ESRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=1cjooBvMCNJhlavL1EbY+Mb4+Vf8+MK1I5YGhYcyjWY=; b=cAJ+L9ztO1cIZOYdCZffcSKpKeCH8VHwh/Ww3vTLGuFy3kR3HweKr+eVofekHqy8dN +MnNDoM6YUMh8E64F5mUlzEshGZjmnqLituVX4AG2ccqeTUB4646runhJKMpNBceiaF0 8AU75U5OCsa2zLoLsdWozv5y15h5dgYMTf9d56vELoOaaYaU4k20wsQvNWj66qHq3tIj Do+YVfkgtQINtPwW/SWimLnO9T7lUsaB2F61wC1DWRD2XRVY9S0QDns2tvcpYHsGZBU0 DQhW3PBqf4Fz91RGkBkczHu0/Ve13Fp2G7AJDCA8jwnBsoM5wseidomihonRNpQjDi71 YnXA== 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 c5-20020a6566c5000000b0050bf6a432ecsi12518799pgw.681.2023.04.19.03.33.58; Wed, 19 Apr 2023 03:34:10 -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 S232676AbjDSKaB (ORCPT + 99 others); Wed, 19 Apr 2023 06:30:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232416AbjDSK3t (ORCPT ); Wed, 19 Apr 2023 06:29:49 -0400 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D72A655B5; Wed, 19 Apr 2023 03:29:48 -0700 (PDT) Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-2f27a9c7970so2872830f8f.2; Wed, 19 Apr 2023 03:29:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681900187; x=1684492187; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1cjooBvMCNJhlavL1EbY+Mb4+Vf8+MK1I5YGhYcyjWY=; b=BieOR9qWpyyctOUZRHD6mXLe5j0m8n2iG0O3S/oPEzGCNK9x68OUJOBanpmPzJLkp2 i25+twwxGmBoPYFsoa2z+1+09eYUpT1uVHvGnh6O0V+LdDYnV3kMr8GvwUFEsgUERsVU cmqFaRTXc9W03qSe6YjIxrbYnjIzMKB0FKj3CiaewPwt/wdhDGMqVWoGYOIUVCXEELNA Pn8kNH+1RlBt/hZKzqZ9CFziKSa5aof7PpIKBp3BvADoVAYXTX1CpE4DZEXK+T0hKoE+ REGmiId4IVmS9HaI1ebEwpa1ywjv3QPxgH0lul8vASr+IaTd4t/NhFt04AmsrTVKdqjU klgg== X-Gm-Message-State: AAQBX9eZFIgy/ExcYmm+edBz1gCew6YooUdpZlEgS3+Awi2sWGMQUj3q KJKKcI4eJqS86yslwEx0ppm1UwUFU/j4U0G2 X-Received: by 2002:adf:e588:0:b0:2f9:2fb0:c46 with SMTP id l8-20020adfe588000000b002f92fb00c46mr3516652wrm.68.1681900187024; Wed, 19 Apr 2023 03:29:47 -0700 (PDT) Received: from localhost (fwdproxy-cln-017.fbsv.net. [2a03:2880:31ff:11::face:b00c]) by smtp.gmail.com with ESMTPSA id k25-20020a7bc419000000b003f1736fdfedsm1783916wmi.10.2023.04.19.03.29.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 03:29:46 -0700 (PDT) From: Breno Leitao To: io-uring@vger.kernel.org, linux-nvme@lists.infradead.org, asml.silence@gmail.com, axboe@kernel.dk Cc: 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: [PATCH 2/2] io_uring: Remove unnecessary BUILD_BUG_ON Date: Wed, 19 Apr 2023 03:29:30 -0700 Message-Id: <20230419102930.2979231-3-leitao@debian.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230419102930.2979231-1-leitao@debian.org> References: <20230419102930.2979231-1-leitao@debian.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 In the io_uring_cmd_prep_async() there is a unnecessary compilation time check to check if cmd is correctly placed at field 48 of the SQE. This is uncessary, since this check is already in place at io_uring_init(): BUILD_BUG_SQE_ELEM(48, __u64, addr3); Remove it and the uring_cmd_pdu_size() function, which is not used anymore. Keith started a discussion about this topic in the following thread: https://lore.kernel.org/lkml/ZDBmQOhbyU0iLhMw@kbusch-mbp.dhcp.thefacebook.com/ Signed-off-by: Breno Leitao --- io_uring/uring_cmd.c | 3 --- io_uring/uring_cmd.h | 8 -------- 2 files changed, 11 deletions(-) diff --git a/io_uring/uring_cmd.c b/io_uring/uring_cmd.c index 5cb2e39e99f9..fccc497bab59 100644 --- a/io_uring/uring_cmd.c +++ b/io_uring/uring_cmd.c @@ -71,9 +71,6 @@ 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 size = sizeof(struct io_uring_sqe); - BUILD_BUG_ON(uring_cmd_pdu_size(0) != 16); - BUILD_BUG_ON(uring_cmd_pdu_size(1) != 80); - if (req->ctx->flags & IORING_SETUP_SQE128) size <<= 1; diff --git a/io_uring/uring_cmd.h b/io_uring/uring_cmd.h index 7c6697d13cb2..8117684ec3ca 100644 --- a/io_uring/uring_cmd.h +++ b/io_uring/uring_cmd.h @@ -3,11 +3,3 @@ int io_uring_cmd(struct io_kiocb *req, unsigned int issue_flags); int io_uring_cmd_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe); int io_uring_cmd_prep_async(struct io_kiocb *req); - -/* - * The URING_CMD payload starts at 'cmd' in the first sqe, and continues into - * the following sqe if SQE128 is used. - */ -#define uring_cmd_pdu_size(is_sqe128) \ - ((1 + !!(is_sqe128)) * sizeof(struct io_uring_sqe) - \ - offsetof(struct io_uring_sqe, cmd)) -- 2.34.1