管理命令集 - ✅ 一、Get Features – Feature Identifiers 列表(图 194) (第183页)
NVME2.0协议解读 1 min read

管理命令集 - ✅ 一、Get Features – Feature Identifiers 列表(图 194) (第183页)

Blog Author

我们继续深入分析 NVM Express® Base Specification Revision 2.0b 第 172 页内容,讲解 Get Features 命令的 Feature Identifier 一览表(图 194)Select 字段的多种使用模式,以及 命令完成后 Dword 0 的响应内容结构


✅ 一、Get Features – Feature Identifiers 列表(图 194)

这些是标准定义的 Feature Identifier(FID)编号,用于通过 Get Features 命令访问控制器特性,每个 Feature 的格式定义在 Section 5.27.1.x 中:

Feature 名称 Section
Number of Queues(队列数配置) 5.27.1.5
Interrupt Coalescing(中断合并) 5.27.1.6
Interrupt Vector Configuration(中断向量配置) 5.27.1.7
Asynchronous Event Configuration(异步事件配置) 5.27.1.8
Autonomous Power State Transition(自动电源状态切换) 5.27.1.9
Host Memory Buffer(主机内存缓冲区) 5.27.1.10
Timestamp(时间戳) 5.27.1.11
Keep Alive Timer(保活定时器) 5.27.1.12
Host Controlled Thermal Management(主控热管理) 5.27.1.13
Non-Operational Power State Config(非工作电源状态配置) 5.27.1.14
Read Recovery Level Config(读恢复级别配置) 5.27.1.15
Predictable Latency Mode Config(可预测延迟模式配置) 5.27.1.16
Predictable Latency Mode Window(延迟窗口) 5.27.1.17
Host Behavior Support(主机行为支持) 5.27.1.18重要字段
Sanitize Config(清除配置) 5.27.1.19
Endurance Group Event Configuration(寿命组事件配置) 5.27.1.20
I/O Command Set Profile(I/O 命令集配置文件) 5.27.1.21
Spinup Control(电机启动控制) 5.27.1.22
Enhanced Controller Metadata 5.27.1.23.1
Controller Metadata 5.27.1.23.2
Namespace Metadata 5.27.1.23.3
Software Progress Marker(软件进度标记) 5.27.1.24
Host Identifier(主机标识) 5.27.1.25
Reservation Notification Mask(保留通知掩码) 5.27.1.26
Reservation Persistence(保留持久性) 5.27.1.27
Namespace Write Protection Config(命名空间写保护配置) 5.27.1.28
I/O Command Set Specific Features 详见 I/O Command Set 规范

✅ 小贴士:Section 5.27.1.x 是解析 Get FeaturesSet Features 命令返回格式的核心部分。
如果你想查询比如温度阈值(Temperature Threshold),请参考 5.27.1.3;查询主机行为支持特性,则查阅 5.27.1.18。


✅ 二、Select 字段(SEL)使用说明

通过 Command Dword 10SEL 字段,Get Features 可以获取该 Feature 的不同类型的值:

SEL 值 含义 行为
000b 当前值(Current) 控制器当前正在使用的设置值
001b 默认值(Default) 控制器未修改时的出厂默认值
010b 已保存值(Saved) 最近一次 Set FeaturesSave 位为 1 的持久保存值
011b 支持能力(Supported Capabilities) 返回该 Feature 支持的能力范围

⚠️ 若控制器不支持 Saved,则会自动视作 Default 处理。


✅ 三、命令完成后的返回行为

▶️ 如果 SEL != 011b(即不是请求“支持能力”):

  • 控制器将把 Feature 的实际值(Current/Default/Saved)填入 Data Buffer(通过 Data Pointer 传递)
  • 同时可能在 Completion Queue 的 Dword 0 中返回 Feature-dependent 信息,具体见 Section 5.27.1.x 的定义

▶️ 如果 SEL == 011b(即请求“Supported Capabilities”):

  • 控制器不会使用 Data Buffer
  • 所有能力信息直接返回在 Completion Queue 的 Dword 0
  • 结构定义在图 195(Figure 195),你接下来会看到

✅ 总结与学习建议

模块 建议学习点
Feature Identifier 建议整理一张对照表(FID ↔ Section ↔ 功能描述)便于快速查找
SEL 使用方式 理解 Current/Default/Saved/Supported 区别,适合哪类使用场景
Data Pointer 机制 仅在 Feature 返回结构化信息时使用,否则忽略
Dword 0 行为 当 SEL=011b 时,Dword 0 非常关键,需详读 Figure 195
与 Set Features 配套 Get Features 获取的值可能由之前的 Set Features 命令所设定,注意对照使用

如果你希望我帮你整理一份完整的 Feature Identifier 对照表(含编号、描述、字段格式位置)Get/Set Features 交互图(含 SEL 行为差异),我可以立即为你生成图文版辅助学习。需要吗?