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

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
    评论
GARCH-Copula-VaR模型是一种用于描述多个金融资产收益率之间相关性和风险的模型。该模型的核心是使用GARCH模型对每个资产的收益率进行建模,然后使用Copula函数将它们的相关性引入模型中,最后使用VaR(Value at Risk)来度量各个资产的风险。 下面是在R语言中实现该模型的步骤: 1.准备数据 首先,需要准备16支股票的收益率时间序列数据。可以使用quantmod包中的getSymbols函数从Yahoo Finance或者其他金融数据源中获取数据。 2.建立GARCH模型 使用rugarch包中的ugarchfit函数对每个股票的收益率序列进行GARCH模型拟合。这个函数可以自动选择最合适的GARCH模型,并返回拟合结果。 3.计算残差 将每个股票的收益率序列减去相应的GARCH模型预测,得到每个股票的残差序列。 4.使用Copula函数建立相关性 使用copula包中的fitCopula函数,将所有股票的残差序列作为输入,建立一个Copula函数模型。这个函数将返回估计的Copula函数参数。 5.使用VaR度量风险 使用Copula函数和每个股票的GARCH模型,可以生成一个联合分布。使用该联合分布,可以计算每个股票的VaR。可以使用rugarch包中的ugarchboot函数进行VaR计算。 下面是R代码实现: ``` r library(quantmod) library(rugarch) library(copula) # 获取数据 symbols <- c("AAPL", "MSFT", "AMZN", "GOOG", "FB", "TSLA", "NVDA", "JPM", "V", "JNJ", "PG", "UNH", "HD", "DIS", "PYPL", "ADBE") getSymbols(symbols, from = "2020-01-01", to = "2021-01-01") # 提取收益率数据 returns <- matrix(NA, nrow = NROW(AAPL), ncol = length(symbols)) for (i in 1:length(symbols)) { returns[, i] <- dailyReturn(get(symbols[i])) } returns <- returns[-1, ] # 建立GARCH模型 garchModels <- list() for (i in 1:length(symbols)) { garchModels[[i]] <- ugarchfit(data = returns[, i], auto.assign = FALSE, solver = "hybrid") } # 计算残差 residuals <- matrix(NA, nrow = NROW(AAPL) - 1, ncol = length(symbols)) for (i in 1:length(symbols)) { residuals[, i] <- residuals(garchModels[[i]], standardize = TRUE) } # 建立Copula函数 copulaModel <- fitCopula(residuals, family = "t") # 计算VaR VaR <- matrix(NA, nrow = 1, ncol = length(symbols)) for (i in 1:length(symbols)) { VaR[, i] <- ugarchboot(garchModels[[i]], method = "Partial", boot.type = "Multi", num.boot = 100, VaR.alpha = 0.05, VaR.cr = "sR", solver = "hybrid")$VaRforecast[1, 1] } ``` 以上便是使用GARCH-Copula-VaR模型描述16支股票收益率时间序列数据建模的理论和R代码实现过程。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值