UNH-IOL Reservation 一致性测试用例【8】- 在不同 Reservation Types 下的命令行为

文章详细描述了针对NVMe设备Reservation功能的一系列测试用例,包括Registration、Acquire、Release等操作,涉及不同类型的Reservation,如WriteExclusive和ExclusiveAccess。测试主要关注在多端口设备上不同主机的行为,尤其是命令的允许与冲突情况。
摘要由CSDN通过智能技术生成

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.8 – Command Behavior with Different Reservation Types (M, OF-FYI)

NVMe 支持 6 种 Reservations:

  • Write Exclusive
  • Exclusive Access
  • Write Exclusive - Registrants Only
  • Exclusive Access - Registrants Only
  • Write Exclusive - All Registrants
  • Exclusive Access - All Registrants

这些 reservation 类型之间的区别在于:被排除的访问类型(即 writes 或 all accesses)、registrants 是否具有与 reservation holder 相同的访问权限,以及 registrants 是否也被视为 reservation holder。

就保留类型而言,以下命令被视为 NVM Read Command Group:
  • Read
  • Compare
  • Security Receive

以下命令被视为 NVM Write Command Group:

  • Write
  • Write Uncorrectable
  • Dataset Management
  • Flush
  • Format NVM
  • Namespace Attachment
  • Namespace Management
  • Security Send

Case 1: Write Exclusive (M, OF-FYI) Dual Port Devices Only

Write Exclusive reservation 禁止 registration holder 以外的任何 host 从 NVM Write Command Group 中发出命令。任何 Host 仍可执行 NVM Read Command Group 的任何命令。

该测试要求 NVM Subsystem 中至少有两个具有 shared namespace 的控制器。

测试步骤
  1. 检查 Identify controller data structure(CNS 01) ONCS 字段确定 controller 是否支持 reservation;检查DUT当前是否为多个ports
  2. NVMe Host 1 向 Controller 1 发出 Set Features Host Identifier, 以便为该 Controller 注册一个 Host Identifier
  3. NVMe Host 2 向 Controller 2 发出 Set Features Host Identifier, 为该 Controller 注册一个不同于 Host 1 的 Host Identifier
  4. Host 1 发 Reservation Register 命令,Register Action (RREGA) 字段设为 000b (即. Register Reservation Key),在 New Reservation Key (NRKEY) 字段中向 namesapce 的 NVMe Controller 1 提供 reservation key,以使 host 成为该 shared namespace 的 registrant。
  5. Host 1 发出 Reservation Acquire 命令,将 Reservation Acquire Action (RACQA) 字段设为 000b (Acquire),向 Current Reservation Key (CRKEY) 字段提供当前 Host 1 的 reservation key,并将 Reservation Type (RTYPE) 字段设为 Write Exclusive,以便 host 1 在 namespace 获取该 reservation 类型的 reservation
  6. 所有 Host 向 controller 发送上述 NVM Read Command Group 中的每条命令
  7. 所有 Host 向 controller 发送上述 NVM Write Command Group 中的每条命令
  8. Host 2 发 Reservation Register 命令,Register Action (RREGA) 字段设为 000b (即. Register Reservation Key),在 New Reservation Key (NRKEY) 字段中向 namesapce 的 NVMe Controller 2 提供 reservation key,以使 host 成为该 shared namespace 的 registrant
  9. Host 2 向各自的 controller 发送上述 NVM Read Command Group 中的每条命令
  10. Host 2 向各自的 controller 发送上述 NVM Write Command Group 中的每条命令
  11. 对所有 Reservation Controllers 执行 Reservation Release 命令,将 RRELA 字段设为 1(Clear)
预期结果
  1. 在每个命令完成后,控制器向相关的 Completion Queue 发布一个 completion queue entry,表明该命令的状态
  2. Host 1 在步骤 6,7 的命令成功
  3. Host 2 在步骤 6,9 的命令成功,步骤 7,10 的命令失败,返回状态 Reservation Conflict

Case 2: Exclusive Access (M, OF-FYI) Dual Port Devices Only

Exclusive Access reservation 禁止 registration holder 以外的任何 host 从 NVM Write Command Group 或 NVM Read Command Group 中发出命令。

该测试要求 NVM Subsystem 中至少有两个具有 shared namespace 的控制器。

#### 测试步骤 1. 检查 Identify controller data structure(CNS 01) ONCS 字段确定 controller 是否支持 reservation;检查DUT当前是否为多个ports 2. NVMe Host 1 向 Controller 1 发出 Set Features Host Identifier, 以便为该 Controller 注册一个 Host Identifier 3. NVMe Host 2 向 Controller 2 发出 Set Features Host Identifier, 为该 Controller 注册一个不同于 Host 1 的 Host Identifier 4. Host 1 发 Reservation Register 命令,Register Action (RREGA) 字段设为 000b (即. Register Reservation Key),在 New Reservation Key (NRKEY) 字段中向 namesapce 的 NVMe Controller 1 提供 reservation key,以使 host 成为该 shared namespace 的 registrant。 5. Host 1 发出 Reservation Acquire 命令,将 Reservation Acquire Action (RACQA) 字段设为 000b (Acquire),向 Current Reservation Key (CRKEY) 字段提供当前 Host 1 的 reservation key,并将 Reservation Type (RTYPE) 字段设为 Exclusive Access,以便 host 1 在 namespace 获取该 reservation 类型的 reservation 6. 所有 Host 向 controller 发送上述 NVM Read Command Group 中的每条命令 7. 所有 Host 向 controller 发送上述 NVM Write Command Group 中的每条命令 8. Host 2 发 Reservation Register 命令,Register Action (RREGA) 字段设为 000b (即. Register Reservation Key),在 New Reservation Key (NRKEY) 字段中向 namesapce 的 NVMe Controller 2 提供 reservation key,以使 host 成为该 shared namespace 的 registrant 9. Host 2 向各自的 controller 发送上述 NVM Read Command Group 中的每条命令 10. Host 2 向各自的 controller 发送上述 NVM Write Command Group 中的每条命令 11. 对所有 Reservation Controllers 执行 Reservation Release 命令,将 RRELA 字段设为 1(Clear) #### 预期结果 1. 在每个命令完成后,控制器向相关的 Completion Queue 发布一个 completion queue entry,表明该命令的状态 2. Host 1 在步骤 6,7 的命令成功 3. Host 2 在步骤6,7, 9,10 的命令失败,返回状态 Reservation Conflict

Case 3: Write Exclusive - Registrants Only or Write Exclusive - All Registrants (M, OF-FYI) Dual Port Devices Only

Write Exclusive - Registrants Only 或 Write Exclusive - All Registrants reservation 不允许 namespace 的任何非注册者发 NVM Write Command Group 中的命令。所有 Host 仍可发 NVM Read Command Group 种的命令,namespace 的 registrants 仍可发 NVM Write Command Group 中的命令。

Write Exclusive - Registrants Only 和Write Exclusive - All Registrants reservation 类型的区别在于,Write Exclusive - All Registrants 类型的所有 registrants 也被视为 reservation holders。

该测试要求 NVM Subsystem 中至少有两个具有 shared namespace 的控制器。

测试步骤
  1. 检查 Identify controller data structure(CNS 01) ONCS 字段确定 controller 是否支持 reservation;检查DUT当前是否为多个ports
  2. NVMe Host 1 向 Controller 1 发出 Set Features Host Identifier, 以便为该 Controller 注册一个 Host Identifier
  3. NVMe Host 2 向 Controller 2 发出 Set Features Host Identifier, 为该 Controller 注册一个不同于 Host 1 的 Host Identifier
  4. Host 1 发 Reservation Register 命令,Register Action (RREGA) 字段设为 000b (即. Register Reservation Key),在 New Reservation Key (NRKEY) 字段中向 namesapce 的 NVMe Controller 1 提供 reservation key,以使 host 成为该 shared namespace 的 registrant。
  5. Host 1 发出 Reservation Acquire 命令,将 Reservation Acquire Action (RACQA) 字段设为 000b (Acquire),向 Current Reservation Key (CRKEY) 字段提供当前 Host 1 的 reservation key,并将 Reservation Type (RTYPE) 字段设为 Write Exclusive - Registrants Only 或 Write Exclusive - All Registrants,以便 host 1 在 namespace 获取该 reservation 类型的 reservation
  6. 所有 Host 向 controller 发送上述 NVM Read Command Group 中的每条命令
  7. 所有 Host 向 controller 发送上述 NVM Write Command Group 中的每条命令
  8. Host 2 发 Reservation Register 命令,Register Action (RREGA) 字段设为 000b (即. Register Reservation Key),在 New Reservation Key (NRKEY) 字段中向 namesapce 的 NVMe Controller 2 提供 reservation key,以使 host 成为该 shared namespace 的 registrant
  9. Host 2 向各自的 controller 发送上述 NVM Read Command Group 中的每条命令
  10. Host 2 向各自的 controller 发送上述 NVM Write Command Group 中的每条命令
  11. 对所有 Reservation Controllers 执行 Reservation Release 命令,将 RRELA 字段设为 1(Clear)
预期结果
  1. 在每个命令完成后,控制器向相关的 Completion Queue 发布一个 completion queue entry,表明该命令的状态
  2. Host 1 在步骤 6,7 的命令成功
  3. Host 2 在步骤 6 的命令成功,步骤 7 的命令失败,返回状态 Reservation Conflict
  4. Host 2 在步骤 9,10 的命令成功

Case 4: Exclusive Access - Registrants Only or Exclusive Access - All Registrants (M, OF-FYI) Dual Port Devices Only

Exclusive Access - Registrants Only 或 Exclusive Access - All Registrants reservation 不允许 namespace 的任何非注册者发 NVM Write Command Group 或 NVM Read Command Group 中的命令。Registrants 仍可发 NVM Read Command Group 和 NVM Write Command Group 中的命令。

Exclusive Access - Registrants Only 和 Exclusive Access - All Registrants reservation 类型的区别在于,Write Exclusive - All Registrants 类型的所有 registrants 也被视为 reservation holders。

该测试要求 NVM Subsystem 中至少有两个具有 shared namespace 的控制器。

测试步骤
  1. 检查 Identify controller data structure(CNS 01) ONCS 字段确定 controller 是否支持 reservation;检查DUT当前是否为多个ports
  2. NVMe Host 1 向 Controller 1 发出 Set Features Host Identifier, 以便为该 Controller 注册一个 Host Identifier
  3. NVMe Host 2 向 Controller 2 发出 Set Features Host Identifier, 为该 Controller 注册一个不同于 Host 1 的 Host Identifier
  4. Host 1 发 Reservation Register 命令,Register Action (RREGA) 字段设为 000b (即. Register Reservation Key),在 New Reservation Key (NRKEY) 字段中向 namesapce 的 NVMe Controller 1 提供 reservation key,以使 host 成为该 shared namespace 的 registrant。
  5. Host 1 发出 Reservation Acquire 命令,将 Reservation Acquire Action (RACQA) 字段设为 000b (Acquire),向 Current Reservation Key (CRKEY) 字段提供当前 Host 1 的 reservation key,并将 Reservation Type (RTYPE) 字段设为 Exclusive Access - Registrants Only 或 Exclusive Access - All Registrants,以便 host 1 在 namespace 获取该 reservation 类型的 reservation
  6. 所有 Host 向 controller 发送上述 NVM Read Command Group 中的每条命令
  7. 所有 Host 向 controller 发送上述 NVM Write Command Group 中的每条命令
  8. Host 2 发 Reservation Register 命令,Register Action (RREGA) 字段设为 000b (即. Register Reservation Key),在 New Reservation Key (NRKEY) 字段中向 namesapce 的 NVMe Controller 2 提供 reservation key,以使 host 成为该 shared namespace 的 registrant
  9. Host 2 向各自的 controller 发送上述 NVM Read Command Group 中的每条命令
  10. Host 2 向各自的 controller 发送上述 NVM Write Command Group 中的每条命令
  11. 对所有 Reservation Controllers 执行 Reservation Release 命令,将 RRELA 字段设为 1(Clear)
预期结果
  1. 在每个命令完成后,控制器向相关的 Completion Queue 发布一个 completion queue entry,表明该命令的状态
  2. Host 1 在步骤 6,7 的命令成功
  3. Host 2 在步骤 6 ,7 的命令失败,返回状态 Reservation Conflict
  4. Host 2 在步骤 9,10 的命令成功
注意事项

目前尚未确定进行此项检测的可靠方法。因此,这项测试不应纳入任何行业批准的一致性认定中。


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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值