Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4073399rdh; Tue, 28 Nov 2023 11:03:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IHUsKAy8E/EnLInTR5HW5BK7beueasha9bvq7Yu1U3fbKYxKGt4Tubdir/A+O9N2JrQ9mVJ X-Received: by 2002:a17:90b:3907:b0:26b:4a9e:3c7e with SMTP id ob7-20020a17090b390700b0026b4a9e3c7emr17756623pjb.4.1701198187391; Tue, 28 Nov 2023 11:03:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701198187; cv=none; d=google.com; s=arc-20160816; b=ukrPMCoeFh26VC2Dv66gwX7fehSaY6xIHjkoadosrvjpaap1slIx0VYWl7SPmCzeBT E/VcEIumkeDqfh0D7OfTaxRqRQ9sVvJGRUFjyEw4RUGAedxjkSchsVaBl/wImAAYpY+q VoiElok6NKXadBxXmX1iJZBmgU8Vt9rvcJJMr6dyj8Z6mktBEa63evmWf8YfbWqfvjx7 plhNtCUn2FApqDoJo+1sLN9WoE2VTyApfLYOJ01mKmScU+/Nm6qK937qvmRm8BRi5wnc L0yTAZGrdp5fJV19JA9wlb5R6BaKVLT9DNsgIYpaxazm391MZx78y0cmKn3QcV/M8+Vn NJsw== 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:dkim-signature; bh=JV6zvHc7DgjYjuSRPUTOq/76cABMWlfRuPIwbT9BFxQ=; fh=/sp31uu1n69Z5QlBuvkBZ3rCmtoiVU9EN82E449uxmw=; b=GQMaNK3+MB16XDX0GnfVXfdvxoZp85A5COXjhUR1/RCt3KpyBn9Ir3gH9hgCq4sP0i HCkQZaermhQE/cG/Y1fmUweFckPqz69QuYvbVn3ca7meC0hOhrsK5xH6XzV2++CEpubv LOkx9y0p2FtdbngVN8XLOTQd5tH3t3STTVfYYwa6tN5RXC15AbS642pg5l+lOTEM4jU5 GKsPhHOYTEZsIu6+5uqiV4ukL/reGYRQiodm3CKu2AhZJFOclmVKlRTyUokfFZ1zipxI fBs/ygxxb1qzzTsW4mecnZN1iT2XOjNfnu7ZSRxQFlTDYuFdXu8FK9Gm+Vdvz5fEaObT 4+GA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qIqofS+x; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id pq11-20020a17090b3d8b00b0028598045410si10683516pjb.67.2023.11.28.11.03.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 11:03:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qIqofS+x; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 8FC2F8060669; Tue, 28 Nov 2023 11:03:05 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345686AbjK1TC4 (ORCPT + 99 others); Tue, 28 Nov 2023 14:02:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229944AbjK1TCz (ORCPT ); Tue, 28 Nov 2023 14:02:55 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE22CC3 for ; Tue, 28 Nov 2023 11:03:01 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F3BF7C433C8; Tue, 28 Nov 2023 19:03:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701198181; bh=2SQ8nvZfspwKy1et1VHxsaVcIH7exyr+AqAnPoaC4q0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qIqofS+xJmG1Hdyo9mOGQ7WWhrSLt7JnhNRiAWWhDW2eqrXLV0YqBF8x+IAXTCBAY 7SrHq5chBNn6+yG3xBeuSrOzyGVYcEB2MOLhc+OJ6mszIcKIjAU3cD7YSGSZNHvExx iYqofMI4dh+xkcF3HxISDhGdR35hcd14Lnhulw9kOXo0S9mSOVFlhtqbtXjSLHpy9K aKYswY96frh8VpfXZaUrbK9KqE3eOtZffK5w2EIBqGQpwhV1YcGJFW44LTBc9wTKsF cYf0Hnp6I6V7NSC/Lx3cziaEoI3BJc7dUG/e1U+YupqvYDFQzK8tpsFpJJWR96lSdv FOFUi6jQo9ODg== Date: Tue, 28 Nov 2023 12:02:58 -0700 From: Keith Busch To: Christoph Hellwig Cc: Daniel Wagner , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, Sagi Grimberg , Hannes Reinecke Subject: Re: [RFC v1] nvme: add cse, ds, ms, nsze and nuse to sysfs Message-ID: References: <20231127103208.25748-1-dwagner@suse.de> <20231127141857.GA25833@lst.de> <20231127155649.GA1403@lst.de> <20231127163333.GA2273@lst.de> <20231128130508.GA8221@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231128130508.GA8221@lst.de> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 28 Nov 2023 11:03:05 -0800 (PST) On Tue, Nov 28, 2023 at 02:05:08PM +0100, Christoph Hellwig wrote: > On Mon, Nov 27, 2023 at 09:46:43AM -0700, Keith Busch wrote: > > > > > > Yes. But does it care about the tuple size, or the actual size of the > > > metadata field even if is bigger than the PI tuple? > > > > tuple_size is the same value as metadata size regardless of PI usage. > > See nvme_init_integrity() for how this driver sets it: > > > > integrity.tuple_size = ns->ms; > > Yes, for the case where we actually support integrity in the kernel > for a given device. But if the device has a metadata size larger than > the PI size we still support it, and just let the device strip/insert > the PI. I'm pretty sure that isn't right. We already support PI regardless of the metadata size as long as the PI field is in the first 8 bytes. Strip/insert doesn't even work if metadata is larger than a PI field. For any metadata case where PI isn't used, the driver requests allocating an empty buffer for the purpose. > And if nvme-cli wants to report detailed information about > the namespace it probably needs to report the actual metadata size > as the tuple size won't be reported given that we're never initializing > the kernel PI support. I don't understand. For any namespace with a metadata size, even if the namespace format doesn't have PI support, we still register an "integrity" profile with no-ops to get that unused buffer just so the block layer can access the format. We alyways set the tuple_size to the namespace metadata-size so the kernel buffer is correctly sized. This all works as long as the metadata is separate (not extended) and kernel has CONFIG_BLK_DEV_INTEGRITY.