NMVe Asynchronous Events

15 篇文章 2 订阅

Group 1 Admin Command Set的第7项是Asynchronous Event测试。

Asynchronous events are used to notify host software of status, error, and health information as these events occur. To enable asynchronous events to be reported by the controller, host software needs to submit one or more Asynchronous Event Request commands to the controller. The controller specifies an event to the host by completing an Asynchronous Event Request command. Host software should expect that the controller may not execute the command immediately; the command should be completed when there is an event to be reported. The Asynchronous Event Request command is submitted by host software to enable the reporting of asynchronous events from the controller. This command has no timeout. The controller posts a completion queue entry for this command when there is an asynchronous event to report to the host. If Asynchronous Event Request commands are outstanding when the controller is reset, the commands are aborted.

异步事件用于当状态、错误、健康信息这些事件发生时通知主机软件。为了使能这个controller报告的异步事件,主机软件需要提交一个或多个异步事件请求命令(Asynchronous Event Request command)到controller。controller通过完成一个异步事件请求命令到主机来详细描述一个事件。主机软件应当期望controller可能不是立即执行这个命令,当有一个事件需要报告给主机时这种命令才会被完成。

异步事件请求命令由主机软件提交来使能从controller的异步事件报告这种命令不会超时。当有一个异步事件时controller为这个命令推送一个CQE报告给主机。如果当controller被重启时有异步事件请求命令待处理,那么这些命令被abort,不回复CQE。

所有特定于命令的字段都被保留。

主机软件可以提交多个异步事件请求命令来减小报告时延。并存待处理的异步事件请求命令的总数是有限的,限制由Identify Controller数据结构中的Asynchronous Event Request Limit指定,请参照Figure 247。

【附加:AERL字段占用一个字节,为便于查看,从Figure 247的Identify Controller data structure中截取出对应的字段如下】

异步事件被分组到不同的事件类型中,事件类型信息在CQE的Dword 0中为异步事件请求命令做标识。当Controller为一个待处理异步事件请求命令发送CQE,这样报告一个异步事件,在主机清除这个事件之前,本事件类型的随后的事件被自动的屏蔽。主机清理事件的方式是通过使用Get Log Page命令读对应事件的log page (Get Log Page Command)(参考第5.14章节)。

 异步事件被报告是因为有新条目加进一个日志页(例如Error Information日志)或状态更新(例如SMART/Health日志中的状态)。一个状态变化或许永久的(例如介质变成了只读)或短暂的(例如某个时间周期温度达到或超过一个临界值)。发布另一个异步事件请求命令之前,主机软件应该更改这个事件临界值或屏蔽这个事件,以避免异步事件重复的报告

【1-1】关于异步事件上报已经被使能,但没有异步事件命令待处理的情况,如果事件发生,Controller应该保留该异步事件类型的事件信息,并将该信息用作对接收到的下一个异步事件请求命令的相应。

【1-2】如果在接收到异步事件请求命令之前一个Get Log Page命令清除了此事件或者发生了掉电关机情况,那么通知不发送。

【2-1】如果相同类型的多个事件且对异步事件请求命令具有完全相同应答的事件发生,那么这些事件可以作为一个单个应答给异步事件请求命令。

【2-2】如果多个不同类型的事件产生,那么controller应该保留这些事件的队列,以便在应答后续异步事件请求命令时上报。

如果SSD希望在没有接收到可用的Asynchronous Event Request command时上报Asynchronous Event,需要在接收到Asynchronous Event Request command时发送一个该事件类型的notification给Host

如果在接收到Asynchronous Event Request command前Get Log Page command已经清除了该Event,或者发生Power off,SSD不会发送Notification。

当SSD上报某种Event并回复CQ时,会自动屏蔽该类型的其他Event,直到Host清除该Event。Host 通过发送Get Log Page command清除Event。

已定义的事件类型如下:

  1. a)Error event:表明一个非特定于此命令的常规错误(参考Figure 145)。主机软件使用Get Log Page命令且Retain Asynchronous Event位设置为0读取这个Error Information log(参考第5.14.1.1章节)来清除这个事件。
  2. b)SMART/Health Status event:表明一个SMART或Health状态事件(参考Figure146)。主机软件使用Get Log Page命令且Retain Asynchronous Event位设置为0读取这个SMART/Health Information log(参考第5.14.1.2章节)来清除这个事件。触发异步事件的条件是可以在Asynchronous Event Configuration特性中使用Set Feature命令来配置的(参考5.21章节)。
  3. c)Notice event:表明一个常规事件(参考Figure 147)。参照Figure 147中的描述,主机软件读取适当的日志页来清除这个事件。触发异步事件的条件可以在Asynchonous Event Configuration特性中使用Set Feature命令(参考第5.21.1.11章节)来配置。这些notice事件包括:

                 A. Namespace Attribute Changed;

                 B. Firmware Activation Starting;

                 C. Telemetry Log Changed;

                 D. Asymmetric Namespace Access Change;

                 E. Predictable Latency Event Aggregate Log Change;

                 F. LBA Status Information Alert; and

                G. Endurance Group Event Aggregate Log Page Change;

4. d)NVM Command Set Specific event:事件是由I/O命令集来定义的:

        A. Reservation Log Page Available event:预订日志页可用事件表明一个或多个Reservation Notification日志页(参考第5.14.1.16.1章节)是空闲可用的。主机软件使用Get Log Page命令且Retain Asynchronous Event位设置为0读取这个Reservation Notification日志页来清除此事件;

        B. Sanitize Operation Completed event:无害化【让介质上数据毁尸灭迹无法恢复】操作完成事件表明无害化操作已经完成(包括任意相关联的附加的介质修改,参考Figure 247中的No-Deallocate Modifies Media After Sanitize 字段),在Sanitize Status日志页(参考第5.14.1.16.2)中所有LBAs不存在意外未释放和状态可用的情况。主机软件使用Get Log Page命令且Retain Asynchronous Event位设为0读取Sanitize Status日志页来清除此事件;

       C. Sanitize Operation Completed With Unexpected Deallocation event:表明无害化操作已经完成,在Sanitize Status日志页中,对于所有LBAs和状态可用,存在意外的解除分配。主机软件使用Get Log Page命令且Retain Asynchronous Event位设为0读取Sanitize Status日志页来清除此事件。

5. e)Vendor Specific event:厂商特定时间表明一个特定厂商的事件。主机软件使用Get Log Page命令且设置Retain Asynchronous Event位为0读取这个表明特定厂商日志页来清除此事件。

如果控制器支持Sanitize Config特性,则应该支持Sanitize Operation Completed With Unexpected Deallocation异步事件。

Command Completion

如果有异步事件需要报告给主机,就从Admin CQ发送一个CQE。与异步事件请求相关的命令特定状态值定义在Figure 143中。

CQE的Dword 0 包含关于异步事件的信息。CQE的Dword 0的定义在Figure 144 中。

5.2.1 Command Completion

如果有异步事件需要报告给主机,就从Admin CQ发送一个CQE。与异步事件请求相关的命令特定状态值定义在Figure 143中。

CQE的Dword 0 包含关于异步事件的信息。CQE的Dword 0的定义在Figure 144 中。

下边不论是Figure 145,Figure 146,Figure 147,还是Figure 148中的信息,是用于在Asynchronous Event Information字段域中被返回的,具体依赖于异步事件的类型。

Case1:Asynchronous Event Request Command

NVMe 规定了以下Event Type:

  • Error Event
  • SMART/Health Event
  • Notice Events
  • I/O Command Set Specification (NVMe Command Set) Events:
    • Reservation Log Page available Event
  • Vendor Specific Events

测试步骤:

  1. 针对以上每一种Event Type:
    1. Host发送Asynchronous Event Request command
    2. Host创造条件产生该Event;

期望结果:

  • 针对Host 发送的Asynchronous Event Request command,SSD不会立即回复CQ,而是相关Event发生并上报以后才回复CQ;
  • 回复的CQ格式,以及Dword 0中的Event信息描述符合NVMe协议要求;
  • 所有Reserved字段应该填充为0;

Case2: Outstanding Commands Aborted after Reset

测试步骤:

  • Host发送Asynchronous Event Request command;
  • 对SSD进行Controller Level Reset;

期望结果:

  • Controller Level Reset后,SSD回复Admin CQ告知Asynchronous Event Request command被Abort;
  • 所有Reserved字段应该填充为0;

Case3: Clearing Events

测试步骤:

  • 针对每一种Event类型
    • Host创造条件产生该Event;
    • Host发送Get Log Page Command给SSD以清除该Event;
    • Host 发送Asynchronous Event Request command;
    • 2秒后,对SSD进行Controller Level Reset清除outstanding 的Asynchronous Event Request command;

期望结果

  • 针对每一个Get Log Page command,SSD正确回复CQ;
  • 针对Host 发送的Asynchronous Event Request command,SSD不会立即回复CQ,在Controller Level Reset以后SSD回复CQ告知Host该命令被Abort;
  • 所有Reserved字段应该填充为0;

Case4:Masking Events

测试步骤:

  • 针对每一种可以被Disable的Event:
    • Host发送Set Feature Command (Feature ID=0Bh,Asynchronous Event Configuration),禁用该事件;
    • Host发送Asynchronous Event Request command;
    • Host创造条件产生该Event;
    • 2秒后,对SSD进行Controller Level Reset清除outstanding 的Asynchronous Event Request command;

期望结果:

  • SSD正确回复Set Feature Command的CQ;
  • 针对Host 发送的Asynchronous Event Request command,SSD不会立即回复CQ,在Controller Level Reset以后SSD回复CQ告知Host该命令被Abort, 并且在Dword0内不包括该Event的信息;
  • 所有Reserved字段应该填充为0;

(93条消息) NVMe_BGONE的博客-CSDN博客

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值