NVMe DLFEAT
NVMe DLFEAT is an Identify Namespace field describing deallocated read values, Write Zeroes deallocation support and protection-information behavior.
In NVMe 1.4a, DLFEAT is byte 33 of the Identify Namespace data structure, and bits 7:5 are reserved. Read behavior occupies bits 2:0: 0 is unreported, 1 selects zero bytes and 2 selects FFh bytes, while values 3 to 7 are reserved. [2] [1]
Bit 3 indicates support for the Deallocate bit in Write Zeroes and has the same value for all namespaces in the NVM subsystem. Bit 4 set means the Guard field of deallocated blocks with protection information holds the CRC of the returned data and metadata, and clear means the Guard is FFFFh. Testing the whole byte for nonzero confuses these fields. [2] [1]
In Linux v6.16 the NVMe host driver sets its DEAC namespace feature only when the read behavior value is 1 and bit 3 is set, because the Deallocate bit may act as a no-op when deallocated reads do not return zeroes. [4]
Relations
- related
- Deallocated read behavior, NVMe DULBE, Discard, Protection information (PI), NVMe Format NVM, NVMe Write Zeroes
Advantages
- A host can decide from one Identify field whether a deallocating Write Zeroes can stand in for writing zero data. [4]
Limitations
- A field declaration is not evidence that a particular LBA was deallocated or that its physical copies were erased. [2]
- DLFEAT read behavior 000b does not select one fill pattern: under NVMe 1.4a with DULBE disabled, a deallocated block returns all-00h or all-FFh data, consistently until written. [2]
Citations
- libnvme v1.13: namespace feature and DLFEAT field definitions
- NVM Express 1.4a: Figure 247, Figure 282 and section 6.7.1.1
- Linux v6.16 drivers/nvme/host/core.c: DLFEAT check for the DEAC feature
Further reading
Sources & caveats
- nvme-1-4a is the NVM Express 1.4a specification, read in the Identify Namespace rows for bytes 33 to 37 and Figure 247.
- libnvme-fields is libnvme v1.13 src/nvme/types.h, read in the DLFEAT enumeration.
- linux-nvme-core is drivers/nvme/host/core.c at tag v6.16, read where the namespace DEAC feature is set.
- Byte 33, the bit positions, values 0 to 7 and FFFFh come from nvme-1-4a. The 0x7 mask and bit 3 test come from linux-nvme-core.