UNH-IOL Reservation 一致性测试用例【7】- 清除Reservation

12 篇文章 0 订阅

Reservation 系列导航

UNH-IOL Reservation 一致性测试用例【1】- Reservation Report 命令验证
UNH-IOL Reservation 一致性测试用例【2】- Reservation注册
UNH-IOL Reservation 一致性测试用例【3】- 取消注册
UNH-IOL Reservation 一致性测试用例【4】- Reservation Acquire 验证
UNH-IOL Reservation 一致性测试用例【5】- Reservation Release
UNH-IOL Reservation 一致性测试用例【6】- 抢占 Reservation
UNH-IOL Reservation 一致性测试用例【7】- 清除Reservation
UNH-IOL Reservation 一致性测试用例【8】- 在不同 Reservation Types 下的命令行为
UNH-IOL Reservation 一致性测试用例【9】- Reservation Notification Log Page(LID 0x80)

Test 7.7 – Clearing a Reservation (M, OF-FYI)

作为 Registrant 的 Host 可以通过执行一个 Reservation Release 命令来清除 reservation(强制解除对 namespace 的 reservation,并取消对所有 Registrants 的注册),其中 Reservation Release Action (RRELA) 字段设为 001b (Clear),Current Reservation Key (CRKEY) 字段设为 host 当前的 reservation key

清除 reservation 时,会发生以下原子操作:

  1. 释放 namespace 上的保留
  2. 所有 registrants 都从 namespace 中注销

Case 1: Basic Operation with Reservation Release Command (M, OF-FYI)

测试步骤
  1. 检查 Identify controller data structure(CNS 01) ONCS 字段确定 controller 是否支持 reservation
  2. 针对 NVMe Subsystem 里的每个 NVMe Controller:
    1. NVMe Host 向 Controller 发出 Set Features Host Identifier, 以便为该 Controller 注册一个 Host Identifier
    2. 对于 atttach 到该 Controller 的每个 active namespace:
      1. Host 发 Reservation Register 命令,Register Action (RREGA) 字段设为 000b (即. Register Reservation Key),在 New Reservation Key (NRKEY) 字段中向 namesapce 的 NVMe Controller 提供 reservation key,以使 host 成为该 namespace 的 registrant。
      2. Host 发出 Reservation Acquire 命令,将 Reservation Acquire Action (RACQA) 字段设为 000b (Acquire),向 Current Reservation Key (CRKEY) 字段提供当前的 reservation key,并将 Reservation Type (RTYPE) 字段设为支持的 reservation type,以便 host 在 namespace 获取该 reservation 类型的 reservation
      3. Host 发送 Reservation Release 命令来清除 reservation,其中 Reservation Release Action (RRELA) 字段设为 001b (Clear),Current Reservation Key (CRKEY) 字段设为 host 当前的 reservation key
      4. Host 向 Controller 发送 Reservation Report 命令。
        对所有 Reservation Controllers 执行 Reservation Release 命令,将 RRELA 字段设为 1(Clear)
预期结果

在 Reservation Report 完成后,检查 Reservation Status data structure, host 成功从该 namespace 取消注册,并不再持有 reservation

注意事项

在支持NVMe 2.0 或以上的版本的 driver 中,当要设置 Host Identifier 时,如果它在测试开始时是非零值,set feature 将被 abort,Status Code 为 Command Sequence Error


Case 2: Error Conditions (M, OF-FYI)

如果 CRKEY 值与 Host 向 namespace 注册时使用的 CRKEY 值不匹配,则应终止命令,状态为 Reservation Conflict。 Host 可通过将命令中的 Ignore Existing Key(IEKEY) 位置为 "1",在不考虑当前 reservation key 值的情况下清除 reservation。

果 Host 不是 Registrant,则应终止该命令,并显示 Reservation Conflict 状态。

测试步骤
  1. 检查 Identify controller data structure(CNS 01) ONCS 字段确定 controller 是否支持 reservation
  2. 针对 NVMe Subsystem 里的每个 NVMe Controller:
    1. NVMe Host 向 Controller 发出 Set Features Host Identifier, 以便为该 Controller 注册一个 Host Identifier
    2. 对于 atttach 到该 Controller 的每个 active namespace:
      1. Host 发送一个 Reservation Release 命令,Reservation Release Action (RRELA) 字段设为 001b (Clear),并提供一个随机的 reservation key 给 Current Reservation Key (CRKEY)。
      2. Host 发 Reservation Register 命令,Register Action (RREGA) 字段设为 000b (即. Register Reservation Key),在 New Reservation Key (NRKEY) 字段中向 namesapce 的 NVMe Controller 提供 reservation key,以使 host 成为该 namespace 的 registrant。
      3. Host 发送一个 Reservation Release 命令,Reservation Release Action (RRELA) 字段设为 001b (Clear),并提供一个不是 Host 当前的 reservation key 给 Current Reservation Key (CRKEY)。
      4. Host 向 Controller 发送 Reservation Report 命令。
      5. Host 发送一个 Reservation Release 命令,Reservation Release Action (RRELA) 字段设为 001b (Clear),提供一个不是 Host 当前的 reservation key 给 Current Reservation Key (CRKEY),将 IEKEY 置为 1。
      6. Host 向 Controller 发送 Reservation Report 命令。
预期结果
  1. 2.2.1 的 Reservation Release 命令失败,返回状态 Reservation Conflict
  2. 2.2.3 的 Reservation Release 命令失败,返回状态 Reservation Conflict
  3. 2.2.4 Reservation Report 返回的 Reservation Status data structure 表明:Host 依然是该 namespace 的 registrant
  4. 2.2.6 Reservation Report 返回的 Reservation Status data structure 表明:Host 不再是该 namespace 的 registrant,已成功取消注册
注意事项
  1. 在支持NVMe 2.0 或以上的版本的 driver 中,当要设置 Host Identifier 时,如果它在测试开始时是非零值,set feature 将被 abort,Status Code 为 Command Sequence Error
  2. 目前尚未确定进行此项检测的可靠方法。因此,这项测试不应纳入任何行业批准的一致性认定中。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值