컴퓨터/SSD
[NVMe] Feature
mikasaAck
2023. 5. 21. 14:21
728x90
Overview
Feature는 NVMe Spec에 명시된 기능들이다.
Host가 NVMe Feature에 명시된 Attribute들을 설정하고자 할 때, Set Feature Command를 issue 한다.
Host가 NVMe Feature에 명시된 Attribute들을 알고 싶을 때, Get Feature Command를 issue 한다.
이번 포스팅에서는 각각의 feature들을 살펴보고, feature가 의미하는 바를 알아보고자 한다.
feature는 controller 또는 namespase 범위에 적용할 수 있다.
feature는 3가지 setting 값을 갖는다. default, savable, current
- default; 그냥 초기값이고 변경할 수 없다
- savable; POR이나 reset 이후에 해당 값이 current값이 되어야 한다.
- current; 현재 feature 값
Identify – Identify Controller Data Structure
| Bytes | Description |
| 521:520 | Optional NVM Command Support (ONCS): This field indicates the optional NVM commands and features supported by the controller Bit 4 if set to ‘1’, then the controller supports the Save field set to a non-zero value in the Set Features command and the Select field set to a non-zero value in the Get Features command. If cleared to ‘0’, then the controller does not support the Save field set to a non-zero value in the Set Features command and the Select field set to a non-zero value in the Get Features command. feature의 save field를 지원할지 안할지를 Device가 정할 수 있다. |
Set Features
| Feature Id | Uses Memory Buffer for Attributes | Range | Feature Name | Description |
| 01h | N | Arbitration | Command Arbitration | |
| 02h | N | Power Management | Power State 변경 | |
| 03h | Y | Namespace | LBA Range Type | Host가 Device의 LBA Range의 Type을 정해서 쓰고 싶다. 왜??? Host가 LBA 범위를 지정하여 데이터 전송을 최적화하고 성능을 개선하며 불필요한 데이터 이동을 최소화할 수 있다. |
| 04h | N | Controller | Temperature Threshold | Host가 Device의 Temperature Threshold를 정해서, 그 Threshold를 기반으로 어떤 작업을 하고 싶다는 것으로 해석된다. 예를 들어, 온도값이 Host가 정한 Threshold 이상으로 올라가면, 열을 낮추기 위한 시스템을 가동한다든지 over threshold보다 크거나, under threshold 이하인 경우에 critical warning bit를 set한다. 이는 Async Event를 트리거할 수 있다. |
| 05h | N | Error Recovery | DULBE Enable/Disable 설정 command retry timeout 시간 설정 |
|
| 06h | N | Volatile Write Cache | write 명령이 비휘발성 메모리 미디어에 기록되기 전에 임시로 저장하는 SSD 내의 휘발성 캐시 버퍼 사용을 의미한다. 비휘발성 메모리까지 write 하는 것이 오래걸리니까, 임시 버퍼까지만 write하는 것으로 write command를 처리할 수도 있겠지. |
|
| 07h | N | Controller | Number of Queues (IO SQ/CQ) |
Host가 IO SQ/CQ를 각각 몇 개를 생성할 것인가를 Device에게 알려준다. Host는 이에 맞게 Create IO SQ/CQ Command를 issue해야한다. |
| 08h | N | Controller | Interrupt Coalescing | Device가 CQ Entry에 posting을 하고, Host에 알려주고자, Interrupt 방식을 사용할 수 있다. 이 때, posting할 때마다 Interrupt가 발생하면 Host 동작에 부담이 될 수 있다. 그래서, Host가 Device에게 해당 Interrupt를 개별이 아니라, 모아서 전달할 수 있게끔 설정하는 기능으로 이해된다. |
| 09h | N | Controller | Interrupt Vector Configuration | Interrupt Vector마다 Coalescing Enable/Disable 설정 |
| 0Ah | N | Write Atomicity Normal | ||
| 0Bh | N | Asynchronous Event Configuration | host가 async event notification을 받고 싶은 notices들을 설정 | |
| 0Ch | Y | Autonomous Power State Transition (optional) | host가 power state마다 얼마 시간의 idle time이 초과되면, device가 스스로 특정 power state로 천이하도록 설정할 수 있다. | |
| 0Dh | N (Get Feature에서 Y) |
Host Memory Buffer (optional) | Device가 Host Memory Buffer를 활용함으로써, Host와 Device간의 데이터를 더 빠르게 주고 받을 수 있다. | |
| 0Eh | Y | Timestamp (optional) | Host가 Device에게 timestamp를 설정한다. 이는 Host가 자신의 timestamp 기준을 알려주는 것으로 보인다. Device는 시간이 경과함에 따라 timestamp를 업데이트한다. host는 get feature로 device timestamp를 알 수 있다. |
|
| 0Fh | N | Keep Alive Timer | Keep Alive는 Host와 Device간의 통신 연결에 문제가 없는지 확인하기 위한 기능이다. | |
| 10h | N | Host Controlled Thermal Management (optional) | ||
| 11h | N | Non-Operational Power State Config (optional) | Non-Operational Power State에서 일시적으로 이전 상태의 Power State의 Power 한계까지 초과할 수 있다. 해당 기능을 설정. | |
| 12h | N | NVM Set | Read Recovery Level Config | |
| 13h | N | NVM Set | Predictable Latency Mode Config | |
| 14h | N | NVM Set | Predictable Latency Mode Window | |
| 15h | N | Namespace | LBA Status Information Attributes | |
| 16h | Y | Host Behavior Support | Host Behavior를 Controller에 정의하는 Feature이다. 예를 들어, Advanced Command Retry Enable이라는 기능을 Host가 Enable로 설정했다. 그러면, Controller는 command interrupted status code로 CQ posting을 할 수 있다. Host가 해당 CQ를 consume하고, 이렇게 처리된 command를 다시 issue할 것으로 기대된다. | |
| 17h | N | NVM subsystem | Sanitize Config (optional) | |
| 18h | N | Endurance Group Event Configuration (optional) | ||
| 80h | N | Software Progress Marker (optional) | ||
| 81h | Y | Host Identifier (optional; 그러나, Reservation 지원 시, mandatory) | Host가 Controller에서 Host Id를 할당한다. NVMe Device는 Host Id를 식별함으로써, Host 접근을 제어할 수 있다. 언제든지 Host Id를 수정할 수 있고, 이는 logical mapping이다. |
|
| 82h | N | Reservation Notification Mask (optional; 그러나, Reservation 지원 시, mandatory) | ||
| 83h | N | Reservation Persistence (optional; 그러나, Reservation 지원 시, mandatory) | ||
| 84h | N | Namespace Write Protection Config |
TODO
- interrupt; pin based, single MSI, multiple MSI, MSI-X
- interrupt vector와 CQ의 관계
- Atomic Operations
- Async Event Request
- Autonomous Power State Transition
- Keep Alive
- Read Recovery
- Endurance Group
- NVM Set
- LBA Status Information
- Sanitize
- Reservation
- Namespace Write Protection
reference
- nvme spec 1.4
- chat GPT
728x90
반응형