面壁UNH IOL NVMe一致性测试之21 – Reservations

原创内容,转载请注明:  [http://www.ssdfans.com]  谢谢!

Group 7 测试 Reservations

Test 7.1 – Reservation Report Command

Case 1: No Registrants

测试步骤

  1. 检查ONCS字段确定SSD是否支持reservation,如果不支持本测试无效;
  2. 针对NVMe Subsystem里的每个NVMe Controller
    1. Host发送Set Features command设置Host Identifier;
    2. 针对每个Active的Namespace
      1. Host发送Reservation Report command
      2. Host发送Get Features command – Reservation Persistence Feature, 获取相关信息;

期望结果

  1. SSD正常返回CQ;
  2. Reservation Status data structure的Reservation Type字段为0,说明该namespace上目前没有reservation;
  3. Reservation Status data structure的Number of Registered Controllers (REGCTL)字段为0,代表没有Host作为registrant对namespace进行reservation操作;
  4. Reservation Status data structure的Persist Through Power Loss State (PTPLS)字段值,与Get Feature command – Reservation Persistence Feature的CQ Entry的Dword 0中的Persist Through Power Loss(PTPL)值相同;

 

Case 2:Host is a Registrant

测试步骤

  1. 检查ONCS字段确定SSD是否支持reservation,如果不支持本测试无效;
  2. 针对NVMe Subsystem里的每个NVMe Controller:
    1. Host发送Set Features command设置Host Identifier;
    2. 针对每个Active的Namespace
      1. Host发送Reservation Register command,将Reservation Register Action (RREGA)字段设置为 000b,并在New Reservation Key (NRKEY)字段中为该namespace设置一个reservation key,以完成对该namespace的Reservation Acquire;
      2. Host发送Reservation Report command;
  • Host发送Identify command,指定CNS=01h,以获取Identify Controller data structure;

期望结果

  1. SSD正常返回CQ;
  2. Host每向NVMe Controller发送要给Reservation Register command,Reservation Status data structure的Generation (GEN)字段值会增加;
  3. Reservation Status data structure的Reservation Type (RTYPE)字段值为非0,说明namespace上有reservation;
  4. Reservation Status data structure的Registered Controllers(REGCTL)字段值与Host发送的Host Identifier值(声明有多少controller与Host关联)相同;
  5. 在Reservation Status data structure中返回Registered Controllers data structure的数量,与REGCTL字段值相同;
  6. Registered Controllers data structure的Controller ID(CNTLID)字段值,与Identify Controller data structure中CNTLID字段值相同;
  7. Registered Controllers data structure的Reservation Status (RCSTS)字段bit 0被设置为非‘0’值,说明有Host当面对namespace有reservation;
  8. Registered Controllers data structure的Host Identifier (HOSTID)字段值,与Set Feature command里的设置相同;
  9. Registered Controllers data structure的Reservation Key (RKEY)字段值,与Host发送Reservation Register command中的reservation 可以相同;

 

Test 7.2 – Reservation Registration

Case 1: Basic Operation

测试步骤:

  1. 检查ONCS字段确定SSD是否支持reservation,如果不支持本测试无效;
  2. 针对NVMe Subsystem里的每个NVMe Controller:
    1. Host发送Set Features command设置Host Identifier;
    2. 针对每个Active的Namespace
      1. Host发送Reservation Register command,将Reservation Register Action (RREGA)字段设置为 000b,并在New Reservation Key (NRKEY)字段中为该namespace设置一个reservation key;
      2. Host发送Reservation Report command;

期望结果

  1. SSD正常返回CQ;
  2. SSD返回的Reservation Status data structure,显示register namespace顺利完成;

Case 2: Re-registration

测试步骤:

  1. 检查ONCS字段确定SSD是否支持reservation,如果不支持本测试无效;
  2. 针对NVMe Subsystem里的每个NVMe Controller:
    1. Host发送Set Features command设置Host Identifier;
    2. 针对每个Active的Namespace
      1. Host发送Reservation Register command,将Reservation Register Action (RREGA)字段设置为 000b (Register Reservation Key),并在New Reservation Key (NRKEY)字段中为该namespace设置一个reservation key;
      2. Host再发送一个Reservation Register command,使用相同的reservation key;
  • Host发送Reservation Report command;
  1. Host再发送一个Reservation Register command,使用一个不同的reservation key;
  2. Host发送Reservation Report command;

期望结果

  1. SSD正常返回CQ;
  2. SSD返回的Reservation Status data structure,显示register namespace顺利完成;
  3. 最后那个使用不同reservation key的Reservation Register command,CQ中上报错误 – Reservation Conflict;
  4. 最后一步Reservation Report command获取的Reservation Status data structure,其reservation key不变;

 

Case 3: Replace Registration Key

测试步骤

  1. 检查ONCS字段确定SSD是否支持reservation,如果不支持本测试无效;
  2. 针对NVMe Subsystem里的每个NVMe Controller:
    1. Host发送Set Features command设置Host Identifier;
    2. 针对每个Active的Namespace
      1. Host发送Reservation Register command,将Reservation Register Action (RREGA)字段设置为 000b(Register Reservation Key),并在New Reservation Key (NRKEY)字段中为该namespace设置一个reservation key;
      2. Host发送Reservation Register command,将Reservation Register Action (RREGA)字段设置为 010b(Replace Reservation Key),在Current Reservation Key(CRKEY)字段设置当前的reservation key, 并在NRKEY字段设置一个新的reservation key;
  • Host发送Reservation Report command;
  1. Host发送Reservation Register command,将Reservation Register Action (RREGA)字段设置为 010b(Replace Reservation Key),在Current Reservation Key(CRKEY)字段设置一个非当前reservation key的值, 并在NRKEY字段设置一个新的reservation key。同时将Reservation Acquire Command的RType设置为2;
  2. Host发送Reservation Report command;
  3. Host发送Reservation Acquire command,将Reservation Acquire Action (RACQA)字段设置为000b (Acquire),并将Current Reservation Key(CRKEY)字段设置为current reservation key;
  • Host发送Reservation Register command,将Reservation Register Action (RREGA)字段设置为 000b(Register Reservation Key),并在New Reservation Key (NRKEY)字段中设置一个新的reservation key,并将IEKEY bit置为1;
  • Host发送Reservation Report command;

期望结果

  1. SSD正常返回CQ;
  2. 第二个Reservation Registration command成功修改了Reservation Key;
  3. 第三个Reservation Registration command,SSD返回错误 – Reservation Conflict;
  4. 第三个Reservation Registration command之后,Reservation Key没有被修改;
  5. 第四个Reservation Registration command成功修改了Reservation Key,同时Host仍然对该Namespace保持reservation状态;

 

Case 4: Multiple Host

测试步骤

  1. 检查ONCS字段确定SSD是否支持reservation,如果不支持本测试无效;
  2. Host 1发送Set Features command给NVMe Controller 1设置Host Identifier;
  3. Host 2发送Set Features command给NVMe Controller 2设置Host Identifier (ID与Host 1不同);
  4. Host 1 发送Reservation Register command给NVMe Controller 1,将Reservation Register Action (RREGA)字段设置为 000b(Register Reservation Key),并在New Reservation Key (NRKEY)字段中为该namespace设置一个reservation key;
  5. Host 2 发送Reservation Register command给NVMe Controller 2,将Reservation Register Action (RREGA)字段设置为 000b(Register Reservation Key),并在New Reservation Key (NRKEY)字段中为该namespace设置与步骤4中Host 1相同的reservation key;
  6. Host 1发送Reservation Report command;

期望结果

  1. SSD正常返回CQ;
  2. 两个Host均成功注册namespace;

 

Test 7.3 – Unregistering

Case 1: Unregistering with Reservation Register Command

测试步骤

  1. 检查ONCS字段确定SSD是否支持reservation,如果不支持本测试无效;
  2. 针对NVMe Subsystem里的每个NVMe Controller:
    1. Host发送Set Features command设置Host Identifier;
    2. 针对每个Active的Namespace
      1. Host发送Reservation Register command,将Reservation Register Action (RREGA)字段设置为 000b (Register Reservation Key),并在New Reservation Key (NRKEY)字段中为该namespace设置一个reservation key;
      2. Host发送Reservation Register command进行Unregistered Reservation Key操作,在CRKEY字段中填入有效的current reservation key;
  • Host 发送Reservation Report command;

期望结果

  1. SSD正常返回CQ;
  2. Host成功unregistered;

 

Case 2:Unregistering due to Preemption

测试步骤

  1. 检查ONCS字段确定SSD是否支持reservation,如果不支持本测试无效;
  2. Host 1发送Set Features command给NVMe Controller 1设置Host Identifier;
  3. Host 2发送Set Features command给NVMe Controller 2设置Host Identifier (ID与Host 1不同);
  4. Host 1 发送Reservation Register command给NVMe Controller 1,将Reservation Register Action (RREGA)字段设置为 000b(Register Reservation Key),并在New Reservation Key (NRKEY)字段中为该namespace设置一个reservation key;
  5. Host 2 发送Reservation Register command给NVMe Controller 2,将Reservation Register Action (RREGA)字段设置为 000b(Register Reservation Key),并在New Reservation Key (NRKEY)字段中为该namespace设置一个reservation key;
  6. Host 2发送 Reservation Acquire command给NVMe Controller 2, 将 RACQA字段设置为 001b (Preempt),并在CRKEY字段中设置正确的current reservation key,并将Preempt Reservation Key (PRKEY)字段设置为Host 1使用的current reservation Key值;
  7. Host 2发送Reservation Report command给NVMe Controller 2;

期望结果

  1. SSD正常返回CQ;
  2. Host 2没有unregistered, Host 1被unregistered;

 

Case 7.4 Acquire a Reservation

Case 1: Basic Operation

测试步骤

  1. 检查ONCS字段确定SSD是否支持reservation,如果不支持本测试无效;
  2. 针对NVMe Subsystem里的每个NVMe Controller:
    1. Host发送Set Features command设置Host Identifier;
    2. 针对每个Active的Namespace
      1. Host发送Reservation Register command,将Reservation Register Action (RREGA)字段设置为 000b (Register Reservation Key),并在New Reservation Key (NRKEY)字段中为该namespace设置一个reservation key;
      2. Host发送Identify command (CNS=00h),获取Identify Namespace data structure;
  • 针对RESCAP字段中声明支持的每一种reservation type
    1. Host发送Reservation Acquire command, 将Reservation Acquire Action (RACQA)字段设置为 000b (Acquire),在CRKEY字段中填入正确的current reservation key, 将Reservation Type (RTYPE)字段设置为相应值;
    2. Host 发送Reservation Report command;
    3. Host 发送 Reservation Release command, 将 Reservation Release Action (RRELA) 字段设置为000b (Release),将Reservation Type (RTYPE)字段设置为准备release的类型,在CRKEY字段中填入正确的current reservation key;

期望结果

  1. SSD正常返回CQ;
  2. Host 成功以正确的reservation type完成acquire reservation;

 

Case 2: Error Condition

测试步骤

  1. 检查ONCS字段确定SSD是否支持reservation,如果不支持本测试无效;
  2. 针对NVMe Subsystem里的每个NVMe Controller:
    1. Host发送Set Features command设置Host Identifier;
    2. 针对每个Active的Namespace
      1. RES_ACQ1: Host发送Reservation Acquire command,将Reservation Acquire Action (RACQA)字段设置为000b (Acquire),在CRKEY字段填入一个随机reservation key,将RTYPE字段设置为namespace支持的类型;
      2. RES_REP1: Host发送Reservation Report command;
      3. Host 发送Reservation Register command,将Reservation Register Action (RREGA)字段设置为 000b (Register Reservation Key),并在New Reservation Key (NRKEY)字段中为该namespace设置一个reservation key;
  • RES_ACQ2: Host发送Reservation Acquire command,将Reservation Acquire Action (RACQA)字段设置为000b (Acquire),在CRKEY字段填入一个不等于Host之前设置的current reservation key的值,将RTYPE字段设置为namespace支持的类型;
  1. RES_REP2: Host发送Reservation Report command;
  2. RES_ACQ3:Host发送Reservation Acquire command,将Reservation Acquire Action (RACQA)字段设置为000b (Acquire),在CRKEY字段填入一个不等于Host之前设置的current reservation key的值,将IEKEY 设置为‘1’,将RTYPE字段设置为namespace支持的类型;
  3. RES_REP3: Host发送Reservation Report command;
  • RES_ACQ4:Host发送Reservation Acquire command,将Reservation Acquire Action (RACQA)字段设置为000b (Acquire),在CRKEY字段填入正确的current reservation key的值,将RTYPE字段设置为不支持的类型;
  • RES_REP4: Host发送Reservation Report command;
  1. RES_ACQ5:Host发送Reservation Acquire command,将Reservation Acquire Action (RACQA)字段设置为000b (Acquire),在CRKEY字段填入正确的current reservation key的值,将RTYPE字段设置为namespace支持的类型;

期望结果

  1. SSD正常返回CQ;
  2. RES_ACQ1对应的CQE回复错误 – Reservation Conflict;
  3. 检查RES_REP1回复的Reservation status data structure,确认Host没有获得reservation;
  4. RES_ACQ2对应的CQE回复错误 – Reservation Conflict;
  5. 检查RES_REP2回复的Reservation status data structure,确认Host没有获得reservation;
  6. 检查RES_REP3回复的Reservation status data structure,确认Host成功获得reservation;
  7. RES_ACQ4对应的CQE回复错误 – Reservation Conflict;
  8. 检查RES_REP4回复的Reservation status data structure,确认Host仍然保持之前的reservation,且reservation type不变;
  9. 检查RES_REP5回复的Reservation status data structure,确认Host仍然保持之前的reservation,且reservation type不变;

 

Case 3: Multiple Host

测试步骤

  1. 检查ONCS字段确定SSD是否支持reservation,如果不支持本测试无效;如果SSD只支持single port,本测试无效;
  2. Host 1发送Set Features command给NVMe Controller 1设置Host Identifier;
  3. Host 2发送Set Features command给NVMe Controller 2设置Host Identifier (ID与Host 1不同);
  4. Host 1 发送Reservation Register command给NVMe Controller 1,将Reservation Register Action (RREGA)字段设置为 000b(Register Reservation Key),并在New Reservation Key (NRKEY)字段中为该namespace设置一个reservation key;
  5. Host 2 发送Reservation Register command给NVMe Controller 2,将Reservation Register Action (RREGA)字段设置为 000b(Register Reservation Key),并在New Reservation Key (NRKEY)字段中为该namespace设置一个reservation key;
  6. Host 1发送 Reservation Acquire command给NVMe Controller 1, 将 RACQA字段设置为 000b (Acquire),并在CRKEY字段中设置正确的current reservation key,并将RTYPE字段设置为Namespace支持的类型;
  7. Host 2发送 Reservation Acquire command给NVMe Controller 2, 将 RACQA字段设置为 000b (Acquire),并在CRKEY字段中设置正确的current reservation key,并将RTYPE字段设置为Namespace支持的类型;
  8. Host 2 发送Reservation Report command给NVMe Controller 2;

期望结果

  1. SSD正常返回CQ;
  2. Host 2发送的Reservation Acquire command命令返回Reservation conflict
  3. Host 1获得对namespace的reservation,Host 2没有;

 

Test 7.5 – Releasing a Reservation

Case 1: Release with Reservation Release Command

测试步骤:

  1. 检查ONCS字段确定SSD是否支持reservation,如果不支持本测试无效;
  2. 针对NVMe Subsystem里的每个NVMe Controller:
    1. Host发送Set Features command设置Host Identifier;
    2. 针对每个Active的Namespace
      1. Host发送Reservation Register command,将Reservation Register Action (RREGA)字段设置为 000b (Register Reservation Key),并在New Reservation Key (NRKEY)字段中为该namespace设置一个reservation key;
      2. Host发送Reservation Acquire command, 将Reservation Acquire Action (RACQA)字段设置为 000b (Acquire),在CRKEY字段中填入正确的current reservation key, 将Reservation Type (RTYPE)字段设置为相应值;
  • Host发送Reservation Release command,将Reservation Release Action (RRELA)字段设置为000b (Release),将Reservation Type (RTYPE)字段设置为相应值,在CRKEY字段中填入正确的current reservation key;
  1. Host 发送Reservation Report command;

期望结果:

  1. SSD正常返回CQ;
  2. Host成功release reservation;

 

Case 2:Reservation Release Command Error Condition

测试步骤

  1. 检查ONCS字段确定SSD是否支持reservation,如果不支持本测试无效;
  2. 针对NVMe Subsystem里的每个NVMe Controller:
    1. Host发送Set Features command设置Host Identifier;
    2. 针对每个Active的Namespace
      1. Host发送Reservation Register command,将Reservation Register Action (RREGA)字段设置为 000b (Register Reservation Key),并在New Reservation Key (NRKEY)字段中为该namespace设置一个reservation key;
      2. Host发送Reservation Acquire command, 将Reservation Acquire Action (RACQA)字段设置为 000b (Acquire),在CRKEY字段中填入正确的current reservation key, 将Reservation Type (RTYPE)字段设置为相应值;
  • RES_REL1: Host发送Reservation Release command,将Reservation Release Action (RRELA)字段设置为000b (Release),将Reservation Type (RTYPE)字段设置为相应值,在CRKEY字段中填入错误的current reservation key;
  1. RES_REP1: Host 发送Reservation Report command;
  2. RES_REL2: Host发送Reservation Acquire command, 将Reservation Acquire Action (RACQA)字段设置为 000b (Acquire),在CRKEY字段中填入正确的current reservation key, 将Reservation Type (RTYPE)字段设置为错误的type;
  3. RES_REP2: Host 发送Reservation Report command;
  • RES_REL3: Host发送Reservation Release command,将Reservation Release Action (RRELA)字段设置为000b (Release),将Reservation Type (RTYPE)字段设置为相应值,在CRKEY字段中填入错误的current reservation key,将IEKEY设置为‘1’;
  • RES_REP3: Host 发送Reservation Report command;

期望结果

  1. SSD正常返回CQ;
  2. RES_REL1返回错误 – Reservation Conflict;
  3. RES_REP1之后Host仍然保持对Namespace的Reservation状态;
  4. RES_REL2返回错误 -Invalid Field in Command;
  5. RES_REP2之后Host仍然保持对Namespace的Reservation状态;
  6. RES_REL3之后Host 成功release reservation;

 

Case 3: Multiple Host

  1. 检查ONCS字段确定SSD是否支持reservation,如果不支持本测试无效;如果SSD只支持single port,本测试无效;
  2. Host 1发送Set Features command给NVMe Controller 1设置Host Identifier;
  3. Host 2发送Set Features command给NVMe Controller 2设置Host Identifier (ID与Host 1不同);
  4. Host 1 发送Reservation Register command给NVMe Controller 1,将Reservation Register Action (RREGA)字段设置为 000b(Register Reservation Key),并在New Reservation Key (NRKEY)字段中为该namespace设置一个reservation key;
  5. Host 2 发送Reservation Register command给NVMe Controller 2,将Reservation Register Action (RREGA)字段设置为 000b(Register Reservation Key),并在New Reservation Key (NRKEY)字段中为该namespace设置一个reservation key;
  6. Host 1发送Reservation Release command, 将Reservation Release Action (RRELA)字段设置为000b (release),将RTYPE字段为设置为任意type, 在CRKEY字段中填入正确的值;
  7. Host 1发送 Reservation Acquire command给NVMe Controller 1, 将 RACQA字段设置为 000b (Acquire),并在CRKEY字段中设置正确的current reservation key;
  8. Host 2发送Reservation Release command, 将Reservation Release Action (RRELA)字段设置为000b (release),将RTYPE字段为设置为与步骤6相同type, 在CRKEY字段中填入与步骤6相同的值;
  9. Host 2发送Reservation Report command给NVMe Controller 2;

期望结果

  1. SSD正常返回CQ;
  2. Host 1成功release reservation;
  3. Host 2成功release reservation;
  4. 所有步骤完成后,Host 1保持对namespace的reservation,Host 2没有;

 

Case 5:Release Due to Unregister

测试步骤

  1. 检查ONCS字段确定SSD是否支持reservation,如果不支持本测试无效;
  2. 针对NVMe Subsystem里的每个NVMe Controller:
    1. Host发送Set Features command设置Host Identifier;
    2. 针对每个Active的Namespace
      1. Host发送Reservation Register command,将Reservation Register Action (RREGA)字段设置为 000b (Register Reservation Key),并在New Reservation Key (NRKEY)字段中为该namespace设置一个reservation key;
      2. Host发送Reservation Acquire command, 将Reservation Acquire Action (RACQA)字段设置为 000b (Acquire),在CRKEY字段中填入正确的current reservation key, 将Reservation Type (RTYPE)字段设置为01h (Write Exclusive Access) ;
  • Host发送Reservation Register command – Unregister Reservation Key action, 在CRKEY字段中填入正确的值;
  1. Host 发送Reservation Report command;

期望结果

  1. SSD正常返回CQ;
  2. Host成功unregister,同时对namespace的reservation被release;

 

Test 7.6 – Preempting a Reservation

Case 1: Write Exclusive – All Registrant or Exclusive Access – All Registrants

测试步骤

  1. 检查ONCS字段确定SSD是否支持reservation,如果不支持本测试无效;
  2. Host 1发送Set Features command给NVMe Controller 1设置Host Identifier;
  3. Host 2发送Set Features command给NVMe Controller 2设置Host Identifier (ID与Host 1不同);
  4. Host 1 发送Reservation Register command给NVMe Controller 1,将Reservation Register Action (RREGA)字段设置为 000b(Register Reservation Key),并在New Reservation Key (NRKEY)字段中为该namespace设置一个reservation key;
  5. Host 2 发送Reservation Register command给NVMe Controller 2,将Reservation Register Action (RREGA)字段设置为 000b(Register Reservation Key),并在New Reservation Key (NRKEY)字段中为该namespace设置一个reservation key;
  6. Host 1发送 Reservation Acquire command给NVMe Controller 1, 将 RACQA字段设置为 000b (Acquire),并在CRKEY字段中设置正确的current reservation key,将RTYPE设置为 Write Exclusive – All Registrants or Exclusive Access – All Registrants;
  7. Host 2发送 Reservation Acquire command给NVMe Controller 2, 将 RACQA字段设置为 001b (Preempt),并在CRKEY字段中设置正确的current reservation key,将Preempt Reservation Key (PRKEY)字段设为0;
  8. Host 2发送Reservation Report command给NVMe Controller 2;
  9. Host 2发送 Reservation Release command给NVMe Controller 2, 将RRELA字段设为000b (Release),将RTYPE设置为正确类型,在CRKEY中填入正确的current reservation key;
  10. Host 1 发送Reservation Register command给NVMe Controller 1,将Reservation Register Action (RREGA)字段设置为 000b(Register Reservation Key),并在New Reservation Key (NRKEY)字段中为该namespace设置一个reservation key;
  11. Host 1发送 Reservation Acquire command给NVMe Controller 1, 将 RACQA字段设置为 000b (Acquire),并在CRKEY字段中设置正确的current reservation key, 将RTYPE设置为 Write Exclusive – All Registrants or Exclusive Access – All Registrants;
  12. Host 2发送 Reservation Acquire command给NVMe Controller 2, 将 RACQA字段设置为 001b (Preempt),并在CRKEY字段中设置正确的current reservation key,将Preempt Reservation Key (PRKEY)字段设为Host 1使用的值;
  13. Host 2发送Reservation Report command给NVMe Controller 2;

期望结果

  1. SSD正常返回CQ;
  2. 检查第1次Reservation Report command返回的数据,Host 2没有unregistered, Host 1成功unregistered,Host 2保持对namespace的reservation;
  3. 检查第2次Reservation Report command返回的数据,Host 2没有unregistered, Host 1成功unregistered;

 

Case 2: Other Registration Types

测试步骤

  1. 检查ONCS字段确定SSD是否支持reservation,如果不支持本测试无效;如果SSD只支持single port,本测试无效;
  2. Host 1发送Set Features command给NVMe Controller 1设置Host Identifier;
  3. Host 2发送Set Features command给NVMe Controller 2设置Host Identifier (ID与Host 1不同);
  4. Host 1 发送Reservation Register command给NVMe Controller 1,将Reservation Register Action (RREGA)字段设置为 000b(Register Reservation Key),并在New Reservation Key (NRKEY)字段中为该namespace设置一个reservation key;
  5. Host 2 发送Reservation Register command给NVMe Controller 2,将Reservation Register Action (RREGA)字段设置为 000b(Register Reservation Key),并在New Reservation Key (NRKEY)字段中为该namespace设置一个reservation key;
  6. Host 1发送 Reservation Acquire command给NVMe Controller 1, 将 RACQA字段设置为 000b (Acquire),并在CRKEY字段中设置正确的current reservation key,将RTYPE设置为 Write Exclusive, Exclusive Access, Write Exclusive – Registrants Only,or Exclusive Access – Registrants Only;
  7. Host 2发送 Reservation Acquire command给NVMe Controller 2, 将 RACQA字段设置为 001b (Preempt),并在CRKEY字段中设置正确的current reservation key,并将Preempt Reservation Key (PRKEY)字段设置为Host 1使用的current reservation Key值;
  8. Host 2发送Reservation Report command给NVMe Controller 2;
  9. Host 2发送Reservation Release command给NVMe Controller 2, 将Reservation Release Action (RRELA)字段设置为000b (release),将RTYPE字段为设置为任意type, 在CRKEY字段中填入正确的值;
  10. Host 1 发送Reservation Register command给NVMe Controller 1,将Reservation Register Action (RREGA)字段设置为 000b(Register Reservation Key),并在New Reservation Key (NRKEY)字段中为该namespace设置一个reservation key;
  11. Host 1发送 Reservation Acquire command给NVMe Controller 1, 将 RACQA字段设置为 000b (Acquire),并在CRKEY字段中设置正确的current reservation key,将RTYPE设置为 Write Exclusive, Exclusive Access, Write Exclusive – Registrants Only,or Exclusive Access – Registrants Only;
  12. Host 2发送 Reservation Acquire command给NVMe Controller 2, 将 RACQA字段设置为 001b (Preempt),并在CRKEY字段中设置正确的current reservation key,并将Preempt Reservation Key (PRKEY)字段设置为一个与Host 1使用的current reservation Key不同的值;
  13. Host 2发送Reservation Report command给NVMe Controller 2;
  14. Host 1发送 Reservation Acquire command给NVMe Controller 1, 将 RACQA字段设置为 000b (Acquire),并在CRKEY字段中设置正确的current reservation key,将RTYPE设置为 Write Exclusive, Exclusive Access, Write Exclusive – Registrants Only,or Exclusive Access – Registrants Only;
  15. Host 2发送 Reservation Acquire command给NVMe Controller 2, 将 RACQA字段设置为 001b (Preempt),并在CRKEY字段中设置正确的current reservation key,并将Preempt Reservation Key (PRKEY)设置为0;
  16. Host 2发送Reservation Report command给NVMe Controller 2;

期望结果

  1. SSD正常返回CQ;
  2. 检查第1次Reservation Report command返回的数据,Host 2没有unregistered, Host 1成功unregistered,Host 2保持对namespace的reservation;
  3. 检查第2次Reservation Report command返回的数据,Host 1和Host 2都处于registered状态,Host 1保持对namespace的reservation;
  4. 第三个Reservation Acquire command- with Preempt action,返回错误 – Invalid Field in command;
  5. 检查第3次Reservation Report command返回的数据,Host 1和Host 2都处于registered状态,Host 1保持对namespace的reservation;

 

Case 3: Self-preemption

测试步骤

  1. 检查ONCS字段确定SSD是否支持reservation,如果不支持本测试无效;如果SSD只支持single port,本测试无效;
  2. 针对NVMe Subsystem里的每个NVMe Controller:
    1. Host发送Set Features command设置Host Identifier;
    2. 针对每个Active的Namespace
      1. Host发送Reservation Register command,将Reservation Register Action (RREGA)字段设置为 000b (Register Reservation Key),并在New Reservation Key (NRKEY)字段中为该namespace设置一个reservation key;
      2. Host发送Reservation Acquire command, 将Reservation Acquire Action (RACQA)字段设置为 000b (Acquire),在CRKEY字段中填入正确的current reservation key, 将Reservation Type (RTYPE)字段设置为相应值;
  • Host发送Reservation Acquire command, 将Reservation Acquire Action (RACQA)字段设置为 001b (Preempt), 在CRKEY字段中填入正确的current reservation key,将PRKEY字段设为0;
  1. Host 发送Reservation Report command;

期望结果

  1. SSD正常返回CQ;
  2. Host没有被unregistered,保持对namespace的reservation,同时Type与Reservation Acquire command with Preempt action命令中指定的Type一样;

 

Case 4: Preempt and Abort

测试步骤

  1. 检查ONCS字段确定SSD是否支持reservation,如果不支持本测试无效;如果SSD只支持single port,本测试无效;
  2. Host 1发送Set Features command给NVMe Controller 1设置Host Identifier;
  3. Host 2发送Set Features command给NVMe Controller 2设置Host Identifier (ID与Host 1不同);
  4. Host 1 发送Reservation Register command给NVMe Controller 1,将Reservation Register Action (RREGA)字段设置为 000b(Register Reservation Key),并在New Reservation Key (NRKEY)字段中为该namespace设置一个reservation key;
  5. Host 2 发送Reservation Register command给NVMe Controller 2,将Reservation Register Action (RREGA)字段设置为 000b(Register Reservation Key),并在New Reservation Key (NRKEY)字段中为该namespace设置一个reservation key;
  6. Host 1发送 Reservation Acquire command给NVMe Controller 1, 将 RACQA字段设置为 000b (Acquire),并在CRKEY字段中设置正确的current reservation key, 将RTYPE设置为该namespace支持的reservation type;
  7. Host 1发送10个read command给NVMe Controller 1;
  8. Host 2发送 Reservation Acquire command给NVMe Controller 2, 将 RACQA字段设置为 010b (Preempt and Abort),并在CRKEY字段中设置正确的current reservation key,并将Preempt Reservation Key (PRKEY)字段设置为Host 1使用的current reservation Key值;
  9. Host 2发送Reservation Report command给NVMe Controller 2;

期望结果

  1. SSD正常返回CQ;

注:官方目前还没有确定本项目可靠的测试方法,本测试不会被包括在任何conformance测试中

 

Test 7.7 – Clearing a Reservation

Case1: Basic Operation with Reservation Release Command

测试步骤:

  1. 检查ONCS字段确定SSD是否支持reservation,如果不支持本测试无效;
  2. 针对NVMe Subsystem里的每个NVMe Controller:
    1. Host发送Set Features command设置Host Identifier;
    2. 针对每个Active的Namespace
      1. Host发送Reservation Register command,将Reservation Register Action (RREGA)字段设置为 000b (Register Reservation Key),并在New Reservation Key (NRKEY)字段中为该namespace设置一个reservation key;Host发送Reservation Acquire command, 将Reservation Acquire Action (RACQA)字段设置为 000b (Acquire),在CRKEY字段中填入正确的current reservation key, 将Reservation Type (RTYPE)字段设置为相应值;
      2. Host发送Reservation Release command,将Reservation Release Action (RRELA)字段设置为001b(Clear),并在CRKEY字段中填入正确的current reservation key;
  • Host 发送Reservation Report command;

期望结果

  1. SSD正常返回CQ;
  2. Host不再保持对namespace的reservation,并且已经unregistered;

 

Case2: Error Conditions

测试步骤