Dataset Management

3.2.3 Dataset Management command

The Dataset Management command is used by the host to indicate attributes for ranges of logical blocks. This includes attributes like frequency that data is read or written, access size, and other information that may be used to optimize performance and reliability. This command is advisory; a compliant controller may choose to take no action based on information provided.

主机使用“Dataset Management”命令指示逻辑块范围的属性。 属性包括读取或写入数据的频率,访问大小以及可用于优化性能和可靠性的其他信息。 此命令是建议性命令; 兼容的控制器可能会根据提供的信息选择不采取任何措施。

The command uses Command Dword 10, and Command Dword 11 fields. If the command uses PRPs for the data transfer, then the PRP Entry 1 and PRP Entry 2 fields are used. If the command uses SGLs for the data transfer, then the SGL Entry 1 field is used. All other command specific fields are reserved.

        该命令使用Command Dword 10,Command Dword 11字段,如果命令使用PRPs来传输数据,那么PRP Entry1PRP Entry2会被使用。如果命令用SGLs来传输数据,那么SGL Entry1字段会被使用。所有其他命令中所规定的字段做保留。

Figure 39: Dataset Management – Command Dword 10

Bits

描述

31:08

保留

07:00

Number of Ranges (NR):

指示命令中指定的16字节范围集的数量。 这是一个基于0的值。

Figure 40: Dataset Management – Command Dword 11

Bits

描述

31:03

保留

02

Attribute – Deallocate (AD):

如果设置为“ 1”,则NVM子系统可以释放所有提供的范围。即Trim, 在3.2.3.2.1节中指定了为释放范围返回的数据。

01

Attribute – Integral Dataset for Write (IDW):

如果设置为“ 1”,则应优化数据集以作为一个整体单位进行写访问。主机希望在作为写操作的整体单元所有范围上执行操作,这表示如果写入了数据集的一部分,则预期将要写入数据集中的所有范围。

00

Attribute – Integral Dataset for Read (IDR):

如果设置为“ 1”,则应优化数据集以进行读访问,并将其作为一个整体。 主机希望对作为读的整体单元所有范围执行操作,这表明如果读取了数据集的一部分,则预计将读取数据集中的所有范围。

If the Dataset Management command is supported, all combinations(组合) of attributes specified in Figure 40  may be set.

The data that the Dataset Management command provides is a list of ranges with context attributes. Each range consists of a starting LBA, a length of logical blocks that the range consists of and the context attributes to be applied to that range. The length in logical blocks field is a 1-based value. The definition of the Dataset Management command Range field is specified in Figure 41. The maximum case of 256 ranges is shown.

 

3.2.3.1 Dataset Management Processing Limits

Processing limits for Dataset Management commands are indicated by non-zero values in three fields in the Identify Controller data structure (refer to the Identify Controller data structure section in the NVMe Base Specification):

  a) A non-zero value in the Dataset Management Ranges Limit (DMRL) field indicates a processing limit on the number of ranges. If the controller reports a non-zero value in this field, then the controller does not process attributes and context attributes for any range whose range number (i.e., the number of the range as specified in the Range column of Figure 41) is greater than or equal to that non-zero value.

  DRML表示能处理的range数目,大于等于该值的range不会处理。

  b) A non-zero value in the Dataset Management Range Size Limit (DMRSL) field indicates a processing limit on the number of logical blocks in a single range. If the controller reports a non-zero value in this field, then the controller does not process attributes and context attributes for any logical block whose LBA offset from the starting LBA of the range (refer to Figure 41) that specifies the logical block is greater than or equal to that non-zero value.

  DMRSL表示在单个range中能处理的logic blocks的数量,大于等于该LBA offset的logic block不会处理。

  c) A non-zero value in the Dataset Management Size Limit (DMSL) field indicates a processing limit on the total number of logical blocks for the command. If the controller reports a non-zero value in this field, then the controller does not process attributes and context attributes for any logical block specified by any range for which the sum of:

    a. the number of logical blocks, specified by lower numbered ranges, if any, otherwise zero; and

    b. the LBA offset for that logical block from the starting LBA of that range, is greater than or equal to that non-zero value.

DMSL表示总共能处理的logic block数,controller 不会处理大于等于该值的logic block

  A logical block specified by a Dataset Management command satisfies all three of these processing limits if and only if each processing limit does not prevent controller processing of attributes and context attributes for that logical block. A logical block specified by a Dataset Management command does not satisfy a processing limit if that limit prevents controller processing of attributes and context attributes for that logical block.

  The controller shall set all three processing limit fields (i.e., the DMRL, DMRSL and DMSL fields) to non-zero values or shall clear all three processing limit fields to 0h. A controller is able to impose(强制,推行) a subset of the three processing limits by setting the field that reports each unused processing limit to the maximum possible value for that field (i.e., all bits set to ‘1’), with the exception that the resulting processing limit for the number of ranges is 255 of the 256 ranges supported by the Dataset Management command. Note that this exception is due to the DMRL field being 1-based in contrast to the 0’s-based Number of Ranges (NR) field in the Dataset Management command.

  DMRL,DMRSL,DMSL字段要么全零,要么全非零,会造成一个exception:只能处理Dataset Management命令256个ranges中的255个,这个异常是由于DMRL是基于1的,而NR字段是基于0的。

  If all three processing limit fields (i.e., the DMRL, DMRSL and DMSL fields) contain non-zero values, then the controller supports the Dataset Management command and:

  只要DMRL,DMRSL,DMSL都是非零值,那么controller就会支持dataset management命令,并且:

    a) Each processing limit field indicates a processing limit for controller processing of attributes and context attributes for logical blocks specified by the command;

   b) If bit 2 is set to ‘1’ in the Optional NVM Command Support (ONCS) field in the Identify Controller data structure, then for the logical blocks specified by the command:

    a. The controller should process attributes and context attributes for all logical blocks that satisfy all three processing limits; and

      controller 需要处理那些符合3个限制条件logic blocks.

     b. The controller should not process attributes and context attributes for any logical blocks that do not satisfy one or more of the three processing limits;

     controller 不用处理那些至少一个limit不符合的logic blocks.

  c) If bit 2 is cleared to ‘0’ in the ONCS field, then for the logical blocks specified by the command:

    a. If all logical blocks specified by the command satisfy all three processing limits, then the controller shall process attributes and context attributes for those logical blocks; and

当所有logic blocks都满足3个限制条件时,controller可以处理这些logic blocks

    b. If the command specifies any logical block that does not satisfy one or more of the three processing limits, then the controller shall abort the command with Command Size Limit Exceeded status.

命令中指定的logical block有block不符合至少一个limit时,整个command都会被abort 掉,Status 83h.

If all three processing limit fields (i.e., the DMRL, DMRSL and DMSL fields) are cleared to 0h then:

a) If bit 2 is set to ‘1’ in the ONCS field, then the controller supports the Dataset Management command and does not report any processing limits on the number of ranges, number of logical blocks in a single range or total number of logical blocks for the command; and

b) If bit 2 is cleared to ‘0’ in the ONCS field, then the controller does not support the Dataset Management command.

A controller may choose to take no action on any or all logical blocks for which attributes or context attributes are processed. If a Dataset Management command contains one or more ranges for which neither attributes nor context attributes are processed, then a controller may nonetheless check the fields that specify such ranges and abort the command if an error is detected (e.g., if the controller detects that such a range extends beyond the size of the namespace).

3.2.3.1.1 Dataset Management Processing Limits Example

For example, under the assumptions that the bit 2 in the ONCS field is set to ‘1’ and the DMRSL field is set to its maximum value, consider a Dataset Management command that specifies two ranges, with range 0 containing 1,024 logical blocks and range 1 containing 512 logical blocks:

a) if the DMRL field is set to 1 and the DMSL field is set to 1,048, then the controller is expected to process attributes and context attributes for the logical blocks specified by range 0, and the controller does not process either attributes or context attributes for the logical blocks contained in range 1; and

b) if the DMRL field is set to 2 and the DMSL field is set to 1,048, then the controller is expected to process attributes and context attributes for the logical blocks specified by range 0 and for the first 24 logical blocks of range 1, and the controller does not process either attributes or context attributes for the other logical blocks (i.e., 25 - 512) contained in range 1.

3.2.3.2 Context Attributes

The context attributes specified for each range provides information about how the range is intended to be used by host software. The use of this information is optional and the controller is not required to perform any specific action.

Note: The controller is required to maintain the integrity of data on the NVM media regardless of whether the attributes provided by host software are accurate.

无论主机软件提供的属性是否准确,都需要控制器来维护 NVM 介质上数据的完整性。

Figure 367:Dataset Management – Context Attributes

属性

Bits

描述

Command Access Size

31:24

预期在单个读取或写入命令中从该数据集中传输的逻辑块数。 值为0h表示未提供命令访问大小。

保留

23:11

保留

WP: Write Prepare

10

如果设置为“ 1”,则所提供的范围预计将不久会写入。

SW: Sequential Write Range

09

如果设置为“ 1”,则应优化数据集以进行顺序写访问。 主机希望将数据集上的操作作为单个对象进行写入。

SR: Sequential Read Range

08

如果设置为“ 1”,则应优化数据集以进行顺序读取访问。 主机希望将数据集上的操作作为单个对象进行读取。

保留

07:06

保留

AL:Access Latency

05:04

AF:Access Frequency

03:00

3.2.3.2.1 Deallocated or Unwritten Logical Blocks

A logical block that has never been written to, or which has been deallocated using the Dataset Management command, the Write Zeroes command or the Sanitize command is called a deallocated or unwritten logical block.

从来没有写入过或已使用Dataset Management命令、Write Zeroes 命令或 Sanitize 命令deallocatedlogical blocks称为deallocatedunwritten logical block

Using the Error Recovery feature (refer to section 4.1.3.2), host software may select the behavior of the controller when reading deallocated or unwritten blocks. The controller shall abort Copy, Read, Verify, or Compare commands that include deallocated or unwritten blocks with a status of Deallocated or Unwritten Logical Block if that error has been enabled using the DULBE bit in the Error Recovery feature. If the Deallocated or Unwritten Logical error is not enabled, the values read from a deallocated or unwritten block and its metadata (excluding protection information) shall be:

使用Error Recovery功能(请参阅第 4.1.3.2 节),主机软件可以在读取deallocatedunwritten的块时选择控制器的行为。 如果使用Error Recovery功能中的 DULBE 位启用了该错误,则控制器应中止含有deallocatedunwritten logical blocks Copy, Read, Verify, Compare命令,并返回状态Deallocated or Unwritten Logical Block 如果未启用deallocatedUnwritten Logical错误,则从deallocated或未写入的块及其元数据(不包括保护信息)读取的值应为:

• all bytes cleared to 0h if bits 2:0 in the DLFEAT field are set to 001b;

• all bytes set to FFh if bits 2:0 in the DLFEAT field are set to 010b; or

• either all bytes cleared to 0h or all bytes set to FFh if bits 2:0 in the DLFEAT field are set to 000b.

The value read from a deallocated logical block shall be deterministic(确定的); specifically, the value returned by subsequent(后续的) reads of that logical block shall be the same until a write operation occurs to that logical block. A deallocated or unwritten block is no longer deallocated or unwritten when the logical block is written. Read operations and Verify operations do not affect the deallocation status of a logical block.

The values read from a deallocated or unwritten logical block’s protection information field shall:

• have each byte in the Guard field value set to FFh or set to the CRC for the value read from the deallocated logical block and its metadata (excluding protection information) (e.g., cleared to 0h if the value read is all bytes cleared to 0h); and

• have each byte in the Application Tag field, Storage Tag field, if defined, and the Logical Block Reference Tag value set to FFh (indicating the protection information shall not be checked).

Using the Error Recovery feature (refer to section 4.1.3.3), host software may enable an error to be returned if a deallocated or unwritten logical block is read. If this error is supported for the namespace and enabled, then any User Data Read Access Command that includes a deallocated or unwritten logical block shall abort with the Deallocated or Unwritten Logical Block status code. Note: Legacy software may not handle an error for this case.

Note: The operation of the Deallocate function is similar to the ATA DATA SET MANAGEMENT with Trim feature described in ACS-4 and SCSI UNMAP command described in SBC-3.

从释放的或未写入的逻辑块的保护信息字段中读取的值应:

•将 Guard 字段值中的每个字节设置为 FFh 或设置为从deallocated的逻辑块及其元数据读取的值的 CRC(含保护信息)(即,如果读取的值的所有字节都清为0h,则将其清零); 

•将“Application Tag ”, “Storage Tag”(若有定义),“Reference Tag”字段值设置为FFh(指示不应检查保护信息)。

使用Error Recovery功能(请参阅第4.1.3.3节),如果读取了释放了的或未写入的逻辑块,则主机软件可以使返回一个错误。如果命名空间支持此错误并启用了该错误,包含已释放或未写入逻辑块的User Data Read Access Command将失败,并显示Deallocated or Unwritten Logical Block状态码。注意:在这种情况下,旧版软件可能无法处理错误。

注意:Deallocate功能的操作类似于ACS-4中描述的具有Trim功能的ATA DATA SET MANAGEMENT和SBC-3中描述的SCSI UNMAP命令。

3.2.3.3 Command Completion

When the command is completed, the controller shall post a completion queue entry to the associated I/O Completion Queue indicating the status for the command.

Dataset Management command specific status values are defined in Figure43.


 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.

 

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值