注意:这个命令在nvme1.0和1.1中是“Firmware Activate”命令。
Firmware Commit命令被用来修改Firmware Image或者Boot分区。
当修改一个Firmware Image时,Firmware Commit命令校验被下载的Firmware Image是否有效并且将这个版本提交到特定的Firmware Solt。在下一次Controller Level Reset的时候,这个命令会选择哪一个Firmware Image将会被激活。当前正在运行的Firmware Image版本可以由图111中的Identify Controller Data Struct中的Firmware Revision字段确定或者由Log Page中的Firmware Slot Information确定。NVM系统中的所有Controller应该共享Firmware Image Slot而且所有Controller应该运行同一个Firmware Image。
当修改Boot分区时,Host可能会选择将Boot Partition修改为Active或者Replace状态。一个Boot Partition只能在解锁是被写入(参见8.13)。
Firmware Commit只是用了DW10字段。
图76:Firmware Commit-Command DW10
Bit | Description | ||||||||||||||||||
31 | Boot Partition ID (BPID):指定应该被使用的Boot Partition一个Commit Action中的动作。 | ||||||||||||||||||
30:06 | Reserved | ||||||||||||||||||
05:03 | Commit Action (CA): 这一字段代表了使用Firmware Image Download命令下载的Image或者提前载入进去的Image的作用。参见8.1。虾苗代表了这几种作用:
| ||||||||||||||||||
02:00 | Firmware Slot (FS): Specifies the firmware slot that shall be used for the Commit Action, if applicable. If the value specified is 0h, then the controller shall choose the firmware slot (slot 1 – 7) to use for the operation. |
5.11.1 Command Completion
这个命令完成时。Controller向ACQ中发送一个Completion Queue Entry代表这个命令的完成状态。
请求下次重启时将新的Image设置指定的状态并且返回一个00h的状态值,第7.3.2节中定义了激活指定Image的Controller Level Reset。
图77:Firmware Commit-Command Specific Status Values
Value | Description |
06h | Invalid Firmware Slot: The firmware slot indicated is invalid or read only. This error is indicated if the firmware slot exceeds the number supported. |
07h | Invalid Firmware Image: The firmware image specified for activation is invalid and not loaded by the controller. |
0Bh | Firmware Activation Requires Conventional Reset: The firmware commit was successful, however, activation of the firmware image requires a conventional reset. If an FLR or controller reset occurs prior to a conventional reset, the controller shall continue operation with the currently executing firmware image. |
10h | Firmware Activation Requires NVM Subsystem Reset: The firmware commit was successful, however, activation of the firmware image requires an NVM Subsystem Reset. If any other type of reset occurs prior to an NVM Subsystem Reset, the controller shall continue operation with the currently executing firmware image. |
11h | Firmware Activation Requires Reset: The firmware commit was successful; however, the image specified does not support being activated without a reset. The image shall be activated at the next reset. |
12h | Firmware Activation Requires Maximum Time Violation: The image specified if activated immediately would exceed the Maximum Time for Firmware Activation (MTFA) value reported in Identify Controller. To activate the firmware, the Firmware Commit command needs to be re-issued and the image activated using a reset. |
13h | Firmware Activation Prohibited: The image specified is being prohibited from activation by the controller for vendor specific reasons (e.g., controller does not support down revision firmware). |
14h | Overlapping Range: This error is indicated if the firmware image has overlapping ranges. |
1Eh | Boot Partition Write Prohibited: This error is indicated if a command attempts to modify a Boot Partition while it is locked (refer to section 8.13.3). |
Firmware Image Download 命令用来下载一个Image的整个或者一部分。这个Image用于将来更新Controller。这个命令可能在ASQ中或者IOSQ中有命令未完成时被下发。这个命令下载一个新的Image去Controller(整体或部分)。
这个Image可以由使用分离的Firmware Image Download命令下载的部分Image组成。每一个Firmware Image Download命令都包含了一个D
5.15.1 Identify Command Overview
Identify 命令返回一个NVM subsystem,Controller或者Namespace(s)的描述信息。数据结构大小是4096字节。
Identify 命令使用了Data pointer和DW10字段,其他字段都被保留。
图106:Identify-Data Pointer
Bit | Description |
127:00 | Data Pointer (DPTR):这一字段制定了数据buffer的起始地址。 参见图11的定义。 |
图107:Identify-Command DW10
Bit | Description |
31:16 | Controller Identifier (CNTID): 这一字段代表了Controller id,被用来作为Identify操作的一部分。 如果这个字段没有被当做Identify操作使用,那么Host应该将此字段清0以便向后兼容(0是一个Vaild Controller Identifier)。 Controller支持Namespace Management功能(参见8.12)的话,也应当支持这个字段。 |
15:08 | Reserved |
07:00 | Controller or Namespace Structure (CNS):这一字段规定了哪种信息被返回至Host,参见图108 |
数据结构的返回基于Controller of Namespace Structure(CNS)字段在图108中的定义。如果基于某种CNS的数据结构中并没有使用那么长的数据,则没有使用的部分要被置0.如果Controller接收到了一个不支持的CNS值,则应该返回Invalid Field in Command的状态。
注意:在1.0版本中,CNS字段使用1个Bit,1.1版本使用2个Bit。Host直应向1.0版本中发送1.0版本支持的CNS,向1.1版本中发送1.1版本支持的CNS。相互交叉使用会产生未定义的结果。
Identify Controller数据结构和Identify Namespace数据结构中包含了几种标识码。这些标识码的格式和设计在第7.10节中被定义。
图108:Identify-CNS Values
CNS Value | O/M 1 | Definition | NSID2 | CNTID3 | Reference Section | |
Active Namespace Management | ||||||
00h | M | Identify Namespace data structure for the specified NSID or the common namespace capabilities. | Y | N | 5.15.2 | |
01h | M | Identify Controller data structure for the controller processing the command. | N | N | 5.15.3 | |
02h | M | Active Namespace ID list. | Y | N | 5.15.4 | |
03h | M | Namespace Identification Descriptor list for the specified NSID. | Y | N | 5.15.5 | |
04h to 0Fh | Reserved | |||||
Controller and Namespace Management | ||||||
10h | O 4 | Allocated Namespace ID list. | Y | N | 5.15.6 | |
11h | O 4 | Identify Namespace data structure for the specified allocated NSID. | Y | N | 5.15.7 | |
12h | O 4 | Controller identifier list of controllers attached to the spcified NSID. | Y | Y | 5.15.8 | |
13h | O 4 | Controller identifier list of controllers that exist in the NVM subsystem. | N | Y | 5.15.9 | |
14h | O 5 | Primary Controller Capabilities data structure for the specified primary controller. | N | Y | 5.15.10 | |
15h | O 5 | Secondary Controller list of controllers associated with the primary controller processing the command. | N | Y | 5.15.11 | |
16h to 1Fh | Reserved | |||||
Future Definition | ||||||
20h to FFh | Reserved | |||||
NOTES: 1. O/M definition: O = Optional, M = Mandatory. 2. The CDW1.NSID field is used: Y = Yes, N = No. 3. The CDW10.CNTID field is used: Y = Yes, N = No. 4. Mandatory for controllers that support the Namespace Management capability (refer to section 8.12). 5. Mandatory for controllers that support Virtualization Enhancements (refer to section 8.5).
| ||||||
5.15.2 Identify Namespace data structure(CNS 00h)
如果命令中的NSID字段是一个Active NSID的话,则回返回Identify Namespace数据结构(参见图109)。如果NSID字段不是一个Active NSID,则返回全0的数据结构。
如果Controller支持Namespace Management功能(参见8.12节)而且CDW1.NSID被设置为FFFFFFFFh,那么Controller返回一个包含公共的Namespace属性的Identify Namespace数据结构。如果Controller不支持Namespace Management 功能而且CDW1.NSID被设置为了FFFFFFFFh,那么Controller应当返回一个Invaid Namespace or Format的失败码。
图109:Identify-Identify Namespace Data Structure,NVM Command Set Specific
Bytes | O/M 1 | Description |
7:0 | M | Namespace Size (NSZE): 这一字段代表了Namespace中的Logical Block数量。Namespace的范围为0个LBA到n-1个LBA。Logical Block的数量基于格式化的LBA大小。在Namespace有一种LBA格式之前这一字段是未被定义的。 |
15:8 | M | Namespace Capacity (NCAP):在任意时刻可以再Namespace中被Allocated的Logical Block的最大数量。Logical Block的数量基于格式化的LBA大小。在Namespace有一种LBA格式之前这一字段是未被定义的。 在资源随需分配的情况下,这一字段被报告的值小于等于Namespace Size。多余的LBA不会在此字段中被报告。 使用Write或者Write Uncorrectable命令对一个Logical Block进行写操作时,这个Logical Block就会被Allocated。当使用Dataset Management,Sanitize,或者Write Zeroes命令时,Logical Block可以被Unallocated。 |
23:16 | M | Namespace Utilization (NUSE): 这一字段代表了当前在此Namespace中Allocated Logical Block的数量。这一字段小于等于Namespace Capacity。Logical Block的数量基于格式化的LBA大小。 当使用NVM Command Set时。使用Write或者Write Uncorrectable命令对一个Logical Block进行写操作时,这个Logical Block就会被Allocated。当使用Dataset Management,Sanitize,或者Write Zeroes命令时,Logical Block可以被Unallocated。 如果设备不是针对于资源随需分配的情况,在所有时刻Controller都会NUSE等于NCAP。 |
24 | M | Namespace Features (NSFEAT): 这一字段定义了Namespace的特性。 Bits 7:4 are reserved. Bit 3 如果设置为1则表示对于这个Namespace上的一个非零的NGUID和非零的EUI64字段不会被此Controller再重复使用。如果清0则这个NGUID和EUI64的值在此Namespace删除后,一个新的Namespace被创建时可能会被此Controller重复使用。当NGUID和EUI64都为0时,这一字段应当被清0。参见7.11节。 Bit 2 if set to ‘1’ indicates that the controller supports the Deallocated or Unwritten Logical Block error for this namespace. If cleared to ‘0’, then the controller does not support the Deallocated or Unwritten Logical Block error for this namespace. Refer to section 6.7.1.1. Bit 1 if set to ‘1’ indicates that the fields NAWUN, NAWUPF, and NACWU are defined for this namespace and should be used by the host for this namespace instead of the AWUN, AWUPF, and ACWU fields in the Identify Controller data structure. If cleared to ‘0’, then the controller does not support the fields NAWUN, NAWUPF, and NACWU for this namespace. In this case, the host should use the AWUN, AWUPF, and ACWU fields defined in the Identify Controller data structure in Figure 111. Refer to section 6.4. Bit 0 if set to ‘1’ indicates that the namespace supports thin provisioning. Specifically, the Namespace Capacity reported may be less than the Namespace Size. When this feature is supported and the Dataset Management command is supported, then deallocating LBAs shall be reflected in the Namespace Utilization field. Bit 0 if cleared to ‘0’ indicates that thin provisioning is not supported and the Namespace Size and Namespace Capacity fields report the same value. |
25 | M | Number of LBA Formats (NLBAF): This field defines the number of supported LBA data size and metadata size combinations supported by the namespace. LBA formats shall be allocated in order (starting with 0) and packed sequentially. This is a 0’s based value. The maximum number of LBA formats that may be indicated as supported is 16. The supported LBA formats are indicated in bytes 128 to 191 in this data structure. The LBA Format fields with an index beyond the value set in this field are invalid and not supported. LBA Formats that are valid, but not currently available may be indicated by setting the LBA Data Size for that LBA Format to 0h. The metadata may be either transferred as part of the LBA (creating an extended LBA which is a larger LBA size that is exposed to the application) or it may be transferred as a separate contiguous buffer of data. The metadata shall not be split between the LBA and a separate metadata buffer. It is recommended that software and controllers transition to an LBA size that is 4KB or larger for ECC efficiency at the controller. If providing metadata, it is recommended that at least 8 bytes are provided per logical block to enable use with end-to-end data protection, refer to section 8.2. |
26 | M | Formatted LBA Size (FLBAS): This field indicates the LBA data size & metadata size combination that the namespace has been formatted with (refer to section 5.23). Bits 7:5 are reserved. Bit 4 if set to ‘1’ indicates that the metadata is transferred at the end of the data LBA, creating an extended data LBA. Bit 4 if cleared to ‘0’ indicates that all of the metadata for a command is transferred as a separate contiguous buffer of data. Bit 4 is not applicable when there is no metadata. Bits 3:0 indicates one of the 16 supported LBA Formats indicated in this data structure. |
27 | M | Metadata Capabilities (MC): This field indicates the capabilities for metadata. Bits 7:2 are reserved. Bit 1 if set to ‘1’ indicates the namespace supports the metadata being transferred as part of a separate buffer that is specified in the Metadata Pointer. Bit 1 if cleared to ‘0’ indicates that the namespace does not support the metadata being transferred as part of a separate buffer. Bit 0 if set to ‘1’ indicates that the namespace supports the metadata being transferred as part of an extended data LBA. Bit 0 if cleared to ‘0’ indicates that the namespace does not support the metadata being transferred as part of an extended data LBA. |
28 | M | End-to-end Data Protection Capabilities (DPC): This field indicates the capabilities for the end-to-end data protection feature. Multiple bits may be set in this field. Refer to section 8.3. Bits 7:5 are reserved. Bit 4 if set to ‘1’ indicates that the namespace supports protection information transferred as the last eight bytes of metadata. Bit 4 if cleared to ‘0’ indicates that the namespace does not support protection information transferred as the last eight bytes of metadata. Bit 3 if set to ‘1’ indicates that the namespace supports protection information transferred as the first eight bytes of metadata. Bit 3 if cleared to ‘0’ indicates that the namespace does not support protection information transferred as the first eight bytes of metadata. Bit 2 if set to ‘1’ indicates that the namespace supports Protection Information Type 3. Bit 2 if cleared to ‘0’ indicates that the namespace does not support Protection Information Type 3. Bit 1 if set to ‘1’ indicates that the namespace supports Protection Information Type 2. Bit 1 if cleared to ‘0’ indicates that the namespace does not support Protection Information Type 2. Bit 0 if set to ‘1’ indicates that the namespace supports Protection Information Type 1. Bit 0 if cleared to ‘0’ indicates that the namespace does not support Protection Information Type 1. |
29 | M | End-to-end Data Protection Type Settings (DPS): This field indicates the Type settings for the end-to-end data protection feature. Refer to section 8.3. Bits 7:4 are reserved. Bit 3 if set to ‘1’ indicates that the protection information, if enabled, is transferred as the first eight bytes of metadata. Bit 3 if cleared to ‘0’ indicates that the protection information, if enabled, is transferred as the last eight bytes of metadata. Bits 2:0 indicate whether Protection Information is enabled and the type of Protection Information enabled. The values for this field have the following meanings:
|
30 | O | Namespace Multi-path I/O and Namespace Sharing Capabilities (NMIC): This field specifies multi-path I/O and namespace sharing capabilities of the namespace. Bits 7:1 are reserved. Bit 0: If set to ‘1’, then the namespace may be attached to two or more controllers in the NVM subsystem concurrently (i.e., may be a shared namespace). If cleared to ‘0’, then the namespace is a private namespace and may only be attached to one controller at a time. |
31 | O | Reservation Capabilities (RESCAP): This field indicates the reservation capabilities of the namespace. A value of 00h in this field indicates that reservations are not supported by this namespace. Refer to section 8.8 for more details. Bit 7 if set to ‘1’ indicates that Ignore Existing Key is used as defined in revision 1.3 or later of this specification. Bit 7 if cleared to ‘0’ indicates that Ignore Existing Key is used as defined in revision 1.2.1 or earlier of this specification. This bit shall be set to ‘1’ if the controller supports revision 1.3 or later as indicated in the Version register. Bit 6 if set to ‘1’ indicates that the namespace supports the Exclusive Access – All Registrants reservation type. If this bit is cleared to ‘0’, then the namespace does not support the Exclusive Access – All Registrants reservation type. Bit 5 if set to ‘1’ indicates that the namespace supports the Write Exclusive – All Registrants reservation type. If this bit is cleared to ‘0’, then the namespace does not support the Write Exclusive – All Registrants reservation type. Bit 4 if set to ‘1’ indicates that the namespace supports the Exclusive Access – Registrants Only reservation type. If this bit is cleared to ‘0’, then the namespace does not support the Exclusive Access – Registrants Only reservation type. Bit 3 if set to ‘1’ indicates that the namespace supports the Write Exclusive – Registrants Only reservation type. If this bit is cleared to ‘0’, then the namespace does not support the Write Exclusive – Registrants Only reservation type. Bit 2 if set to ‘1’ indicates that the namespace supports the Exclusive Access reservation type. If this bit is cleared to ‘0’, then the namespace does not support the Exclusive Access reservation type. Bit 1 if set to ‘1’ indicates that the namespace supports the Write Exclusive reservation type. If this bit is cleared to ‘0’, then the namespace does not support the Write Exclusive reservation type. Bit 0 if set to ‘1’ indicates that the namespace supports the Persist Through Power Loss capability. If this bit is cleared to ‘0’, then the namespace does not support the Persist Through Power Loss Capability. |
32 | O | Format Progress Indicator (FPI): If a format operation is in progress, this field indicates the percentage of the namespace that remains to be formatted. Bit 7 if set to ‘1’ indicates that the namespace supports the Format Progress Indicator defined by bits 6:0 in this field. If this bit is cleared to ‘0’, then the namespace does not support the Format Progress Indicator and bits 6:0 in this field shall be cleared to 0h. Bits 6:0 indicate the percentage of the Format NVM command that remains to be completed (e.g., a value of 25 indicates that 75% of the Format NVM command has been completed and 25% remains to be completed). If bit 7 is set to ‘1’, then a value of 0 indicates that the namespace is formatted with the format specified by the FLBAS and DPS fields in this data structure and there is no Format NVM command in progress. |
33 | O | Deallocate Logical Block Features (DLFEAT): This field indicates information about features that affect deallocating logical blocks for this namespace. Bits 7:5 are reserved. Bit 4 if set to ‘1’ indicates that the Guard field for deallocated logical blocks that contain protection information is set to the CRC for the value read from the deallocated logical block and its metadata (excluding protection information). If cleared to ‘0’ indicates that the Guard field for the deallocated logical blocks that contain protection information is set to FFFFh. Bit 3 if set to ‘1’ indicates that the controller supports the Deallocate bit in the Write Zeroes command for this namespace. If cleared to ‘0’ indicates that the controller does not support the Deallocate bit in the Write Zeroes command for this namespace. This bit shall be set to the same value for all namespaces in the NVM subsystem. Bits 2:0 indicate the values read from a deallocated logical block and its metadata (excluding protection information). The values for this field have the following meanings: |
35:34 | O | Namespace Atomic Write Unit Normal (NAWUN): This field indicates the namespace specific size of the write operation guaranteed to be written atomically to the NVM during normal operation. A value of 0h indicates that the size for this namespace is the same size as that reported in the AWUN field of the Identify Controller data structure. All other values specify a size in terms of logical blocks using the same encoding as the AWUN field. Refer to section 6.4. |
37:36 | O | Namespace Atomic Write Unit Power Fail (NAWUPF): This field indicates the namespace specific size of the write operation guaranteed to be written atomically to the NVM during a power fail or error condition. A value of 0h indicates that the size for this namespace is the same size as that reported in the AWUPF field of the Identify Controller data structure. All other values specify a size in terms of logical blocks using the same encoding as the AWUPF field. Refer to section 6.4. |
39:38 | O | Namespace Atomic Compare & Write Unit (NACWU): This field indicates the namespace specific size of the write operation guaranteed to be written atomically to the NVM for a Compare and Write fused command. A value of 0h indicates that the size for this namespace is the same size as that reported in the ACWU field of the Identify Controller data structure. All other values specify a size in terms of logical blocks using the same encoding as the ACWU field. Refer to section 6.4. |
41:40 | O | Namespace Atomic Boundary Size Normal (NABSN): This field indicates the atomic boundary size for this namespace for the NAWUN value. This field is specified in logical blocks. Writes to this namespace that cross atomic boundaries are not guaranteed to be atomic to the NVM with respect to other read or write commands. A value of 0h indicates that there are no atomic boundaries for normal write operations. All other values specify a size in terms of logical blocks using the same encoding as the AWUN field. Refer to section 6.4. |