[nvmewin] PT_IOCTL Data Buffer Length(s) Clarification Request
Mike Berhan
mikeb at bustrace.com
Tue Aug 12 11:22:04 PDT 2014
In reviewing the PT_IOCTL specification, there are three buffer lengths in
the NVME_PASS_THROUGH_IOCTL structure:
Field
Description
DWORD DataBufferLen;
Transfer byte length, including Metadata, starting at DataBuffer
DWORD MetaDataLen;
Set to 0 if not supported or interleaved with data
DWORD ReturnBufferLen;
Returned byte length from device to host, including at least the length of
this structure, and data if any.
Which of these fields are applicable for inbound, outbound, or bidirectional
transfers? Which fields are updated, if any, upon command completion? The
MetaDataLen is not used anywhere in the source code.
The other issue I'm finding is in reporting the actual amount of data
transferred. For example, Intel provided sample source code to query the
IDENTIFY page. In that code, it leaves DataBufferLen and MetaDataLen empty,
and sets the return buffer length as:
pMyIoctl->Direction = NVME_FROM_DEV_TO_HOST;
pMyIoctl->ReturnBufferLen = sizeof(ADMIN_IDENTIFY_CONTROLLER) +
sizeof(NVME_PASS_THROUGH_IOCTL);
The ReturnBufferLen would be more technically accurate if one byte was
subtracted since UCHAR DataBuffer[1] is at the end of the
NVME_PASS_THROUGH_IOCTL structure. Nevertheless, this is a good example as
the ReturnBufferLen is one byte larger than what will actually be
transmitted by the device/miniport. Sizeof(NVME_PASS_THROUGH_IOCTL) is 99h
so adding the size of the IDENTIFY page (1000h) gets you 1099h which is what
is submitted in ReturnBufferLen. I expected the ReturnBufferLen to be set
to 1098h by the miniport driver because of the one byte padding issue noted
above. This would more accurately notify the submitter of how many bytes
were actually transferred. Would this be considered a minor miniport bug or
does the specification not allow for underrun reporting?
Perhaps clarifying the usage of these three buffer lengths on input, and
output, for the various data direction types, would help clear up my
confusion. Thank you in advance.
Mike Berhan
busTRACE Technologies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/nvmewin/attachments/20140812/d63ef1f3/attachment.html>
More information about the nvmewin
mailing list