• Guest, The rules for the P & N subforum have been updated to prohibit "ad hominem" or personal attacks against other posters. See the full details in the post "Politics and News Rules & Guidelines."

Question [NVMe] Does MDTS has a role in LBA sizes in NVMe

G_Balaji

Junior Member
Sep 7, 2020
3
0
6
Hi Guys ,
I have a doubt on MDTS value of NVMe.
There are 2 scenarios:
Scenario1: I have formatted my drive to the LBA format of extended LBA i.e 512 bytes of Data size followed by 8 bytes of Metadata. So totally the LBA is 520 bytes. So,if my host tries to write with a block size of 512 bytes then the write is failing which is as expected because of the LBA size mismatch. [ Note: MDTS value for this drive is : 512 ]

Scenario 2: I have another drive which has been again formatted with the extended LBA i.e 512 bytes data size followed by 8bytes of Metadata. So, if my host issues a write with a block size of 512 bytes then this is PASSING [ Note: MDTS value in this drive is 8KB].


I dont understand this.. How does the write succeeded if the host writes with a blocksize of 512 bytes though the device is formatted with 520 bytes ??? Can somebody throw some light on this ??? i am using the "dd" command to write [eg. dd if=/dev/zero of=/dev/nvme2n1 count=1 oflag=direct ]
 
Last edited:

Billy Tallis

Senior member
Aug 4, 2015
247
106
116
From the definition of MDTS:

Maximum Data Transfer Size (MDTS): This field indicates the maximum data transfer size for a command that transfers data between memory accessible by the host (e.g., host memory, Controller Memory Buffer (refer to section 4.7)) and the controller. The host should not submit a command that exceeds this maximum data transfer size. If a command is submitted that exceeds this transfer size, then the command is aborted with a status of Invalid Field in Command. The value is in units of the minimum memory page size (CAP.MPSMIN) and is reported as a power of two (2^n). A value of 0h indicates that there is no maximum data transfer size. This field includes the length of metadata, if metadata is interleaved with the logical block data.
CAP.MPSMIN cannot indicate a page size smaller than 4kB, so you cannot have a MDTS of just 512 bytes. The drive in question may be telling you that its maximum data transfer size is 512 pages (most likely 4kB each), for a MDTS value of 2MB. And the other drive is probably indicating a MDTS of 32MB: 8192 pages rather than 8192 bytes.

So MDTS is very unlikely to have anything to do with your write errors or with LBA formats in general. You might want to look into whether your drives are expecting metadata to be transferred interleaved with regular data, or passed in a separate buffer.
 

ASK THE COMMUNITY