nvme-mi-dev
nvme-mi-dev provides the jigsaw pieces for modelling NVMe devices that can be inspected via NVMe-MI. Initial integrations expose the NVMe-MI endpoint using mctp-dev.
Integration
As an example by way of implementation, a test setup that was used for mctp-dev creates two namespaces in a subsystem with one controller, one PCIe port, and one two-wire port. One of the namespaces is attached to the controller:
use ;
async
The public APIs are largely concerned with modelling the device. Details of MI message (de)serialisation are left to the implementation, which will respond to queries based on the properties of the provided model.
Building
As the NVMe specifications largely relate to hardware specifications and implementations, the model needs some input to customise it to the vendor. The following environment variables can be used at build time:
NVME_MI_DEV_IEEE_OUI
Must be set in the IEEE RA hexadecimal representation, e.g:
export NVME_MI_DEV_IEEE_OUI=ac-de-48
NVME_MI_DEV_PCI_VIDNVME_MI_DEV_PCI_DIDNVME_MI_DEV_PCI_SVIDNVME_MI_DEV_PCI_SDID
All must be 16-bit values in base-16 representation, e.g:
export NVME_MI_DEV_PCI_VID=ffff
export NVME_MI_DEV_PCI_DID=ffff
export NVME_MI_DEV_PCI_SVID=ffff
export NVME_MI_DEV_PCI_SDID=ffff
The example values above are provided as defaults if the variables are not exported in the environment. However, they are not valid identifiers:
- The
ac-de-48OUI is allocated as private and used in documentation examples - The
ffffPCI ID values represent aborted reads
Builds using these values must not be distributed.