NVMe协议里定义SSD控制器可以支持给每个逻辑块(也就是用户数据)增加额外的元数据,主机如何使用元数据区域自定义(如分布式文件系统的元数据),元数据最常见的用途之一是传递PI端到端保护信息(end-to-end protection information)。
NVMe 1.4 定义的 End-to-End Protection Information 长度为 8 字节,包含3个 Tag 区域:
NVMe 2.0 (PI > 8B)
a) 16b Guard Protection Information;
b) 32b Guard Protection Information; and
c) 64b Guard Protection Information
Protection Information Field(PRINFO) 包括PRACT(Protection Information Action)和PRCHK(Protection Information Check) 字段。PRACT指明了PI信息生成的机制,PRCHK指明了controller收到包时检查的PI信息。PRACT 和PRCHK 由 nvmecli 的 prinfo 参数控制,通过nvme write和nvme read设置。
Protection Information Action (PRACT) and Write Commands
PI + PRACT = 0 (namespace format)
PI + PRACT = 1 MD (Metadata) Size = PI Size (namespace format)
PI + PRACT = 1 MD (Metadata) Size > PI Size (namespace format)
PRACT
协议定义了metadata/PI是8byte和大于8byte(16Byte)时的不同处理方式,增加额外保护信息,相当于增加了额外数据写入量,不同SSD厂商因为采用的算法不同,NAND寿命不同,metadata最大支持的大小也有差异,比较主流的市场需求是medata支持64byte(4096+64B)。
PRCHK
Protection Information Action (PRACT) and Read Commands
PRACT
PRCHK
PI Types
T10 defines four types of protection:
• Type 0: no protection. When a drive is formatted with Type 0 protection, it does not support any protection information.
• Type 1: SBC defines the Logical Block Reference Tag field and Logical Block Guard field but does not define the Logical Block Application Tag field.
• Type 2: SBC defines the Logical Block Guard field and the Logical Block Reference Tag field as well except for the first addressed LBA.
• Type 3: SBC defines the Logical Block Guard field, but does not define the contents of the Logical Application Tag field or the Logical Reference Tag field.
The PI related information is MC (Metadata Capabilities), DPC (End-to-end Data Protection Capabilities), DPS (End-to-end Data Protection Type Settings) and FLBAS (Formatted LBA Size).
PBlaze5 920系列特性——可变Sector Size管理(上) (taodudu.cc)
PBlaze5 920系列NVMe SSD——可变Sector Size管理(下) (baidu.com)