150d143755
As a result of the API change the memory handling could be simplified. Since the Block session dataspace is now directly used for DMA, we actually only have to provide the memory for setting up PRP lists for large requests (for the moment more than 8 KiB of data). As we limit the maximum data transfer length to 2 MiB, we get by with just a page per request. Those memory is allocated beforehand for the maximum number of I/O requests, which got bumbed to 512 entries. Since not all NVMe controllers support such large a maximum data transfer length and this many entries, especially older ones, the values are capped according to the properties of the controller during initialization. (The memory demands of the component are around 3 MiB due to setting up for the common case, even if a particular controller is only able to make use of less.) (Although there are controllers whose maximum memory page size is more than 4K, the driver is hardcoded to solely use 4K pages.) In addition to those changes, the driver now supports the 'SYNC' and 'TRIM' operations of the Block session by using the NVMe 'FLUSH' and 'WRITE_ZEROS' commands. Fixes #3702. |
||
---|---|---|
.. | ||
main.cc | ||
pci.h | ||
README | ||
target.mk | ||
util.h |
This directory contains the implementation of a NVMe driver component. Brief ===== The driver supports PCIe NVMe devices matching at least revision 1.1 of the NVMe specification. For now it only supports one name space and uses one completion and one submission queue to handle all I/O requests; one request is limited to 1MiB of data. It lacks any name space management functionality. Configuration ============= The following config illustrates how the driver is configured: !<start name="nvme_drv"> ! <resource name="ram" quantum="8M"/> ! <provides><service name="Block"/></provides> ! <config> ! <policy label_prefix="client1" writeable="yes"/> ! </config> !</start> Report ====== The driver supports reporting of active name spaces, which can be enabled via the configuration 'report' sub-node: !<report namespace="yes"/> The report structure is depicted by the following example: !<controller model="QEMU NVMe Ctrl" serial="FNRD"> ! <namespace id="0" block_count="32768" block_size="512"/> !</controller>