4.2 Submission Queue Entry – Command Format
4.2 Submission Queue Entry – Command Format
Each command is 64 bytes in size.
Command Dword 0, Namespace Identifier, Metadata Pointer, PRP Entry 1, PRP Entry 2, SGL Entry 1, and Metadata SGL Segment Pointer have common definitions for all Admin commands and NVM commands. Metadata Pointer, PRP Entry 1, PRP Entry 2, and Metadata SGL Segment Pointer are not used by all commands. Command Dword 0 is defined in Figure 10 .
The 64 byte command format for the Admin Command Set and NVM Command Set is defined in Figure 11. Any additional I/O Command Set defined in the future may use an alternate command size or format.
SGLs shall not be used for Admin commands in NVMe over PCIe.
In addition to the fields commonly defined for all Admin and NVM commands, Admin and NVM Vendor Specific commands may support the Number of Dwords in Data Transfer and Number of Dwords in Metadata Transfer fields. If supported, the command format for the Admin Vendor Specific Command and NVM Vendor Specific Commands are defined in Figure 12. For more details, refer to section 8.7.
4.2 Submission Queue Entry – Command Format
每个命令大小都为64bytes。
对于Admin commands和NVM commands来说,Command Dword 0, Namespace Identifier, Metadata Pointer, PRP Entry 1, PRP Entry 2, SGL Entry 1和Metadata SGL Segment Pointer 都有相同的定义。不是所有命令都会使用Metadata Pointer, PRP Entry 1, PRP Entry 2和Metadata SGL SegmentPointer。Command Dword 0的定义见Figure 10。
Figure 11中定义了用于Admin命令集和NVM命令集的64字节命令格式。将来定义的任何额外的I/O命令集都可以使用另一种命令大小或格式。
SGLs不能用于PCIe上的NVMe中的Admin Commands。
除了定义通用于所有Admin和NVM命令的字段外,Admin和NVM Vendor Specific命令还可能支持Number of Dwords in Data Transfer和Number of Dwords in Metadata Transfer字段。如果受支持,Figure 12中定义了Admin Vendor Specific Command和NVM Vendor Specific Commands的命令格式。有关详细信息,参阅8.7章节。
4.3 Physical Region Page Entry and List
A physical region page (PRP) entry is a pointer to a physical memory page. PRPs are used as a scatter/gather mechanism for data transfers between the controller and memory. To enable efficient out of order data transfers between the controller and the host, PRP entries are a fixed size.
The size of the physical memory page is configured by host software in CC.MPS. Figure 13 shows the layout of a PRP entry that consists of a Page Base Address and an Offset. The size of the Offset field is determined by the physical memory page size configured in CC.MPS.
The definition of a PRP entry is described in Figure 14.
A physical region page list (PRP List) is a set of PRP entries in a single page of contiguous memory. A PRP List describes additional PRP entries that could not be described within the command itself. Any PRP entries described within the command are not duplicated in a PRP List. If the amount of data to transfer requires multiple PRP List memory pages, then the last PRP entry before the end of the memory page shall be a pointer to the next PRP List, indicating the next segment of the PRP List. Figure 15 shows the layout of a PRP List.
Dependent on the command definition, the first PRP entry contained within the command may have a non-zero offset within the memory page. The first PRP List entry (i.e. the first pointer to a memory page containing additional PRP entries) that if present is typically contained in the PRP Entry 2 location within the command, shall be Qword aligned and may also have a non-zero offset within the memory page.
PRP entries contained within a PRP List shall have a memory page offset of 0h. If a second PRP entry is present within a command, it shall have a memory page offset of 0h. In both cases, the entries are memory page aligned based on the value in CC.MPS. If the controller receives a non-zero offset for these PRP entries the controller should return an error of PRP Offset Invalid.
PRP Lists shall be minimally sized with packed entries starting with entry 0. If more PRP List pages are required, then the last entry of the PRP List contains the Page Base Address of the next PRP List page. The next PRP List page shall be memory page aligned. The total number of PRP entries required by a command is implied by the command parameters and memory page size.
4.3 Physical Region Page Entry and List
Physical region page(PRP)条目是指向物理内存页的指针。PRP被用作控制器和内存之间数据传输的分
散/聚集机制(scatter/gather)。为了在控制器和主机之间实现高效的乱序数据传输,PRP条目的大小是固
定的。
物理内存页的大小由主机软件配置,其位于CC.MPS字段。Figure13展示了一个PRP条目的布局,该条目由一个页基地址和一个偏移量组成。偏移量字段的大小由CC.MPS中配置的物理内存页大小决定。
PRP条目的定义如图14所示。
Physical Region Page List(PRP List)是一组连续内存中的单个页的PRP条目。PRP表描述了不能在命令本身中描述的额外PRP条目。命令中描述的任何PRP条目都不会在PRP表中重复。如果要传输的数据需要多个PRP表内存页,那么内存页结束前的最后一个PRP条目应该是指向下一个PRP表的指针,指示PRP表的下一段。 Figure 15展示了PRP表的布局。
根据命令的定义,命令中的第一个PRP条目可能在内存页中具有非零偏移量。命令中的第一个PRP表条目(即指向包含额外PRP条目的内存页的第一个指针)如果通常在命令中的PRP Entry 2位置上,它应该是Qword对齐的,并且可能在内存页中有一个非零的偏移量。
PRP列表中的PRP条目的内存页偏移量应为0h。如果命令中存在第二个PRP条目,则其内存页偏移量也应为0h。在这两种情况下,条目都是基于CC.MPS中的值来对齐内存页面。如果控制器接收到的这些PRP条目具有非零偏移量,则控制器应返回一个PRP Offset Invalid错误。
PRP表的大小应当为最小大小,并从条目0开始打包(pack)条目。如果需要更多的PRP表页,那么PRP表的最后一条包含下一个PRP表页的页基地址(Page Base Address)。下一个PRP表页应该是对齐内存页的。命令所需的PRP条目的总数包含在命令的参数和内存页大小当中。