Format NVM command – NVM Command Set Specific
This command is used by the host to change the LBA data size and/or metadata size.
After the Format NVM command successfully completes, the controller shall not return any user data that was previously contained in an affected namespace.
Format Command执行成功后,不返回之前的用户数据。
两种 secure erase types:
1:The User Data Erase erases all user content present in the NVM subsystem
2:The Cryptographic Erase erases all user content present in the NVM subsystem by deleting the encryption key with which the user data was previously encrypted
The scope of format operation and format with secure erase depend on :
1:the attributes that the controller supports for the NVM command.
2:the Namespace Identifier specified in command described ↓
note:
with Secure Erase→ refers to FNA.bit1 and bit0 is ignored.
without Secure Erase→refes to FNA.bit0 and bit1 is ignored.
这里的FNA.bit这一栏是指的是这个bit的value,并不是index:如果Dword10中SES=0,(no secure erase),即这里FNA.bit是bit0,bit0的value有两种情况,0或者1,再分别与NSID=全F或者某一个NSID,组成Format的scope。要么是All namespace 或者是particular namespace specified
如果不带secure,只看bit0的value,如果带secure,只看bit1.
FNA↓
Command Abort Return status:
1:If there are I/O commands being processed for a namespace→a Format NVM command that is submitted affecting that namespace may be aborted; →return status Command Sequence Error (0xC)
2: If a Format NVM command is in progress→I/O command that is submitted for any namespace affected by that Format NVM command may be aborted→return status code Format in Progress (0x84)
Command Complete Without error:(For a Format NVM command with the NSID field set to FFFFFFFFh)
1:Format command specific secure erase,
a) if FNA.bit1 set to 1 and there are no NS in the NVM subsytem b) if FNA.bit1 set to 0 and there are no attached namespaces
2: Format command does not specify a secure erase:
a) if FNA.bit0 set to 1, and there are no NS in the NVM subsytem b) if FNA.bit0 set to 0 and there are no attached namespaces
Command Dword 10:
check if End to End Data Protection is not supported,就是check Protection Information(PI)的值。
Command Structure:
The Format NVM command uses the Command Dword 10 field. All other command specific fields are reserved.
LBA Format data structure:
LBA format n 在Identify Namespace Data Structure中。最多有16个(LBAF0~LBAF15)。每个LBAF是4个bytes,合32个bits.
Format 命令改变的format大小,是根据盘支持的LBAF data structure中的LBA Data Size来看。一般是512和4k两种format,作为lbaf0和lbaf1,send format command时候,Dwor10中的LBAF字段,填的是这里的Index。即format成512(lbaf0)-->Dword10.LBAF=0, 还是format成4096(lbaf1)-->Dword10.LBAF=1
可以根据Identify Namespace Data Structure中,id_ns.nlbaf字段得到Number of lbaf,知道支持有几种LBA format,再通过get_lbads获得lba的data size为512或者4096·
问题:为什么total_capacity = lbads*nsze?
origin_total_capacity = origin_lbads * origin_nsze
因为Namespace Size(NSZE)这里的size其实是LBA的个数。所以总的Capacity就是LBA的个数(NSZE)乘以LBA Data Size(LBADS)
OACS的 value: