From nobody Thu Apr 25 23:47:55 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VQXbb5sHxz5JpBD; Thu, 25 Apr 2024 23:47:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VQXbb4kdLz4GTS; Thu, 25 Apr 2024 23:47:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714088875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t0/QCHGPhsrqexKYQihCctyKatJu4cd/XvbuxMpju3Q=; b=Yj/59zy5BR4GQ0h8GB/FqVrHtXKMh5j6UU9QAa68JZ2yZGXiWQqEgxKkDOTSmYekgo+32a XktPBbwrCkyWAbvZXbamH3zIzltCAa5Z/PG0ykiJr/Pw59JX8UDD4khsJQDgansvXMlUed P5sOeuTONn0s4cH13qoN4sZd+iKOh5GL1WBT7Mkuw71cKup56aqH01haevuO3fH3XKLFjw 6wQCdKfYBEAYpuuUD4tPkm4Py/HdlhHpWZRQ9ttVOVmGg+xVwiBJECkflEVVUj7y01IMy8 apIB54ok5UBzsCoBv1KXQ2BHick5SdyuXvDpF5d9coFBPfHUZpAKLu3cp1/ISQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714088875; a=rsa-sha256; cv=none; b=I332EIXdMnG+6L8KOEOTdd02DCaOfYOdpKLabawpylj/MRb4eXkUta+cAklgVf1FpgD7fO xicCQkJRytGtWUTG8ygWzGlG1YzSiqqRphygR1ZtTz2fikLE+2p2lRgbvn9dBfyrd47qdJ GctnG9pRUTJIc9kRLTFAUnbjEN7D7kLkCeHeRy+AnHImWDpfxTj0Hag+N+VpKUnFanfTOU XDuD7r0SOUmUuAX2qOvE5kZnshAxJo6DJ5og9QtfEXojMCxc8KKhCxUVeXHH0g53IUljm4 h6BRXscsppvIIzHEux0IAEbcxTxeTnH9bSsBFEmB/3ddWqA9F4T/Cujw/Imvkw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714088875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t0/QCHGPhsrqexKYQihCctyKatJu4cd/XvbuxMpju3Q=; b=BNURWOtZVJGYelYqPjcoMzDn/tdypNgf7HL+3gVSnTOCrlKTEIcqxTzPwy2aMyEOCIpbXC ekvRjPK3bgx7USNYZE1EFJ5WdMV3Jk/zhjlbCffiLPDFQsarVd3BMeWBAcdhL2J8MPAgRJ uwJsCfI6PxMIhuDaQGVrGpKD/C1nGtzAKvHZbuINIRJB5wrLDY9dj1KMQF4Nm8xyGexKSV bGoy1O4IkN1VMDHBq4YlQq7m+S1f3HsBhspMnmWkLFCrpMSN/2iIXMU47RIEPHn+hykzf5 LefX3Io/bF3IhsKmkd2OdS/C41YMeZRPE66OokE/lUleULd8yXMQNjCi/ahkIA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VQXbb456czKct; Thu, 25 Apr 2024 23:47:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43PNltmU055597; Thu, 25 Apr 2024 23:47:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43PNltdv055594; Thu, 25 Apr 2024 23:47:55 GMT (envelope-from git) Date: Thu, 25 Apr 2024 23:47:55 GMT Message-Id: <202404252347.43PNltdv055594@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: ce3b53ffcc3e - main - nvmecontrol: Flesh out nvmecontrol format information List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ce3b53ffcc3ecc00fa6283542c60ff1fe697d853 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=ce3b53ffcc3ecc00fa6283542c60ff1fe697d853 commit ce3b53ffcc3ecc00fa6283542c60ff1fe697d853 Author: Warner Losh AuthorDate: 2024-04-25 23:47:18 +0000 Commit: Warner Losh CommitDate: 2024-04-25 23:47:18 +0000 nvmecontrol: Flesh out nvmecontrol format information The format command takes a number of different parameters. Include a brief summary of what the values mean, though since the driver's support for metadata is at best weak, 0's are almost always used for values other than -f format. Add an example that ties it all together. Sponsored by: Netflix Reviewed by: pauamma@gundo.com, chuck Differential Revision: https://reviews.freebsd.org/D44958 --- sbin/nvmecontrol/nvmecontrol.8 | 81 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 70 insertions(+), 11 deletions(-) diff --git a/sbin/nvmecontrol/nvmecontrol.8 b/sbin/nvmecontrol/nvmecontrol.8 index b812149b5c7d..b5a85b1ab9f5 100644 --- a/sbin/nvmecontrol/nvmecontrol.8 +++ b/sbin/nvmecontrol/nvmecontrol.8 @@ -442,24 +442,62 @@ Use Extended Data Structure. .Ss format Format either specified namespace, or all namespaces of specified controller, using specified parameters: +.Bl -tag -width 8n +.It Fl f Ar fmt +The index .Ar fmt -LBA Format, +of the parameters to use. +LBA Format #, as specified in the identification of the namespace using +.Dq nvmecontrol identify +command with a namespace specified maps this index into these parameters. +.It Fl m Ar mset +Metadata Setting. .Ar mset -Metadata Settings, -.Ar pi -Protection Information, -.Ar pil +.Bl -tag -compact -width 6n +.It Dv 0 +do not transfer metadata with LBA information +.It Dv 1 +Transfer the metadata as part of the extended LBA information. +.El +.It Fl p Ar pi +Protection Information. +.Bl -tag -compact -width 6n +.It Dv 0 +Protection Information not enabled. +.It Dv 1 +Type 1 information protection enabled. +.It Dv 2 +Type 2 information protection enabled. +.It Dv 3 +Type 3 information protection enabled. +.El +.It Fl l Ar pil Protection Information Location. +.Bl -tag -compact -width 6n +.It Dv 0 +Transfer the protection metadata as the last N bytes of the transfer. +.It Dv 1 +Transfer the protection metadata as the first N bytes of the transfer. +.El +.It Fl E +Enables User Data Erase during format. +All users data is erased and subsequent reads are indeterminate. +The drive may implement this as a cryptographic erase or it may +physically erase the underlying media. +.It Fl C +Enables Cryptographic Erase during format. +All user data is erased cryptographically by deleting the encryption key, +rendering it unintelligible. +.El +.Pp When formatting specific namespace, existing values are used as defaults. When formatting all namespaces, all parameters should be specified. Some controllers may not support formatting or erasing specific or all namespaces. -Option -.Fl E -enables User Data Erase during format. -Option -.Fl C -enables Cryptographic Erase during format. +The +.Xr nvme 4 +driver does not currently support metadata and protection information +transfers. .Ss sanitize Sanitize NVM subsystem of specified controller, using specified parameters: @@ -763,6 +801,27 @@ device. The corresponding .Pa nvmeXnsY device is used automatically. +.Pp +.Dl nvmecontrol format -f 2 -m 0 -p 0 -l 0 -C nvme2 +.Pp +Format all the name spaces on nvme2 using parameters from +.Dq LBA Format #2 +with no metadata or protection data using cryptographic erase. +If the +.Dq nvmecontrol identify -n 1 nvme2 +command ended with +.Pp +.Bl -verbatim +LBA Format #00: Data Size: 512 Metadata Size: 0 Performance: Good +LBA Format #01: Data Size: 512 Metadata Size: 8 Performance: Good +LBA Format #02: Data Size: 4096 Metadata Size: 0 Performance: Good +LBA Format #03: Data Size: 4096 Metadata Size: 8 Performance: Good +LBA Format #04: Data Size: 4096 Metadata Size: 64 Performance: Good +.El +.Pp +then this would give a 4k data format for at least namespace 1, with no +metadata. +.Pp .Sh DYNAMIC LOADING The directories .Pa /lib/nvmecontrol