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條目的總數包含在命令的參數和內存頁大小當中。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM