NVME Format Command 个人笔记

1 篇文章 0 订阅

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:

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值