NVMe End-to-End Protection Information

15 篇文章 2 订阅

NVMe协议里定义SSD控制器可以支持给每个逻辑块(也就是用户数据)增加额外的元数据,主机如何使用元数据区域自定义(如分布式文件系统的元数据),元数据最常见的用途之一是传递PI端到端保护信息(end-to-end protection information)

NVMe 1.4 定义的 End-to-End Protection Information 长度为 8 字节,包含3个 Tag 区域:

  • 16bit Guard Tag(用户数据的 CRC 校验信息)
  • 16bit Application Tag(应用指定 tag)
  • 32bit Reference Tag 组成(Reference Tag 把逻辑块数据与一个地址关联起来,防止被误用或者乱序逻辑块传输,用来检测数据是否写入错误的 LBA 地址)。

  1. PI信息即可以由主机端添加,也可以由SSD控制器添加。
  2. 根据对SSD命名空间的格式化(512B or 4KB sector),PI可以放置在元数据的前8或后8字节。如果Metadata元数据超过8字节(如支持64B元数据):
    1. PI在Metadata前8字节,PI中CRC tag的生成不包括metadata字节。
    2. PI在Metadata后8字节,PI中CRC tag的生成包含metadata字节,但不包括后8字节PI。
  3. PI 的具体实现,有 DIF 和 DIX 两种方式。DIF 和 DIX 两种数据保护机制的主要区别是 PI 信息的位置不同。具体选择哪种格式,要根据应用场景的需求。
    1. DIF 即元数据与用户数据(LBA Data)连续存放
    2. DIX 格式则是元数据与用户数据单独存放;

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)

  • End-to-end Guard Check Error,
  • End-to-end Application Tag Check
  • Error, End-to-end Storage Tag Check Error, or
  • End-to-end Reference Tag Check Error

PI + PRACT = 1  MD (Metadata)  Size  = PI Size (namespace format)

  • The logical block data from host buffer is transferred to the controller.(The metadata is not resident within host buffer)
  • Controller generates and appends PI to the end of the logical block data ==> written to NVM

PI + PRACT = 1  MD (Metadata)  Size > PI Size (namespace format)

  • The logical block data and the metadata from host buffer is transferred to the controller.
  • The controller overwrites the PI portion of the metadata without checking PI portion regardless of PRCHK settings.
  • The logical block data and metadata are written to the NVM.

PRACT

  1. =1时,
    1. MD < 8B, SSD controller生成新的PI替代host传入的PI,并将其写入NAND
    2. MD > 8B,host生成的PI直接传入SSD,替换MD的前8或者后8字节(这里还需要注意kernel是否支持)
  2. =0时, controller获取上层应用下发的PI信息,将检查PI信息并写入NAND

协议定义了metadata/PI是8byte和大于8byte(16Byte)时的不同处理方式,增加额外保护信息,相当于增加了额外数据写入量,不同SSD厂商因为采用的算法不同,NAND寿命不同,metadata最大支持的大小也有差异,比较主流的市场需求是medata支持64byte(4096+64B)。

PRCHK

  • Bit2=1,SSD在收到packet时,检查CRC
  • Bit1=1,SSD在收到packet时,检查App Tag
  • Bit0=1,SSD在收到packet时,检查Reference Tag

 

Protection Information Action (PRACT)  and Read Commands

PRACT

  • =1时,
    • MD<8B,SSD controller不向host返回PI信息,只返回data block
    • MD>8B,SSD controller向host返回PI信息 (这里同样需要注意kernal是否支持)
  • =0时, SSD controller检查PI信息, 向host返回PI信息以及data block

PRCHK

  • Bit2=1,SSD在收到packet时,检查CRC
  • Bit1=1,SSD在收到packet时,检查App Tag
  • Bit0=1,SSD在收到packet时,检查Reference Tag

企业级SSD的端到端数据保护技术 - 知乎 (zhihu.com)

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)

PBlaze5 920 系列 NVMe SSD——可变 Sector Size 管理 (memblaze.com)

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值