ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

NVME-MI 学习记录_1 框架

2022-02-24 16:05:51  阅读:680  来源: 互联网

标签:框架 request NVMe MI response entry message NVME


1.什么是NVME-MI?
图1 Driver和带外管理的关系nvme management interface(NVME-MI)定义了一套新的完整的NVMe SSD管理方式,并支持以oob带外管理方式,对NVMe设备进行一些基本的管理、设备监控及升级等工作,图1是Driver和带外管理的关系。

2.带内管理和带外管理
out-of-band与in-band,带内管理使用由操作系统控制的硬件资源和组件进行操作的管理,带外管理是使用独立于操作系统控制的资源。
图2 带内 vs 带外
图片中通道1:NVMe 驱动程序根据 NVMe 规范通过 PCIe 与 NVMe 控制器通信,通道2: 两种OOB通信方式, PCIe VDM和SMBus。
(1)带内管理
• 支持多种操作系统(Windows、Linux、VMWare 等)
• 每种操作系统有几种不同发行版
• 为每个操作系统开发、维护、验证管理应用程序的资源成本过高
• 随着时间的推移,会发布新版本的操作系统和 NVMe 驱动程序
• 持续消耗 CPU cycle
• 安全隐患
• 管理功能因操作系统而异
(2)带外管理
• 在一个操作环境中开发管理应用程序,在任何主机操作系统上都一样工作
• 可在没有操作系统的情况下工作(pre-boot, deployment)
• 不需要消耗主机 CPU cycle

3. 带外管理
NVM Express® Management Interface Revision 1.2定义了一种通过MCTP传输协议管理 NVMe 存储设备和 NVMe 机箱的带外机制 。它的协议分层如下图所示。
图3 带外管理协议分层

协议层包括对应每个management controller的NVMe-MI接口,该接口和nvme子系统的management endpoint相协调来执行管理任务;传输层包含MCTP协议,以及与各实体层之间的绑定(PCIe与SMBus/I2C);物理层则是信息传输层接收资料所需的输出输入口。相关的流量控制和异常处理 在MCTP上。
完整的MI命令交互过程:Host(Requester)发送消息为MI报文 -> 封装为MCTP报文 -> 通过I2C/pcie链路发给SSD(Responser) -> 解析为MI报文 -> 回复数据组成MI -> 封装为MCTP报文 -> 通过I2C/pcie链路发给Requester

(1) NVMe-MI Message Types
图4 nvme-mi信息分类
MI报文的交互过程中涉及到主机发送的 request message和 设备回复的 response message,又可以根据发送消息的作用将message近一步进行划分,如图。

command message
(i)nvme-mi command (定义了获取NVMe SSD设备状态命令)
(ii)nvme admin command (用MI协议规范模拟封装NVMe命令)
(iii)pcie command (用MI协议规范模拟封装PCIe报文)

control primitive (控制MI命令执行)

success response(成功返回MI消息,通常带数据返回,每个命令的返回都不一样,见具体命令)
error response(失败返回MI消息,无数据,只有错误类型)

request message的格式:
offset
03:00 : header
04 : opcode
07:05 : reserved
11:08 : nvme management dword0
15:12 : nvme management dword1
N-1:16 : request data(optional)
N+3:N : message integrity check(使用的是CRC-32C算法)
response message的格式:
offset
03:00 : header
04 : status (page46 figure26)
07:05 : nvme management response
N-1:08 : response data(optional)
N+3:N : message integrity check(使用的是CRC-32C算法)

(2)command message —— nvme-mi command
图5 nvme-mi cmd
• Discover Capabilities
• Optimized Health Monitoring/polling
• Initialize & troubleshoot NVMe-MI
• Efficiently manage NVMe at the FRU level
• Sub-system level

(3)command message —— nvme admin command
request 格式:
03:00 : header
04 : opcode
05 : cmd flag
07:06 : controller IO
11:08 : SQ entry dword1
15:12 : SQ entry dword2
19:16 : SQ entry dword3
23:20 : SQ entry dword4
27:24 : SQ entry dword5
31:28 : data offset
35:32 : data length
43:36 : reserved
47:44 : SQ entry dword10
51:48 : SQ entry dword11
55:52 : SQ entry dword12
59:56 : SQ entry dword13
63:60 : SQ entry dword14
67:64 : SQ entry dword15
N-1:68 : request data(optional)
N+3:N : message integrity check
response 格式:
03:00 : header
04 : status
07:05 : reserved
11:08 :CQ entry Dword0
15:12 :CQ entry Dword1
19:16 :CQ entry Dword3
N-1:20 : response data(optional)
N+3:N : message integrity check
图6 nvme admin cmd
• NVMe-MI defines mechanism to send existing NVMe Admin Commands out-of-band
• Admin Commands target a controller in the NVM subsystem

(4)command message —— pcie command
request 格式:
03:00 : header
04 : opcode
05 : reserved
07:06 : controller IO
11:08 : pcie request dword0
15:12 : pcie request dword1
19:16 : pcie request dword2
N-1:20 : request data(optional)
N+3:N : message integrity check
response 格式:
03:00 : header
04 : status
07:05 : reserved
N-1:08 : response data(optional)
N+3:N : message integrity check
图7 PCIE cmd
PCIe Commands provide optional functionality to read and modify PCIe memory

(5) control primitive
request 格式:
03:00 : header
04 : opcode
05 : Tag
07:06 : controller primitive specific parameter
11:08 : message integrity check
response 格式:
03:00 : header
04 : status
05 : Tag
11:08 : message integrity check

图8 控制原语
• Control Primitives enable a Management Controller to utilize flow control and to detect and recover from errors
• Control Primitives fit into a single packet and do not require message assembly

reference
NVM-Express-Management-Interface-1.2
NVMe-MI SDC India.pdf
https://blog.csdn.net/Fuji_Shikamaru/article/details/107287613
https://blog.csdn.net/weixin_44006670/article/details/120008678

标签:框架,request,NVMe,MI,response,entry,message,NVME
来源: https://blog.csdn.net/weixin_40581738/article/details/123097264

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有