API¶
This part of the documentation lists the full API reference of all public classes and functions.
types.h
NVMe standard definitions
-
NVME_GET¶
NVME_GET (value, name)
extract field from complex value
Parameters
valueThe original value of a complex field
nameThe name of the sub-field within an nvme value
Description
By convention, this library defines _SHIFT and _MASK such that mask can be applied after the shift to isolate a specific set of bits that decode to a sub-field.
Return
The ‘name’ field from ‘value’
-
NVME_SET¶
NVME_SET (value, name)
set field into complex value
Parameters
valueThe value to be set in its completed position
nameThe name of the sub-field within an nvme value
Return
The ‘name’ field from ‘value’
-
enum
nvme_constants¶ A place to stash various constant nvme values
Constants
NVME_NSID_ALLA broadcast value that is used to specify all namespaces
NVME_NSID_NONEThe invalid namespace id, for when the nsid parameter is not used in a command
NVME_UUID_NONEUse to omit a uuid command parameter
NVME_CNTLID_NONEUse to omit a cntlid command parameter
NVME_CNSSPECID_NONEUse to omit a cns_specific_id command parameter
NVME_LOG_LSP_NONEUse to omit a log lsp command parameter
NVME_LOG_LSI_NONEUse to omit a log lsi command parameter
NVME_LOG_LPO_NONEUse to omit a log lpo command parameter
NVME_IDENTIFY_DATA_SIZEThe transfer size for nvme identify commands
NVME_LOG_SUPPORTED_LOG_PAGES_MAXThe largest possible index in the supported log pages log.
NVME_ID_NVMSET_LIST_MAXThe largest possible nvmset index in identify nvmeset
NVME_ID_UUID_LIST_MAXThe largest possible uuid index in identify uuid list
NVME_ID_CTRL_LIST_MAXThe largest possible controller index in identify controller list
NVME_ID_NS_LIST_MAXThe largest possible namespace index in identify namespace list
NVME_ID_SECONDARY_CTRL_MAXThe largest possible secondary controller index in identify secondary controller
NVME_ID_DOMAIN_LIST_MAXThe largest possible domain index in the in domain list
NVME_ID_ENDURANCE_GROUP_LIST_MAXThe largest possible endurance group index in the endurance group list
NVME_ID_ND_DESCRIPTOR_MAXThe largest possible namespace granularity index in the namespace granularity descriptor list
NVME_FEAT_LBA_RANGE_MAXThe largest possible LBA range index in feature lba range type
NVME_LOG_ST_MAX_RESULTSThe largest possible self test result index in the device self test log
NVME_LOG_TELEM_BLOCK_SIZESpecification defined size of Telemetry Data Blocks
NVME_LOG_FID_SUPPORTED_EFFECTS_MAXThe largest possible FID index in the feature identifiers effects log.
NVME_LOG_MI_CMD_SUPPORTED_EFFECTS_MAXThe largest possible MI Command index in the MI Command effects log.
NVME_LOG_MI_CMD_SUPPORTED_EFFECTS_RESERVEDThe reserved space in the MI Command effects log.
NVME_DSM_MAX_RANGESThe largest possible range index in a data-set management command
NVME_NQN_LENGTHMax length for NVMe Qualified Name
NVMF_TRADDR_SIZEMax Transport Address size
NVMF_TSAS_SIZEMax Transport Specific Address Subtype size
NVME_ZNS_CHANGED_ZONES_MAXMax number of zones in the changed zones log page
-
enum
nvme_csi¶ Defined command set indicators
Constants
NVME_CSI_NVMNVM Command Set Indicator
NVME_CSI_KVKey Value Command Set
NVME_CSI_ZNSZoned Namespace Command Set
-
enum
nvme_register_offsets¶ controller registers for all transports. This is the layout of BAR0/1 for PCIe, and properties for fabrics.
Constants
NVME_REG_CAPController Capabilities
NVME_REG_VSVersion
NVME_REG_INTMSInterrupt Mask Set
NVME_REG_INTMCInterrupt Mask Clear
NVME_REG_CCController Configuration
NVME_REG_CSTSController Status
NVME_REG_NSSRNVM Subsystem Reset
NVME_REG_AQAAdmin Queue Attributes
NVME_REG_ASQAdmin SQ Base Address
NVME_REG_ACQAdmin CQ Base Address
NVME_REG_CMBLOCController Memory Buffer Location
NVME_REG_CMBSZController Memory Buffer Size
NVME_REG_BPINFOBoot Partition Information
NVME_REG_BPRSELBoot Partition Read Select
NVME_REG_BPMBLBoot Partition Memory Buffer Location
NVME_REG_CMBMSCController Memory Buffer Memory Space Control
NVME_REG_CMBSTSController Memory Buffer Status
NVME_REG_CRTOController Ready Timeouts
NVME_REG_PMRCAPPersistent Memory Capabilities
NVME_REG_PMRCTLPersistent Memory Region Control
NVME_REG_PMRSTSPersistent Memory Region Status
NVME_REG_PMREBSPersistent Memory Region Elasticity Buffer Size
NVME_REG_PMRSWTPMemory Region Sustained Write Throughput
NVME_REG_PMRMSCLPersistent Memory Region Controller Memory Space Control Lower
NVME_REG_PMRMSCUPersistent Memory Region Controller Memory Space Control Upper
-
bool
nvme_is_64bit_reg(__u32 offset)¶ Checks if offset of the controller register is a know 64bit value.
Parameters
__u32 offsetOffset of controller register field in bytes
Description
This function does not care about transport so that the offset is not going to be checked inside of this function for the unsupported fields in a specific transport. For example, BPMBL(Boot Partition Memory Buffer Location) register is not supported by fabrics, but it can be checked here.
Return
true if given offset is 64bit register, otherwise it returns false.
-
__u64
nvme_cmb_size(__u32 cmbsz)¶ Calculate size of the controller memory buffer
Parameters
__u32 cmbszValue from controller register
NVME_REG_CMBSZ
Return
size of controller memory buffer in bytes
-
__u64
nvme_pmr_size(__u32 pmrebs)¶ Calculate size of persistent memory region elasticity buffer
Parameters
__u32 pmrebsValue from controller register
NVME_REG_PMREBS
Return
size of controller persistent memory buffer in bytes
-
__u64
nvme_pmr_throughput(__u32 pmrswtp)¶ Calculate throughput of persistent memory buffer
Parameters
__u32 pmrswtpValue from controller register
NVME_REG_PMRSWTP
Return
throughput of controller persistent memory buffer in bytes/second
-
enum
nvme_psd_flags¶ Possible flag values in nvme power state descriptor
Constants
NVME_PSD_FLAGS_MXPSIndicates the scale for the Maximum Power field. If this bit is cleared, then the scale of the Maximum Power field is in 0.01 Watts. If this bit is set, then the scale of the Maximum Power field is in 0.0001 Watts.
NVME_PSD_FLAGS_NOPSIndicates whether the controller processes I/O commands in this power state. If this bit is cleared, then the controller processes I/O commands in this power state. If this bit is set, then the controller does not process I/O commands in this power state.
-
enum
nvme_psd_ps¶ Known values for
struct nvme_psdipsandaps. Use with nvme_psd_power_scale() to extract the power scale field to match this enum.
Constants
NVME_PSD_PS_NOT_REPORTEDNot reported
NVME_PSD_PS_100_MICRO_WATT0.0001 watt scale
NVME_PSD_PS_10_MILLI_WATT0.01 watt scale
-
unsigned int
nvme_psd_power_scale(__u8 ps)¶ power scale occupies the upper 3 bits
Parameters
__u8 pspower scale value
Return
power scale value
-
enum
nvme_psd_workload¶ Specifies a workload hint in the Power Management Feature (see
struct nvme_psd.apw) to inform the NVM subsystem or indicate the conditions for the active power level.
Constants
NVME_PSD_WORKLOAD_NPThe workload is unknown or not provided.
NVME_PSD_WORKLOAD_1Extended Idle Period with a Burst of Random Write consists of five minutes of idle followed by thirty-two random write commands of size 1 MiB submitted to a single controller while all other controllers in the NVM subsystem are idle, and then thirty (30) seconds of idle.
NVME_PSD_WORKLOAD_2Heavy Sequential Writes consists of 80,000 sequential write commands of size 128 KiB submitted to a single controller while all other controllers in the NVM subsystem are idle. The submission queue(s) should be sufficiently large allowing the host to ensure there are multiple commands pending at all times during the workload.
-
struct
nvme_id_psd¶ Power Management data structure
Definition
struct nvme_id_psd {
__le16 mp;
__u8 rsvd2;
__u8 flags;
__le32 enlat;
__le32 exlat;
__u8 rrt;
__u8 rrl;
__u8 rwt;
__u8 rwl;
__le16 idlp;
__u8 ips;
__u8 rsvd19;
__le16 actp;
__u8 apws;
__u8 rsvd23[9];
};
Members
mpMaximum Power indicates the sustained maximum power consumed by the NVM subsystem in this power state. The power in Watts is equal to the value in this field multiplied by the scale specified in the Max Power Scale bit (see
enum nvme_psd_flags). A value of 0 indicates Maximum Power is not reported.rsvd2Reserved
flagsAdditional decoding flags, see
enum nvme_psd_flags.enlatEntry Latency indicates the maximum latency in microseconds associated with entering this power state. A value of 0 indicates Entry Latency is not reported.
exlatExit Latency indicates the maximum latency in microseconds associated with exiting this power state. A value of 0 indicates Exit Latency is not reported.
rrtRelative Read Throughput indicates the read throughput rank associated with this power state relative to others. The value in this is less than the number of supported power states.
rrlRelative Read Latency indicates the read latency rank associated with this power state relative to others. The value in this field is less than the number of supported power states.
rwtRelative Write Throughput indicates write throughput rank associated with this power state relative to others. The value in this field is less than the number of supported power states
rwlRelative Write Latency indicates the write latency rank associated with this power state relative to others. The value in this field is less than the number of supported power states
idlpIdle Power indicates the typical power consumed by the NVM subsystem over 30 seconds in this power state when idle.
ipsIdle Power Scale indicates the scale for
struct nvme_id_psd.idlp, seeenum nvme_psd_psfor decoding this field.rsvd19Reserved
actpActive Power indicates the largest average power consumed by the NVM subsystem over a 10 second period in this power state with the workload indicated in the Active Power Workload field.
apwsBits 7-6: Active Power Scale(APS) indicates the scale for the
struct nvme_id_psd.actp, seeenum nvme_psd_psfor decoding this value. Bits 2-0: Active Power Workload(APW) indicates the workload used to calculate maximum power for this power state. Seeenum nvme_psd_workloadfor decoding this field.rsvd23Reserved
-
struct
nvme_id_ctrl¶ Identify Controller data structure
Definition
struct nvme_id_ctrl {
__le16 vid;
__le16 ssvid;
char sn[20];
char mn[40];
char fr[8];
__u8 rab;
__u8 ieee[3];
__u8 cmic;
__u8 mdts;
__le16 cntlid;
__le32 ver;
__le32 rtd3r;
__le32 rtd3e;
__le32 oaes;
__le32 ctratt;
__le16 rrls;
__u8 rsvd102[9];
__u8 cntrltype;
__u8 fguid[16];
__le16 crdt1;
__le16 crdt2;
__le16 crdt3;
__u8 rsvd134[119];
__u8 nvmsr;
__u8 vwci;
__u8 mec;
__le16 oacs;
__u8 acl;
__u8 aerl;
__u8 frmw;
__u8 lpa;
__u8 elpe;
__u8 npss;
__u8 avscc;
__u8 apsta;
__le16 wctemp;
__le16 cctemp;
__le16 mtfa;
__le32 hmpre;
__le32 hmmin;
__u8 tnvmcap[16];
__u8 unvmcap[16];
__le32 rpmbs;
__le16 edstt;
__u8 dsto;
__u8 fwug;
__le16 kas;
__le16 hctma;
__le16 mntmt;
__le16 mxtmt;
__le32 sanicap;
__le32 hmminds;
__le16 hmmaxd;
__le16 nsetidmax;
__le16 endgidmax;
__u8 anatt;
__u8 anacap;
__le32 anagrpmax;
__le32 nanagrpid;
__le32 pels;
__le16 domainid;
__u8 rsvd358[10];
__u8 megcap[16];
__u8 rsvd384[128];
__u8 sqes;
__u8 cqes;
__le16 maxcmd;
__le32 nn;
__le16 oncs;
__le16 fuses;
__u8 fna;
__u8 vwc;
__le16 awun;
__le16 awupf;
__u8 icsvscc;
__u8 nwpc;
__le16 acwu;
__le16 ocfs;
__le32 sgls;
__le32 mnan;
__u8 maxdna[16];
__le32 maxcna;
__le32 oaqd;
__u8 rsvd568[200];
char subnqn[NVME_NQN_LENGTH];
__u8 rsvd1024[768];
__le32 ioccsz;
__le32 iorcsz;
__le16 icdoff;
__u8 fcatt;
__u8 msdbd;
__le16 ofcs;
__u8 dctype;
__u8 rsvd1807[241];
struct nvme_id_psd psd[32];
__u8 vs[1024];
};
Members
vidPCI Vendor ID, the company vendor identifier that is assigned by the PCI SIG.
ssvidPCI Subsystem Vendor ID, the company vendor identifier that is assigned by the PCI SIG for the subsystem.
snSerial Number in ASCII
mnModel Number in ASCII
frFirmware Revision in ASCII, the currently active firmware revision for the NVM subsystem
rabRecommended Arbitration Burst, reported as a power of two
ieeeIEEE assigned Organization Unique Identifier
cmicController Multipath IO and Namespace Sharing Capabilities of the controller and NVM subsystem. See
enum nvme_id_ctrl_cmic.mdtsMax Data Transfer Size is the largest data transfer size. The host should not submit a command that exceeds this maximum data transfer size. The value is in units of the minimum memory page size (CAP.MPSMIN) and is reported as a power of two
cntlidController ID, the NVM subsystem unique controller identifier associated with the controller.
verVersion, this field contains the value reported in the Version register, or property (see
enum nvme_registersNVME_REG_VS).rtd3rRTD3 Resume Latency, the expected latency in microseconds to resume from Runtime D3
rtd3eRTD3 Exit Latency, the typical latency in microseconds to enter Runtime D3.
oaesOptional Async Events Supported, see enum nvme_id_ctrl_oaes.
ctrattController Attributes, see enum nvme_id_ctrl_ctratt.
rrlsRead Recovery Levels. If a bit is set, then the corresponding Read Recovery Level is supported. If a bit is cleared, then the corresponding Read Recovery Level is not supported.
rsvd102Reserved
cntrltypeController Type, see
enum nvme_id_ctrl_cntrltypefguidFRU GUID, a 128-bit value that is globally unique for a given Field Replaceable Unit
crdt1Controller Retry Delay time in 100 millisecond units if CQE CRD field is 1
crdt2Controller Retry Delay time in 100 millisecond units if CQE CRD field is 2
crdt3Controller Retry Delay time in 100 millisecond units if CQE CRD field is 3
rsvd134Reserved
nvmsrNVM Subsystem Report, see
enum nvme_id_ctrl_nvmsrvwciVPD Write Cycle Information, see
enum nvme_id_ctrl_vwcimecManagement Endpoint Capabilities, see
enum nvme_id_ctrl_mecoacsOptional Admin Command Support,the optional Admin commands and features supported by the controller, see
enum nvme_id_ctrl_oacs.aclAbort Command Limit, the maximum number of concurrently executing Abort commands supported by the controller. This is a 0’s based value.
aerlAsync Event Request Limit, the maximum number of concurrently outstanding Asynchronous Event Request commands supported by the controller This is a 0’s based value.
frmwFirmware Updates indicates capabilities regarding firmware updates. See
enum nvme_id_ctrl_frmw.lpaLog Page Attributes, see
enum nvme_id_ctrl_lpa.elpeError Log Page Entries, the maximum number of Error Information log entries that are stored by the controller. This field is a 0’s based value.
npssNumber of Power States Supported, the number of NVM Express power states supported by the controller, indicating the number of valid entries in
struct nvme_id_ctrl.psd. This is a 0’s based value.avsccAdmin Vendor Specific Command Configuration, see
enum nvme_id_ctrl_avscc.apstaAutonomous Power State Transition Attributes, see
enum nvme_id_ctrl_apsta.wctempWarning Composite Temperature Threshold indicates the minimum Composite Temperature field value (see
struct nvme_smart_log.critical_comp_time) that indicates an overheating condition during which controller operation continues.cctempCritical Composite Temperature Threshold, field indicates the minimum Composite Temperature field value (see
struct nvme_smart_log.critical_comp_time) that indicates a critical overheating condition.mtfaMaximum Time for Firmware Activation indicates the maximum time the controller temporarily stops processing commands to activate the firmware image, specified in 100 millisecond units. This field is always valid if the controller supports firmware activation without a reset.
hmpreHost Memory Buffer Preferred Size indicates the preferred size that the host is requested to allocate for the Host Memory Buffer feature in 4 KiB units.
hmminHost Memory Buffer Minimum Size indicates the minimum size that the host is requested to allocate for the Host Memory Buffer feature in 4 KiB units.
tnvmcapTotal NVM Capacity, the total NVM capacity in the NVM subsystem. The value is in bytes.
unvmcapUnallocated NVM Capacity, the unallocated NVM capacity in the NVM subsystem. The value is in bytes.
rpmbsReplay Protected Memory Block Support, see
enum nvme_id_ctrl_rpmbs.edsttExtended Device Self-test Time, if Device Self-test command is supported (see
struct nvme_id_ctrl.oacs,NVME_CTRL_OACS_SELF_TEST), then this field indicates the nominal amount of time in one minute units that the controller takes to complete an extended device self-test operation when in power state 0.dstoDevice Self-test Options, see
enum nvme_id_ctrl_dsto.fwugFirmware Update Granularity indicates the granularity and alignment requirement of the firmware image being updated by the Firmware Image Download command. The value is reported in 4 KiB units. A value of 0h indicates no information on granularity is provided. A value of FFh indicates no restriction
kasKeep Alive Support indicates the granularity of the Keep Alive Timer in 100 millisecond units.
hctmaHost Controlled Thermal Management Attributes, see
enum nvme_id_ctrl_hctm.mntmtMinimum Thermal Management Temperature indicates the minimum temperature, in degrees Kelvin, that the host may request in the Thermal Management Temperature 1 field and Thermal Management Temperature 2 field of a Set Features command with the Feature Identifier field set to
NVME_FEAT_FID_HCTM.mxtmtMaximum Thermal Management Temperature indicates the maximum temperature, in degrees Kelvin, that the host may request in the Thermal Management Temperature 1 field and Thermal Management Temperature 2 field of the Set Features command with the Feature Identifier set to
NVME_FEAT_FID_HCTM.sanicapSanitize Capabilities, see
enum nvme_id_ctrl_sanicaphmmindsHost Memory Buffer Minimum Descriptor Entry Size indicates the minimum usable size of a Host Memory Buffer Descriptor Entry in 4 KiB units.
hmmaxdHost Memory Maximum Descriptors Entries indicates the number of usable Host Memory Buffer Descriptor Entries.
nsetidmaxNVM Set Identifier Maximum, defines the maximum value of a valid NVM Set Identifier for any controller in the NVM subsystem.
endgidmaxEndurance Group Identifier Maximum, defines the maximum value of a valid Endurance Group Identifier for any controller in the NVM subsystem.
anattANA Transition Time indicates the maximum amount of time, in seconds, for a transition between ANA states or the maximum amount of time, in seconds, that the controller reports the ANA change state.
anacapAsymmetric Namespace Access Capabilities, see
enum nvme_id_ctrl_anacap.anagrpmaxANA Group Identifier Maximum indicates the maximum value of a valid ANA Group Identifier for any controller in the NVM subsystem.
nanagrpidNumber of ANA Group Identifiers indicates the number of ANA groups supported by this controller.
pelsPersistent Event Log Size indicates the maximum reportable size for the Persistent Event Log.
domainidDomain Identifier indicates the identifier of the domain that contains this controller.
rsvd358Reserved
megcapMax Endurance Group Capacity indicates the maximum capacity of a single Endurance Group.
rsvd384Reserved
sqesSubmission Queue Entry Size, see
enum nvme_id_ctrl_sqes.cqesCompletion Queue Entry Size, see
enum nvme_id_ctrl_cqes.maxcmdMaximum Outstanding Commands indicates the maximum number of commands that the controller processes at one time for a particular queue.
nnNumber of Namespaces indicates the maximum value of a valid nsid for the NVM subsystem. If the MNAN (
struct nvme_id_ctrl.mnan field is cleared to 0h, then this field also indicates the maximum number of namespaces supported by the NVM subsystem.oncsOptional NVM Command Support, see
enum nvme_id_ctrl_oncs.fusesFused Operation Support, see
enum nvme_id_ctrl_fuses.fnaFormat NVM Attributes, see
enum nvme_id_ctrl_fna.vwcVolatile Write Cache, see
enum nvme_id_ctrl_vwc.awunAtomic Write Unit Normal indicates the size of the write operation guaranteed to be written atomically to the NVM across all namespaces with any supported namespace format during normal operation. This field is specified in logical blocks and is a 0’s based value.
awupfAtomic Write Unit Power Fail indicates the size of the write operation guaranteed to be written atomically to the NVM across all namespaces with any supported namespace format during a power fail or error condition. This field is specified in logical blocks and is a 0’s based value.
icsvsccNVM Vendor Specific Command Configuration, see
enum nvme_id_ctrl_nvscc.nwpcNamespace Write Protection Capabilities, see
enum nvme_id_ctrl_nwpc.acwuAtomic Compare & Write Unit indicates the size of the write operation guaranteed to be written atomically to the NVM across all namespaces with any supported namespace format for a Compare and Write fused operation. This field is specified in logical blocks and is a 0’s based value.
ocfsOptional Copy Formats Supported, each bit n means controller supports Copy Format n.
sglsSGL Support, see
enum nvme_id_ctrl_sglsmnanMaximum Number of Allowed Namespaces indicates the maximum number of namespaces supported by the NVM subsystem.
maxdnaMaximum Domain Namespace Attachments indicates the maximum of the sum of the number of namespaces attached to each I/O controller in the Domain.
maxcnaMaximum I/O Controller Namespace Attachments indicates the maximum number of namespaces that are allowed to be attached to this I/O controller.
oaqdOptimal Aggregated Queue Depth indicates the recommended maximum total number of outstanding I/O commands across all I/O queues on the controller for optimal operation.
rsvd568Reserved
subnqnNVM Subsystem NVMe Qualified Name, UTF-8 null terminated string
rsvd1024Reserved
ioccszI/O Queue Command Capsule Supported Size, defines the maximum I/O command capsule size in 16 byte units.
iorcszI/O Queue Response Capsule Supported Size, defines the maximum I/O response capsule size in 16 byte units.
icdoffIn Capsule Data Offset, defines the offset where data starts within a capsule. This value is applicable to I/O Queues only.
fcattFabrics Controller Attributes, see
enum nvme_id_ctrl_fcatt.msdbdMaximum SGL Data Block Descriptors indicates the maximum number of SGL Data Block or Keyed SGL Data Block descriptors that a host is allowed to place in a capsule. A value of 0h indicates no limit.
ofcsOptional Fabric Commands Support, see
enum nvme_id_ctrl_ofcs.dctypeDiscovery Controller Type (DCTYPE). This field indicates what type of Discovery controller the controller is (see enum nvme_id_ctrl_dctype)
rsvd1807Reserved
psdPower State Descriptors, see
struct nvme_id_psd.vsVendor Specific
-
enum
nvme_id_ctrl_cmic¶ Controller Multipath IO and Namespace Sharing Capabilities of the controller and NVM subsystem.
Constants
NVME_CTRL_CMIC_MULTI_PORTIf set, then the NVM subsystem may contain more than one NVM subsystem port, otherwise the NVM subsystem contains only a single NVM subsystem port.
NVME_CTRL_CMIC_MULTI_CTRLIf set, then the NVM subsystem may contain two or more controllers, otherwise the NVM subsystem contains only a single controller. An NVM subsystem that contains multiple controllers may be used by multiple hosts, or may provide multiple paths for a single host.
NVME_CTRL_CMIC_MULTI_SRIOVIf set, then the controller is associated with an SR-IOV Virtual Function, otherwise it is associated with a PCI Function or a Fabrics connection.
NVME_CTRL_CMIC_MULTI_ANA_REPORTINGIf set, then the NVM subsystem supports Asymmetric Namespace Access Reporting.
-
enum
nvme_id_ctrl_oaes¶ Optional Asynchronous Events Supported
Constants
NVME_CTRL_OAES_NANamespace Attribute Notices event supported
NVME_CTRL_OAES_FAFirmware Activation Notices event supported
NVME_CTRL_OAES_ANAANA Change Notices supported
NVME_CTRL_OAES_PLEAPredictable Latency Event Aggregate Log Change Notices event supported
NVME_CTRL_OAES_LBASLBA Status Information Notices event supported
NVME_CTRL_OAES_EGEEndurance Group Events Aggregate Log Change Notices event supported
NVME_CTRL_OAES_NSNormal NVM Subsystem Shutdown event supported
NVME_CTRL_OAES_ZDZone Descriptor Change Notifications supported
NVME_CTRL_OAES_DLDiscover Log Page Change Notifications supported
-
enum
nvme_id_ctrl_ctratt¶ Controller attributes
Constants
NVME_CTRL_CTRATT_128_ID128-bit Host Identifier supported
NVME_CTRL_CTRATT_NON_OP_PSPNon-Operational Poser State Permissive Mode supported
NVME_CTRL_CTRATT_NVM_SETSNVM Sets supported
NVME_CTRL_CTRATT_READ_RECV_LVLSRead Recovery Levels supported
NVME_CTRL_CTRATT_ENDURANCE_GROUPSEndurance Groups supported
NVME_CTRL_CTRATT_PREDICTABLE_LATPredictable Latency Mode supported
NVME_CTRL_CTRATT_TBKASTraffic Based Keep Alive Support
NVME_CTRL_CTRATT_NAMESPACE_GRANULARITYNamespace Granularity reporting supported
NVME_CTRL_CTRATT_SQ_ASSOCIATIONSSQ Associations supported
NVME_CTRL_CTRATT_UUID_LISTUUID List reporting supported
NVME_CTRL_CTRATT_MDSMulti-Domain Subsystem supported
NVME_CTRL_CTRATT_FIXED_CAPFixed Capacity Management supported
NVME_CTRL_CTRATT_VARIABLE_CAPVariable Capacity Management supported
NVME_CTRL_CTRATT_DEL_ENDURANCE_GROUPSDelete Endurance Groups supported
NVME_CTRL_CTRATT_DEL_NVM_SETSDelete NVM Sets supported
NVME_CTRL_CTRATT_ELBASExtended LBA Formats supported
NVME_CTRL_CTRATT_FDPSFlexible Data Placement supported
-
enum
nvme_id_ctrl_cntrltype¶ Controller types
Constants
NVME_CTRL_CNTRLTYPE_IONVM I/O controller
NVME_CTRL_CNTRLTYPE_DISCOVERYDiscovery controller
NVME_CTRL_CNTRLTYPE_ADMINAdmin controller
-
enum
nvme_id_ctrl_dctype¶ Discovery Controller types
Constants
NVME_CTRL_DCTYPE_NOT_REPORTEDNot reported (I/O, Admin, and pre-TP8010)
NVME_CTRL_DCTYPE_DDCDirect Discovery controller
NVME_CTRL_DCTYPE_CDCCentral Discovery controller
-
enum
nvme_id_ctrl_nvmsr¶ This field reports information associated with the NVM Subsystem, see
struct nvme_id_ctrl.nvmsr.
Constants
NVME_CTRL_NVMSR_NVMESDIf set, then the NVM Subsystem is part of an NVMe Storage Device; if cleared, then the NVM Subsystem is not part of an NVMe Storage Device.
NVME_CTRL_NVMSR_NVMEEIf set’, then the NVM Subsystem is part of an NVMe Enclosure; if cleared, then the NVM Subsystem is not part of an NVMe Enclosure.
-
enum
nvme_id_ctrl_vwci¶ This field indicates information about remaining number of times that VPD contents are able to be updated using the VPD Write command, see
struct nvme_id_ctrl.vwci.
Constants
NVME_CTRL_VWCI_VWCRMask to get value of VPD Write Cycles Remaining. If the VPD Write Cycle Remaining Valid bit is set, then this field contains a value indicating the remaining number of times that VPD contents are able to be updated using the VPD Write command. If this field is set to 7Fh, then the remaining number of times that VPD contents are able to be updated using the VPD Write command is greater than or equal to 7Fh.
NVME_CTRL_VWCI_VWCRVVPD Write Cycle Remaining Valid. If this bit is set, then the VPD Write Cycle Remaining field is valid. If this bit is cleared, then the VPD Write Cycles Remaining field is invalid and cleared to 0h.
-
enum
nvme_id_ctrl_mec¶ Flags indicating the capabilities of the Management Endpoint in the Controller,
struct nvme_id_ctrl.mec.
Constants
NVME_CTRL_MEC_SMBUSMEIf set, then the NVM Subsystem contains a Management Endpoint on an SMBus/I2C port.
NVME_CTRL_MEC_PCIEMEIf set, then the NVM Subsystem contains a Management Endpoint on a PCIe port.
-
enum
nvme_id_ctrl_oacs¶ Flags indicating the optional Admin commands and features supported by the controller, see
struct nvme_id_ctrl.oacs.
Constants
NVME_CTRL_OACS_SECURITYIf set, then the controller supports the Security Send and Security Receive commands.
NVME_CTRL_OACS_FORMATIf set then the controller supports the Format NVM command.
NVME_CTRL_OACS_FWIf set, then the controller supports the Firmware Commit and Firmware Image Download commands.
NVME_CTRL_OACS_NS_MGMTIf set, then the controller supports the Namespace Management capability
NVME_CTRL_OACS_SELF_TESTIf set, then the controller supports the Device Self-test command.
NVME_CTRL_OACS_DIRECTIVESIf set, then the controller supports Directives and the Directive Send and Directive Receive commands.
NVME_CTRL_OACS_NVME_MIIf set, then the controller supports the NVMe-MI Send and NVMe-MI Receive commands.
NVME_CTRL_OACS_VIRT_MGMTIf set, then the controller supports the Virtualization Management command.
NVME_CTRL_OACS_DBBUF_CFGIf set, then the controller supports the Doorbell Buffer Config command.
NVME_CTRL_OACS_LBA_STATUSIf set, then the controller supports the Get LBA Status capability.
NVME_CTRL_OACS_CMD_FEAT_LDIf set, then the controller supports the command and feature lockdown capability.
-
enum
nvme_id_ctrl_frmw¶ Flags and values indicates capabilities regarding firmware updates from
struct nvme_id_ctrl.frmw.
Constants
NVME_CTRL_FRMW_1ST_ROIf set, the first firmware slot is readonly
NVME_CTRL_FRMW_NR_SLOTSMask to get the value of the number of firmware slots that the controller supports.
NVME_CTRL_FRMW_FW_ACT_NO_RESETIf set, the controller supports firmware activation without a reset.
NVME_CTRL_FRMW_MP_UP_DETECTIONIf set, the controller is able to detect overlapping firmware/boot partition image update.
-
enum
nvme_id_ctrl_lpa¶ Flags indicating optional attributes for log pages that are accessed via the Get Log Page command.
Constants
NVME_CTRL_LPA_SMART_PER_NSIf set, controller supports SMART/Health log page on a per namespace basis.
NVME_CTRL_LPA_CMD_EFFECTSIf Set, the controller supports the commands supported and effects log page.
NVME_CTRL_LPA_EXTENDEDIf set, the controller supports extended data for log page command including extended number of dwords and log page offset fields.
NVME_CTRL_LPA_TELEMETRYIf set, the controller supports the telemetry host-initiated and telemetry controller-initiated log pages and sending telemetry log notices.
NVME_CTRL_LPA_PERSETENT_EVENTIf set, the controller supports persistent event log.
NVME_CTRL_LPA_LI0_LI5_LI12_LI13If set, the controller supports - log pages log page. - returning scope of each command in
commands supported and effects log page.
feature identifiers supported and effects log page.
NVMe-MI commands supported and effects log page.
NVME_CTRL_LPA_DA4_TELEMETRYIf set, the controller supports data area 4 for telemetry host-initiated and telemetry.
-
enum
nvme_id_ctrl_avscc¶ Flags indicating the configuration settings for Admin Vendor Specific command handling.
Constants
NVME_CTRL_AVSCC_AVSIf set, all Admin Vendor Specific Commands use the optional vendor specific command format with NDT and NDM fields.
-
enum
nvme_id_ctrl_apsta¶ Flags indicating the attributes of the autonomous power state transition feature.
Constants
NVME_CTRL_APSTA_APSTIf set, then the controller supports autonomous power state transitions.
-
enum
nvme_id_ctrl_rpmbs¶ This field indicates if the controller supports one or more Replay Protected Memory Blocks, from
struct nvme_id_ctrl.rpmbs.
Constants
NVME_CTRL_RPMBS_NR_UNITSMask to get the value of the Number of RPMB Units
NVME_CTRL_RPMBS_AUTH_METHODMask to get the value of the Authentication Method
NVME_CTRL_RPMBS_TOTAL_SIZEMask to get the value of Total Size
NVME_CTRL_RPMBS_ACCESS_SIZEMask to get the value of Access Size
-
enum
nvme_id_ctrl_dsto¶ Flags indicating the optional Device Self-test command or operation behaviors supported by the controller or NVM subsystem.
Constants
NVME_CTRL_DSTO_ONE_DSTIf set, then the NVM subsystem supports only one device self-test operation in progress at a time.
-
enum
nvme_id_ctrl_hctm¶ Flags indicate the attributes of the host controlled thermal management feature
Constants
NVME_CTRL_HCTMA_HCTMthen the controller supports host controlled thermal management, and the Set Features command and Get Features command with the Feature Identifier field set to
NVME_FEAT_FID_HCTM.
-
enum
nvme_id_ctrl_sanicap¶ Indicates attributes for sanitize operations.
Constants
NVME_CTRL_SANICAP_CESCrypto Erase Support. If set, then the controller supports the Crypto Erase sanitize operation.
NVME_CTRL_SANICAP_BESBlock Erase Support. If set, then the controller supports the Block Erase sanitize operation.
NVME_CTRL_SANICAP_OWSOverwrite Support. If set, then the controller supports the Overwrite sanitize operation.
NVME_CTRL_SANICAP_NDINo-Deallocate Inhibited. If set and the No- Deallocate Response Mode bit is set, then the controller deallocates after the sanitize operation even if the No-Deallocate After Sanitize bit is set in a Sanitize command.
NVME_CTRL_SANICAP_NODMMASNo-Deallocate Modifies Media After Sanitize, mask to extract value.
-
enum
nvme_id_ctrl_anacap¶ This field indicates the capabilities associated with Asymmetric Namespace Access Reporting.
Constants
NVME_CTRL_ANACAP_OPTIf set, then the controller is able to report ANA Optimized state.
NVME_CTRL_ANACAP_NON_OPTIf set, then the controller is able to report ANA Non-Optimized state.
NVME_CTRL_ANACAP_INACCESSIBLEIf set, then the controller is able to report ANA Inaccessible state.
NVME_CTRL_ANACAP_PERSISTENT_LOSSIf set, then the controller is able to report ANA Persistent Loss state.
NVME_CTRL_ANACAP_CHANGEIf set, then the controller is able to report ANA Change state.
NVME_CTRL_ANACAP_GRPID_NO_CHGIf set, then the ANAGRPID field in the Identify Namespace data structure (
struct nvme_id_ns.anagrpid), does not change while the namespace is attached to any controller.NVME_CTRL_ANACAP_GRPID_MGMTIf set, then the controller supports a non-zero value in the ANAGRPID field of the Namespace Management command.
-
enum
nvme_id_ctrl_sqes¶ Defines the required and maximum Submission Queue entry size when using the NVM Command Set.
Constants
NVME_CTRL_SQES_MINMask to get the value of the required Submission Queue Entry size when using the NVM Command Set.
NVME_CTRL_SQES_MAXMask to get the value of the maximum Submission Queue entry size when using the NVM Command Set.
-
enum
nvme_id_ctrl_cqes¶ Defines the required and maximum Completion Queue entry size when using the NVM Command Set.
Constants
NVME_CTRL_CQES_MINMask to get the value of the required Completion Queue Entry size when using the NVM Command Set.
NVME_CTRL_CQES_MAXMask to get the value of the maximum Completion Queue entry size when using the NVM Command Set.
-
enum
nvme_id_ctrl_oncs¶ This field indicates the optional NVM commands and features supported by the controller.
Constants
NVME_CTRL_ONCS_COMPAREIf set, then the controller supports the Compare command.
NVME_CTRL_ONCS_WRITE_UNCORRECTABLEIf set, then the controller supports the Write Uncorrectable command.
NVME_CTRL_ONCS_DSMIf set, then the controller supports the Dataset Management command.
NVME_CTRL_ONCS_WRITE_ZEROESIf set, then the controller supports the Write Zeroes command.
NVME_CTRL_ONCS_SAVE_FEATURESIf set, then the controller supports the Save field set to a non-zero value in the Set Features command and the Select field set to a non-zero value in the Get Features command.
NVME_CTRL_ONCS_RESERVATIONSIf set, then the controller supports reservations.
NVME_CTRL_ONCS_TIMESTAMPIf set, then the controller supports the Timestamp feature.
NVME_CTRL_ONCS_VERIFYIf set, then the controller supports the Verify command.
NVME_CTRL_ONCS_COPYIf set, then the controller supports the copy command.
-
enum
nvme_id_ctrl_fuses¶ This field indicates the fused operations that the controller supports.
Constants
NVME_CTRL_FUSES_COMPARE_AND_WRITEIf set, then the controller supports the Compare and Write fused operation.
-
enum
nvme_id_ctrl_fna¶ This field indicates attributes for the Format NVM command.
Constants
NVME_CTRL_FNA_FMT_ALL_NAMESPACESIf set, then all namespaces in an NVM subsystem shall be configured with the same attributes and a format (excluding secure erase) of any namespace results in a format of all namespaces in an NVM subsystem. If cleared, then the controller supports format on a per namespace basis.
NVME_CTRL_FNA_SEC_ALL_NAMESPACESIf set, then any secure erase performed as part of a format operation results in a secure erase of all namespaces in the NVM subsystem. If cleared, then any secure erase performed as part of a format results in a secure erase of the particular namespace specified.
NVME_CTRL_FNA_CRYPTO_ERASEIf set, then cryptographic erase is supported. If cleared, then cryptographic erase is not supported.
NVME_CTRL_FNA_NSID_FFFFFFFFIf set, then format does not support nsid value set to FFFFFFFFh. If cleared, format supports nsid value set to FFFFFFFFh.
-
enum
nvme_id_ctrl_vwc¶ Volatile write cache
Constants
NVME_CTRL_VWC_PRESENTIf set, indicates a volatile write cache is present. If a volatile write cache is present, then the host controls whether the volatile write cache is enabled with a Set Features command specifying the value
NVME_FEAT_FID_VOLATILE_WC.NVME_CTRL_VWC_FLUSHMask to get the value of the flush command behavior.
-
enum
nvme_id_ctrl_nvscc¶ This field indicates the configuration settings for NVM Vendor Specific command handling.
Constants
NVME_CTRL_NVSCC_FMTIf set, all NVM Vendor Specific Commands use the format with NDT and NDM fields.
-
enum
nvme_id_ctrl_nwpc¶ This field indicates the optional namespace write protection capabilities supported by the controller.
Constants
NVME_CTRL_NWPC_WRITE_PROTECTIf set, then the controller shall support the No Write Protect and Write Protect namespace write protection states and may support the Write Protect Until Power Cycle state and Permanent Write Protect namespace write protection states.
NVME_CTRL_NWPC_WRITE_PROTECT_POWER_CYCLEIf set, then the controller supports the Write Protect Until Power Cycle state.
NVME_CTRL_NWPC_WRITE_PROTECT_PERMANENTIf set, then the controller supports the Permanent Write Protect state.
-
enum
nvme_id_ctrl_sgls¶ This field indicates if SGLs are supported for the NVM Command Set and the particular SGL types supported.
Constants
NVME_CTRL_SGLS_SUPPORTED
NVME_CTRL_SGLS_KEYED
NVME_CTRL_SGLS_BIT_BUCKET
NVME_CTRL_SGLS_MPTR_BYTE_ALIGNED
NVME_CTRL_SGLS_OVERSIZE
NVME_CTRL_SGLS_MPTR_SGL
NVME_CTRL_SGLS_OFFSET
NVME_CTRL_SGLS_TPORT
-
enum
nvme_id_ctrl_fcatt¶ This field indicates attributes of the controller that are specific to NVMe over Fabrics.
Constants
NVME_CTRL_FCATT_DYNAMICIf cleared, then the NVM subsystem uses a dynamic controller model. If set, then the NVM subsystem uses a static controller model.
-
enum
nvme_id_ctrl_ofcs¶ Indicate whether the controller supports optional fabric commands.
Constants
NVME_CTRL_OFCS_DISCONNECTIf set, then the controller supports the Disconnect command and deletion of individual I/O Queues.
-
struct
nvme_lbaf¶ LBA Format Data Structure
Definition
struct nvme_lbaf {
__le16 ms;
__u8 ds;
__u8 rp;
};
Members
msMetadata Size indicates the number of metadata bytes provided per LBA based on the LBA Data Size indicated.
dsLBA Data Size indicates the LBA data size supported, reported as a power of two.
rpRelative Performance, see
enum nvme_lbaf_rp.
-
enum
nvme_lbaf_rp¶ This field indicates the relative performance of the LBA format indicated relative to other LBA formats supported by the controller.
Constants
NVME_LBAF_RP_BESTBest performance
NVME_LBAF_RP_BETTERBetter performance
NVME_LBAF_RP_GOODGood performance
NVME_LBAF_RP_DEGRADEDDegraded performance
NVME_LBAF_RP_MASKMask to get the relative performance value from the field
-
struct
nvme_id_ns¶ Identify Namespace data structure
Definition
struct nvme_id_ns {
__le64 nsze;
__le64 ncap;
__le64 nuse;
__u8 nsfeat;
__u8 nlbaf;
__u8 flbas;
__u8 mc;
__u8 dpc;
__u8 dps;
__u8 nmic;
__u8 rescap;
__u8 fpi;
__u8 dlfeat;
__le16 nawun;
__le16 nawupf;
__le16 nacwu;
__le16 nabsn;
__le16 nabo;
__le16 nabspf;
__le16 noiob;
__u8 nvmcap[16];
__le16 npwg;
__le16 npwa;
__le16 npdg;
__le16 npda;
__le16 nows;
__le16 mssrl;
__le32 mcl;
__u8 msrc;
__u8 rsvd81;
__u8 nulbaf;
__u8 rsvd83[9];
__le32 anagrpid;
__u8 rsvd96[3];
__u8 nsattr;
__le16 nvmsetid;
__le16 endgid;
__u8 nguid[16];
__u8 eui64[8];
struct nvme_lbaf lbaf[64];
__le64 lbstm;
__u8 vs[3704];
};
Members
nszeNamespace Size indicates the total size of the namespace in logical blocks. The number of logical blocks is based on the formatted LBA size.
ncapNamespace Capacity indicates the maximum number of logical blocks that may be allocated in the namespace at any point in time. The number of logical blocks is based on the formatted LBA size.
nuseNamespace Utilization indicates the current number of logical blocks allocated in the namespace. This field is smaller than or equal to the Namespace Capacity. The number of logical blocks is based on the formatted LBA size.
nsfeatNamespace Features, see
enum nvme_id_nsfeat.nlbafNumber of LBA Formats defines the number of supported LBA data size and metadata size combinations supported by the namespace and the highest possible index to
struct nvme_id_ns.lbaf.flbasFormatted LBA Size, see
enum nvme_id_ns_flbas.mcMetadata Capabilities, see
enum nvme_id_ns_mc.dpcEnd-to-end Data Protection Capabilities, see
enum nvme_id_ns_dpc.dpsEnd-to-end Data Protection Type Settings, see
enum nvme_id_ns_dps.nmicNamespace Multi-path I/O and Namespace Sharing Capabilities, see
enum nvme_id_ns_nmic.rescapReservation Capabilities, see
enum nvme_id_ns_rescap.fpiFormat Progress Indicator, see
enum nvme_nd_ns_fpi.dlfeatDeallocate Logical Block Features, see
enum nvme_id_ns_dlfeat.nawunNamespace Atomic Write Unit Normal indicates the namespace specific size of the write operation guaranteed to be written atomically to the NVM during normal operation.
nawupfNamespace Atomic Write Unit Power Fail indicates the namespace specific size of the write operation guaranteed to be written atomically to the NVM during a power fail or error condition.
nacwuNamespace Atomic Compare & Write Unit indicates the namespace specific size of the write operation guaranteed to be written atomically to the NVM for a Compare and Write fused command.
nabsnNamespace Atomic Boundary Size Normal indicates the atomic boundary size for this namespace for the NAWUN value. This field is specified in logical blocks.
naboNamespace Atomic Boundary Offset indicates the LBA on this namespace where the first atomic boundary starts.
nabspfNamespace Atomic Boundary Size Power Fail indicates the atomic boundary size for this namespace specific to the Namespace Atomic Write Unit Power Fail value. This field is specified in logical blocks.
noiobNamespace Optimal I/O Boundary indicates the optimal I/O boundary for this namespace. This field is specified in logical blocks. The host should construct Read and Write commands that do not cross the I/O boundary to achieve optimal performance.
nvmcapNVM Capacity indicates the total size of the NVM allocated to this namespace. The value is in bytes.
npwgNamespace Preferred Write Granularity indicates the smallest recommended write granularity in logical blocks for this namespace. This is a 0’s based value.
npwaNamespace Preferred Write Alignment indicates the recommended write alignment in logical blocks for this namespace. This is a 0’s based value.
npdgNamespace Preferred Deallocate Granularity indicates the recommended granularity in logical blocks for the Dataset Management command with the Attribute - Deallocate bit.
npdaNamespace Preferred Deallocate Alignment indicates the recommended alignment in logical blocks for the Dataset Management command with the Attribute - Deallocate bit
nowsNamespace Optimal Write Size indicates the size in logical blocks for optimal write performance for this namespace. This is a 0’s based value.
mssrlMaximum Single Source Range Length indicates the maximum number of logical blocks that may be specified in each valid Source Range field of a Copy command.
mclMaximum Copy Length indicates the maximum number of logical blocks that may be specified in a Copy command.
msrcMaximum Source Range Count indicates the maximum number of Source Range entries that may be used to specify source data in a Copy command. This is a 0’s based value.
rsvd81Reserved
nulbafNumber of Unique Capability LBA Formats defines the number of supported user data size and metadata size combinations supported by the namespace that may not share the same capabilities. LBA formats shall be allocated in order and packed sequentially.
rsvd83Reserved
anagrpidANA Group Identifier indicates the ANA Group Identifier of the ANA group of which the namespace is a member.
rsvd96Reserved
nsattrNamespace Attributes, see
enum nvme_id_ns_attr.nvmsetidNVM Set Identifier indicates the NVM Set with which this namespace is associated.
endgidEndurance Group Identifier indicates the Endurance Group with which this namespace is associated.
nguidNamespace Globally Unique Identifier contains a 128-bit value that is globally unique and assigned to the namespace when the namespace is created. This field remains fixed throughout the life of the namespace and is preserved across namespace and controller operations
eui64IEEE Extended Unique Identifier contains a 64-bit IEEE Extended Unique Identifier (EUI-64) that is globally unique and assigned to the namespace when the namespace is created. This field remains fixed throughout the life of the namespace and is preserved across namespace and controller operations
lbafLBA Format, see
struct nvme_lbaf.lbstmLogical Block Storage Tag Mask for end-to-end protection
vsVendor Specific
-
enum
nvme_id_nsfeat¶ This field defines features of the namespace.
Constants
NVME_NS_FEAT_THINIf set, indicates that the namespace supports thin provisioning. Specifically, the Namespace Capacity reported may be less than the Namespace Size.
NVME_NS_FEAT_NATOMICIf set, indicates that the fields NAWUN, NAWUPF, and NACWU are defined for this namespace and should be used by the host for this namespace instead of the AWUN, AWUPF, and ACWU fields in the Identify Controller data structure.
NVME_NS_FEAT_DULBEIf set, indicates that the controller supports the Deallocated or Unwritten Logical Block error for this namespace.
NVME_NS_FEAT_ID_REUSEIf set, indicates that the value in the NGUID field for this namespace, if non- zero, is never reused by the controller and that the value in the EUI64 field for this namespace, if non-zero, is never reused by the controller.
NVME_NS_FEAT_IO_OPTIf set, indicates that the fields NPWG, NPWA, NPDG, NPDA, and NOWS are defined for this namespace and should be used by the host for I/O optimization
-
enum
nvme_id_ns_flbas¶ This field indicates the LBA data size & metadata size combination that the namespace has been formatted with
Constants
NVME_NS_FLBAS_LOWER_MASKMask to get the index of one of the supported LBA Formats’s least significant 4bits indicated in
struct nvme_id_ns.lbaf.NVME_NS_FLBAS_META_EXTApplicable only if format contains metadata. If this bit is set, indicates that the metadata is transferred at the end of the data LBA, creating an extended data LBA. If cleared, indicates that all of the metadata for a command is transferred as a separate contiguous buffer of data.
NVME_NS_FLBAS_HIGHER_MASKMask to get the index of one of the supported LBA Formats’s most significant 2bits indicated in
struct nvme_id_ns.lbaf.
-
enum
nvme_nvm_id_ns_elbaf¶ This field indicates the extended LBA format
Constants
NVME_NVM_ELBAF_STS_MASKMask to get the storage tag size used to determine the variable-sized storage tag/reference tag fields
NVME_NVM_ELBAF_PIF_MASKMask to get the protection information format for the extended LBA format.
-
enum
nvme_id_ns_mc¶ This field indicates the capabilities for metadata.
Constants
NVME_NS_MC_EXTENDEDIf set, indicates the namespace supports the metadata being transferred as part of a separate buffer that is specified in the Metadata Pointer.
NVME_NS_MC_SEPARATEIf set, indicates that the namespace supports the metadata being transferred as part of an extended data LBA.
-
enum
nvme_id_ns_dpc¶ This field indicates the capabilities for the end-to-end data protection feature.
Constants
NVME_NS_DPC_PI_TYPE1If set, indicates that the namespace supports Protection Information Type 1.
NVME_NS_DPC_PI_TYPE2If set, indicates that the namespace supports Protection Information Type 2.
NVME_NS_DPC_PI_TYPE3If set, indicates that the namespace supports Protection Information Type 3.
NVME_NS_DPC_PI_FIRSTIf set, indicates that the namespace supports protection information transferred as the first eight bytes of metadata.
NVME_NS_DPC_PI_LASTIf set, indicates that the namespace supports protection information transferred as the last eight bytes of metadata.
-
enum
nvme_id_ns_dps¶ This field indicates the Type settings for the end-to-end data protection feature.
Constants
NVME_NS_DPS_PI_NONEProtection information is not enabled
NVME_NS_DPS_PI_TYPE1Protection information is enabled, Type 1
NVME_NS_DPS_PI_TYPE2Protection information is enabled, Type 2
NVME_NS_DPS_PI_TYPE3Protection information is enabled, Type 3
NVME_NS_DPS_PI_MASKMask to get the value of the PI type
NVME_NS_DPS_PI_FIRSTIf set, indicates that the protection information, if enabled, is transferred as the first eight bytes of metadata.
-
enum
nvme_id_ns_nmic¶ This field specifies multi-path I/O and namespace sharing capabilities of the namespace.
Constants
NVME_NS_NMIC_SHAREDIf set, then the namespace may be attached to two or more controllers in the NVM subsystem concurrently
-
enum
nvme_id_ns_rescap¶ This field indicates the reservation capabilities of the namespace.
Constants
NVME_NS_RESCAP_PTPLIf set, indicates that the namespace supports the Persist Through Power Loss capability.
NVME_NS_RESCAP_WEIf set, indicates that the namespace supports the Write Exclusive reservation type.
NVME_NS_RESCAP_EAIf set, indicates that the namespace supports the Exclusive Access reservation type.
NVME_NS_RESCAP_WEROIf set, indicates that the namespace supports the Write Exclusive - Registrants Only reservation type.
NVME_NS_RESCAP_EAROIf set, indicates that the namespace supports the Exclusive Access - Registrants Only reservation type.
NVME_NS_RESCAP_WEARIf set, indicates that the namespace supports the Write Exclusive - All Registrants reservation type.
NVME_NS_RESCAP_EAARIf set, indicates that the namespace supports the Exclusive Access - All Registrants reservation type.
NVME_NS_RESCAP_IEK_13If set, indicates that Ignore Existing Key is used as defined in revision 1.3 or later of this specification.
-
enum
nvme_nd_ns_fpi¶ If a format operation is in progress, this field indicates the percentage of the namespace that remains to be formatted.
Constants
NVME_NS_FPI_REMAININGMask to get the format percent remaining value
NVME_NS_FPI_SUPPORTEDIf set, indicates that the namespace supports the Format Progress Indicator defined for the field.
-
enum
nvme_id_ns_dlfeat¶ This field indicates information about features that affect deallocating logical blocks for this namespace.
Constants
NVME_NS_DLFEAT_RBMask to get the value of the read behavior
NVME_NS_DLFEAT_RB_NRRead behvaior is not reported
NVME_NS_DLFEAT_RB_ALL_0SA deallocated logical block returns all bytes cleared to 0h.
NVME_NS_DLFEAT_RB_ALL_FSA deallocated logical block returns all bytes set to FFh.
NVME_NS_DLFEAT_WRITE_ZEROESIf set, indicates that the controller supports the Deallocate bit in the Write Zeroes command for this namespace.
NVME_NS_DLFEAT_CRC_GUARDIf set, indicates that the Guard field for deallocated logical blocks that contain protection information is set to the CRC for the value read from the deallocated logical block and its metadata
-
enum
nvme_id_ns_attr¶ Specifies attributes of the namespace.
Constants
NVME_NS_NSATTR_WRITE_PROTECTEDIf set, then the namespace is currently write protected and all write access to the namespace shall fail.
-
struct
nvme_ns_id_desc¶ Namespace identifier type descriptor
Definition
struct nvme_ns_id_desc {
__u8 nidt;
__u8 nidl;
__le16 rsvd;
__u8 nid[];
};
Members
nidtNamespace Identifier Type, see
enum nvme_ns_id_desc_nidtnidlNamespace Identifier Length contains the length in bytes of the
struct nvme_id_ns.nid.rsvdReserved
nidNamespace Identifier contains a value that is globally unique and assigned to the namespace when the namespace is created. The length is defined in
struct nvme_id_ns.nidl.
-
enum
nvme_ns_id_desc_nidt¶ Known namespace identifier types
Constants
NVME_NIDT_EUI64IEEE Extended Unique Identifier, the NID field contains a copy of the EUI64 field in the struct nvme_id_ns.eui64.
NVME_NIDT_NGUIDNamespace Globally Unique Identifier, the NID field contains a copy of the NGUID field in struct nvme_id_ns.nguid.
NVME_NIDT_UUIDThe NID field contains a 128-bit Universally Unique Identifier (UUID) as specified in RFC 4122.
NVME_NIDT_CSIThe NID field contains the command set identifier.
-
struct
nvme_nvmset_attr¶ NVM Set Attributes Entry
Definition
struct nvme_nvmset_attr {
__le16 nvmsetid;
__le16 endgid;
__u8 rsvd4[4];
__le32 rr4kt;
__le32 ows;
__u8 tnvmsetcap[16];
__u8 unvmsetcap[16];
__u8 rsvd48[80];
};
Members
nvmsetidNVM Set Identifier
endgidEndurance Group Identifier
rsvd4Reserved
rr4ktRandom 4 KiB Read Typical indicates the typical time to complete a 4 KiB random read in 100 nanosecond units when the NVM Set is in a Predictable Latency Mode Deterministic Window and there is 1 outstanding command per NVM Set.
owsOptimal Write Size
tnvmsetcapTotal NVM Set Capacity
unvmsetcapUnallocated NVM Set Capacity
rsvd48Reserved
-
struct
nvme_id_nvmset_list¶ NVM set list
Definition
struct nvme_id_nvmset_list {
__u8 nid;
__u8 rsvd1[127];
struct nvme_nvmset_attr ent[NVME_ID_NVMSET_LIST_MAX];
};
Members
nidNvmset id
rsvd1Reserved
entnvmset id list
-
struct
nvme_id_independent_id_ns¶ Identify - I/O Command Set Independent Identify Namespace Data Structure
Definition
struct nvme_id_independent_id_ns {
__u8 nsfeat;
__u8 nmic;
__u8 rescap;
__u8 fpi;
__le32 anagrpid;
__u8 nsattr;
__u8 rsvd9;
__le16 nvmsetid;
__le16 endgid;
__u8 nstat;
__u8 rsvd15[4081];
};
Members
nsfeatcommon namespace features
nmicNamespace Multi-path I/O and Namespace Sharing Capabilities
rescapReservation Capabilities
fpiFormat Progress Indicator
anagrpidANA Group Identifier
nsattrNamespace Attributes
rsvd9reserved
nvmsetidNVM Set Identifier
endgidEndurance Group Identifier
nstatNamespace Status
rsvd15reserved
-
struct
nvme_id_ns_granularity_desc¶ Namespace Granularity Descriptor
Definition
struct nvme_id_ns_granularity_desc {
__le64 nszegran;
__le64 ncapgran;
};
Members
nszegranNamespace Size Granularity
ncapgranNamespace Capacity Granularity
-
struct
nvme_id_ns_granularity_list¶ Namespace Granularity List
Definition
struct nvme_id_ns_granularity_list {
__le32 attributes;
__u8 num_descriptors;
__u8 rsvd5[27];
struct nvme_id_ns_granularity_desc entry[NVME_ID_ND_DESCRIPTOR_MAX];
__u8 rsvd288[3808];
};
Members
attributesNamespace Granularity Attributes
num_descriptorsNumber of Descriptors
rsvd5reserved
entryNamespace Granularity Descriptor
rsvd288reserved
-
struct
nvme_id_uuid_list_entry¶ UUID List Entry
Definition
struct nvme_id_uuid_list_entry {
__u8 header;
__u8 rsvd1[15];
__u8 uuid[16];
};
Members
headerUUID Lists Entry Header
rsvd1reserved
uuid128-bit Universally Unique Identifier
-
enum
nvme_id_uuid¶ Identifier Association
Constants
NVME_ID_UUID_HDR_ASSOCIATION_MASK
NVME_ID_UUID_ASSOCIATION_NONE
NVME_ID_UUID_ASSOCIATION_VENDOR
NVME_ID_UUID_ASSOCIATION_SUBSYSTEM_VENDOR
-
struct
nvme_id_uuid_list¶ UUID list
Definition
struct nvme_id_uuid_list {
__u8 rsvd0[32];
struct nvme_id_uuid_list_entry entry[NVME_ID_UUID_LIST_MAX];
};
Members
rsvd0reserved
entryUUID list entry
-
struct
nvme_ctrl_list¶ Controller List
Definition
struct nvme_ctrl_list {
__le16 num;
__le16 identifier[NVME_ID_CTRL_LIST_MAX];
};
Members
numNumber of Identifiers
identifierNVM subsystem unique controller identifier
-
struct
nvme_ns_list¶ Namespace List
Definition
struct nvme_ns_list {
__le32 ns[NVME_ID_NS_LIST_MAX];
};
Members
nsNamespace Identifier
-
struct
nvme_id_ctrl_nvm¶ I/O Command Set Specific Identify Controller data structure
Definition
struct nvme_id_ctrl_nvm {
__u8 vsl;
__u8 wzsl;
__u8 wusl;
__u8 dmrl;
__le32 dmrsl;
__le64 dmsl;
__u8 rsvd16[4080];
};
Members
vslVerify Size Limit
wzslWrite Zeroes Size Limit
wuslWrite Uncorrectable Size Limit
dmrlDataset Management Ranges Limit
dmrslDataset Management Range Size Limit
dmslDataset Management Size Limit
rsvd16reserved
-
struct
nvme_nvm_id_ns¶ NVME Command Set I/O Command Set Specific Identify Namespace Data Structure
Definition
struct nvme_nvm_id_ns {
__le64 lbstm;
__u8 pic;
__u8 rsvd9[3];
__le32 elbaf[64];
__u8 rsvd268[3828];
};
Members
lbstmLogical Block Storage Tag Mask
picProtection Information Capabilities
rsvd9Reserved
elbafList of Extended LBA Format Support
rsvd268Reserved
-
struct
nvme_zns_lbafe¶ LBA Format Extension Data Structure
Definition
struct nvme_zns_lbafe {
__le64 zsze;
__u8 zdes;
__u8 rsvd9[7];
};
Members
zszeZone Size
zdesZone Descriptor Extension Size
rsvd9reserved
-
struct
nvme_zns_id_ns¶ Zoned Namespace Command Set Specific Identify Namespace Data Structure
Definition
struct nvme_zns_id_ns {
__le16 zoc;
__le16 ozcs;
__le32 mar;
__le32 mor;
__le32 rrl;
__le32 frl;
__le32 rrl1;
__le32 rrl2;
__le32 rrl3;
__le32 frl1;
__le32 frl2;
__le32 frl3;
__le32 numzrwa;
__le16 zrwafg;
__le16 zrwasz;
__u8 zrwacap;
__u8 rsvd53[2763];
struct nvme_zns_lbafe lbafe[64];
__u8 vs[256];
};
Members
zocZone Operation Characteristics
ozcsOptional Zoned Command Support
marMaximum Active Resources
morMaximum Open Resources
rrlReset Recommended Limit
frlFinish Recommended Limit
rrl1Reset Recommended Limit 1
rrl2Reset Recommended Limit 2
rrl3Reset Recommended Limit 3
frl1Finish Recommended Limit 1
frl2Finish Recommended Limit 2
frl3Finish Recommended Limit 3
numzrwaNumber of ZRWA Resources
zrwafgZRWA Flush Granularity
zrwaszZRWA Size
zrwacapZRWA Capability
rsvd53Reserved
lbafeLBA Format Extension
vsVendor Specific
-
struct
nvme_zns_id_ctrl¶ I/O Command Set Specific Identify Controller Data Structure for the Zoned Namespace Command Set
Definition
struct nvme_zns_id_ctrl {
__u8 zasl;
__u8 rsvd1[4095];
};
Members
zaslZone Append Size Limit
rsvd1Reserved
-
struct
nvme_primary_ctrl_cap¶ Identify - Controller Capabilities Structure
Definition
struct nvme_primary_ctrl_cap {
__le16 cntlid;
__le16 portid;
__u8 crt;
__u8 rsvd5[27];
__le32 vqfrt;
__le32 vqrfa;
__le16 vqrfap;
__le16 vqprt;
__le16 vqfrsm;
__le16 vqgran;
__u8 rsvd48[16];
__le32 vifrt;
__le32 virfa;
__le16 virfap;
__le16 viprt;
__le16 vifrsm;
__le16 vigran;
__u8 rsvd80[4016];
};
Members
cntlidController Identifier
portidPort Identifier
crtController Resource Types
rsvd5reserved
vqfrtVQ Resources Flexible Total
vqrfaVQ Resources Flexible Assigned
vqrfapVQ Resources Flexible Allocated to Primary
vqprtVQ Resources Private Total
vqfrsmVQ Resources Flexible Secondary Maximum
vqgranVQ Flexible Resource Preferred Granularity
rsvd48reserved
vifrtVI Resources Flexible Total
virfaVI Resources Flexible Assigned
virfapVI Resources Flexible Allocated to Primary
viprtVI Resources Private Total
vifrsmVI Resources Flexible Secondary Maximum
vigranVI Flexible Resource Preferred Granularity
rsvd80reserved
-
struct
nvme_secondary_ctrl¶ Secondary Controller Entry
Definition
struct nvme_secondary_ctrl {
__le16 scid;
__le16 pcid;
__u8 scs;
__u8 rsvd5[3];
__le16 vfn;
__le16 nvq;
__le16 nvi;
__u8 rsvd14[18];
};
Members
scidSecondary Controller Identifier
pcidPrimary Controller Identifier
scsSecondary Controller State
rsvd5Reserved
vfnVirtual Function Number
nvqNumber of VQ Flexible Resources Assigned
nviNumber of VI Flexible Resources Assigned
rsvd14Reserved
-
struct
nvme_secondary_ctrl_list¶ Secondary Controller List
Definition
struct nvme_secondary_ctrl_list {
__u8 num;
__u8 rsvd[31];
struct nvme_secondary_ctrl sc_entry[NVME_ID_SECONDARY_CTRL_MAX];
};
Members
numNumber of Identifiers
rsvdReserved
sc_entrySecondary Controller Entry
-
struct
nvme_id_iocs¶ NVMe Identify IO Command Set data structure
Definition
struct nvme_id_iocs {
__le64 iocsc[512];
};
Members
iocscList of supported IO Command Set Combination vectors
-
struct
nvme_id_domain_attr¶ Domain Attributes Entry
Definition
struct nvme_id_domain_attr {
__le16 dom_id;
__u8 rsvd2[14];
__u8 dom_cap[16];
__u8 unalloc_dom_cap[16];
__u8 max_egrp_dom_cap[16];
__u8 rsvd64[64];
};
Members
dom_idDomain Identifier
rsvd2Reserved
dom_capTotal Domain Capacity
unalloc_dom_capUnallocated Domain Capacity
max_egrp_dom_capMax Endurance Group Domain Capacity
rsvd64Reserved
-
struct
nvme_id_domain_list¶ Domain List
Definition
struct nvme_id_domain_list {
__u8 num;
__u8 rsvd[127];
struct nvme_id_domain_attr domain_attr[NVME_ID_DOMAIN_LIST_MAX];
};
Members
numNumber of domain attributes
rsvdReserved
domain_attrList of domain attributes
-
struct
nvme_id_endurance_group_list¶ Endurance Group List
Definition
struct nvme_id_endurance_group_list {
__le16 num;
__le16 identifier[NVME_ID_ENDURANCE_GROUP_LIST_MAX];
};
Members
numNumber of Identifiers
identifierEndurance Group Identifier
-
struct
nvme_supported_log_pages¶ Supported Log Pages - Log
Definition
struct nvme_supported_log_pages {
__le32 lid_support[NVME_LOG_SUPPORTED_LOG_PAGES_MAX];
};
Members
lid_supportLog Page Identifier Supported
Description
Supported Log Pages (Log Identifier 00h)
-
struct
nvme_error_log_page¶ Error Information Log Entry (Log Identifier 01h)
Definition
struct nvme_error_log_page {
__le64 error_count;
__le16 sqid;
__le16 cmdid;
__le16 status_field;
__le16 parm_error_location;
__le64 lba;
__le32 nsid;
__u8 vs;
__u8 trtype;
__u8 csi;
__u8 opcode;
__le64 cs;
__le16 trtype_spec_info;
__u8 rsvd[21];
__u8 log_page_version;
};
Members
error_countError Count: a 64-bit incrementing error count, indicating a unique identifier for this error. The error count starts at
1h, is incremented for each unique error log entry, and is retained across power off conditions. A value of0hindicates an invalid entry; this value is used when there are lost entries or when there are fewer errors than the maximum number of entries the controller supports. If the value of this field isFFFFFFFFh, then the field shall be set to 1h when incremented (i.e., rolls over to1h). Prior to NVMe 1.4, processing of incrementing beyondFFFFFFFFhis unspecified.sqidSubmission Queue ID: indicates the Submission Queue Identifier of the command that the error information is associated with. If the error is not specific to a particular command, then this field shall be set to
FFFFh.cmdidCommand ID: indicates the Command Identifier of the command that the error is associated with. If the error is not specific to a particular command, then this field shall be set to
FFFFh.status_fieldBits 15-1: Status Field: indicates the Status Field for the command that completed. If the error is not specific to a particular command, then this field reports the most applicable status value. Bit 0: Phase Tag: may indicate the Phase Tag posted for the command.
parm_error_locationParameter Error Location: indicates the byte and bit of the command parameter that the error is associated with, if applicable. If the parameter spans multiple bytes or bits, then the location indicates the first byte and bit of the parameter. Bits 10-8: Bit in command that contained the error. Valid values are 0 to 7. Bits 7-0: Byte in command that contained the error. Valid values are 0 to 63.
lbaLBA: This field indicates the first LBA that experienced the error condition, if applicable.
nsidNamespace: This field indicates the NSID of the namespace that the error is associated with, if applicable.
vsVendor Specific Information Available: If there is additional vendor specific error information available, this field provides the log page identifier associated with that page. A value of
0hindicates that no additional information is available. Valid values are in the range of80htoFFh.trtypeTransport Type (TRTYPE): indicates the Transport Type of the transport associated with the error. The values in this field are the same as the TRTYPE values in the Discovery Log Page Entry. If the error is not transport related, this field shall be cleared to
0h. If the error is transport related, this field shall be set to the type of the transport - seeenum nvme_trtype.csiCommand Set Indicator: This field contains command set indicator for the command that the error is associated with.
opcodeOpcode: This field contains opcode for the command that the error is associated with.
csCommand Specific Information: This field contains command specific information. If used, the command definition specifies the information returned.
trtype_spec_infoTransport Type Specific Information
rsvdReserved: [62:42]
log_page_versionThis field shall be set to 1h. If set, csi and opcode will have valid values.
-
struct
nvme_smart_log¶ SMART / Health Information Log (Log Identifier 02h)
Definition
struct nvme_smart_log {
__u8 critical_warning;
__u8 temperature[2];
__u8 avail_spare;
__u8 spare_thresh;
__u8 percent_used;
__u8 endu_grp_crit_warn_sumry;
__u8 rsvd7[25];
__u8 data_units_read[16];
__u8 data_units_written[16];
__u8 host_reads[16];
__u8 host_writes[16];
__u8 ctrl_busy_time[16];
__u8 power_cycles[16];
__u8 power_on_hours[16];
__u8 unsafe_shutdowns[16];
__u8 media_errors[16];
__u8 num_err_log_entries[16];
__le32 warning_temp_time;
__le32 critical_comp_time;
__le16 temp_sensor[8];
__le32 thm_temp1_trans_count;
__le32 thm_temp2_trans_count;
__le32 thm_temp1_total_time;
__le32 thm_temp2_total_time;
__u8 rsvd232[280];
};
Members
critical_warningThis field indicates critical warnings for the state of the controller. Critical warnings may result in an asynchronous event notification to the host. Bits in this field represent the current associated state and are not persistent (see
enum nvme_smart_crit).temperatureComposite Temperature: Contains a value corresponding to a temperature in Kelvins that represents the current composite temperature of the controller and namespace(s) associated with that controller. The manner in which this value is computed is implementation specific and may not represent the actual temperature of any physical point in the NVM subsystem. Warning and critical overheating composite temperature threshold values are reported by the WCTEMP and CCTEMP fields in the Identify Controller data structure.
avail_spareAvailable Spare: Contains a normalized percentage (0% to 100%) of the remaining spare capacity available.
spare_threshAvailable Spare Threshold: When the Available Spare falls below the threshold indicated in this field, an asynchronous event completion may occur. The value is indicated as a normalized percentage (0% to 100%). The values 101 to 255 are reserved.
percent_usedPercentage Used: Contains a vendor specific estimate of the percentage of NVM subsystem life used based on the actual usage and the manufacturer’s prediction of NVM life. A value of 100 indicates that the estimated endurance of the NVM in the NVM subsystem has been consumed, but may not indicate an NVM subsystem failure. The value is allowed to exceed 100. Percentages greater than 254 shall be represented as 255. This value shall be updated once per power-on hour (when the controller is not in a sleep state).
endu_grp_crit_warn_sumryEndurance Group Critical Warning Summary: This field indicates critical warnings for the state of Endurance Groups. Bits in this field represent the current associated state and are not persistent (see
enum nvme_smart_egcw).rsvd7Reserved
data_units_readData Units Read: Contains the number of 512 byte data units the host has read from the controller; this value does not include metadata. This value is reported in thousands (i.e., a value of 1 corresponds to 1000 units of 512 bytes read) and is rounded up (e.g., one indicates the that number of 512 byte data units read is from 1 to 1000, three indicates that the number of 512 byte data units read is from 2001 to 3000). When the LBA size is a value other than 512 bytes, the controller shall convert the amount of data read to 512 byte units. For the NVM command set, logical blocks read as part of Compare, Read, and Verify operations shall be included in this value. A value of
0hin this field indicates that the number of Data Units Read is not reported.data_units_writtenData Units Written: Contains the number of 512 byte data units the host has written to the controller; this value does not include metadata. This value is reported in thousands (i.e., a value of 1 corresponds to 1000 units of 512 bytes written) and is rounded up (e.g., one indicates that the number of 512 byte data units written is from 1 to 1,000, three indicates that the number of 512 byte data units written is from 2001 to 3000). When the LBA size is a value other than 512 bytes, the controller shall convert the amount of data written to 512 byte units. For the NVM command set, logical blocks written as part of Write operations shall be included in this value. Write Uncorrectable commands and Write Zeroes commands shall not impact this value. A value of
0hin this field indicates that the number of Data Units Written is not reported.host_readsHost Read Commands: Contains the number of read commands completed by the controller. For the NVM command set, this value is the sum of the number of Compare commands and the number of Read commands.
host_writesHost Write Commands: Contains the number of write commands completed by the controller. For the NVM command set, this is the number of Write commands.
ctrl_busy_timeController Busy Time: Contains the amount of time the controller is busy with I/O commands. The controller is busy when there is a command outstanding to an I/O Queue (specifically, a command was issued via an I/O Submission Queue Tail doorbell write and the corresponding completion queue entry has not been posted yet to the associated I/O Completion Queue). This value is reported in minutes.
power_cyclesPower Cycles: Contains the number of power cycles.
power_on_hoursPower On Hours: Contains the number of power-on hours. This may not include time that the controller was powered and in a non-operational power state.
unsafe_shutdownsUnsafe Shutdowns: Contains the number of unsafe shutdowns. This count is incremented when a Shutdown Notification (CC.SHN) is not received prior to loss of power.
media_errorsMedia and Data Integrity Errors: Contains the number of occurrences where the controller detected an unrecovered data integrity error. Errors such as uncorrectable ECC, CRC checksum failure, or LBA tag mismatch are included in this field. Errors introduced as a result of a Write Uncorrectable command may or may not be included in this field.
num_err_log_entriesNumber of Error Information Log Entries: Contains the number of Error Information log entries over the life of the controller.
warning_temp_timeWarning Composite Temperature Time: Contains the amount of time in minutes that the controller is operational and the Composite Temperature is greater than or equal to the Warning Composite Temperature Threshold (WCTEMP) field and less than the Critical Composite Temperature Threshold (CCTEMP) field in the Identify Controller data structure. If the value of the WCTEMP or CCTEMP field is
0h, then this field is always cleared to0hregardless of the Composite Temperature value.critical_comp_timeCritical Composite Temperature Time: Contains the amount of time in minutes that the controller is operational and the Composite Temperature is greater than or equal to the Critical Composite Temperature Threshold (CCTEMP) field in the Identify Controller data structure. If the value of the CCTEMP field is
0h, then this field is always cleared to 0h regardless of the Composite Temperature value.temp_sensorTemperature Sensor 1-8: Contains the current temperature in degrees Kelvin reported by temperature sensors 1-8. The physical point in the NVM subsystem whose temperature is reported by the temperature sensor and the temperature accuracy is implementation specific. An implementation that does not implement the temperature sensor reports a value of
0h.thm_temp1_trans_countThermal Management Temperature 1 Transition Count: Contains the number of times the controller transitioned to lower power active power states or performed vendor specific thermal management actions while minimizing the impact on performance in order to attempt to reduce the Composite Temperature because of the host controlled thermal management feature (i.e., the Composite Temperature rose above the Thermal Management Temperature 1). This counter shall not wrap once the value
FFFFFFFFhis reached. A value of0h, indicates that this transition has never occurred or this field is not implemented.thm_temp2_trans_countThermal Management Temperature 2 Transition Count
thm_temp1_total_timeTotal Time For Thermal Management Temperature 1: Contains the number of seconds that the controller had transitioned to lower power active power states or performed vendor specific thermal management actions while minimizing the impact on performance in order to attempt to reduce the Composite Temperature because of the host controlled thermal management feature. This counter shall not wrap once the value
FFFFFFFFhis reached. A value of0h, indicates that this transition has never occurred or this field is not implemented.thm_temp2_total_timeTotal Time For Thermal Management Temperature 2
rsvd232Reserved
-
enum
nvme_smart_crit¶ Critical Warning
Constants
NVME_SMART_CRIT_SPAREIf set, then the available spare capacity has fallen below the threshold.
NVME_SMART_CRIT_TEMPERATUREIf set, then a temperature is either greater than or equal to an over temperature threshold; or less than or equal to an under temperature threshold.
NVME_SMART_CRIT_DEGRADEDIf set, then the NVM subsystem reliability has been degraded due to significant media related errors or any internal error that degrades NVM subsystem reliability.
NVME_SMART_CRIT_MEDIAIf set, then all of the media has been placed in read only mode. The controller shall not set this bit if the read-only condition on the media is a result of a change in the write protection state of a namespace.
NVME_SMART_CRIT_VOLATILE_MEMORYIf set, then the volatile memory backup device has failed. This field is only valid if the controller has a volatile memory backup solution.
NVME_SMART_CRIT_PMR_ROIf set, then the Persistent Memory Region has become read-only or unreliable.
-
enum
nvme_smart_egcw¶ Endurance Group Critical Warning Summary
Constants
NVME_SMART_EGCW_SPAREIf set, then the available spare capacity of one or more Endurance Groups has fallen below the threshold.
NVME_SMART_EGCW_DEGRADEDIf set, then the reliability of one or more Endurance Groups has been degraded due to significant media related errors or any internal error that degrades NVM subsystem reliability.
NVME_SMART_EGCW_ROIf set, then the namespaces in one or more Endurance Groups have been placed in read only mode not as a result of a change in the write protection state of a namespace.
-
struct
nvme_firmware_slot¶ Firmware Slot Information Log
Definition
struct nvme_firmware_slot {
__u8 afi;
__u8 rsvd1[7];
char frs[7][8];
__u8 rsvd2[448];
};
Members
afiActive Firmware Info
rsvd1Reserved
frsFirmware Revision for Slot
rsvd2Reserved
-
struct
nvme_cmd_effects_log¶ Commands Supported and Effects Log
Definition
struct nvme_cmd_effects_log {
__le32 acs[256];
__le32 iocs[256];
__u8 rsvd[2048];
};
Members
acsAdmin Command Supported
iocsI/O Command Supported
rsvdReserved
-
enum
nvme_cmd_effects¶ Commands Supported and Effects
Constants
NVME_CMD_EFFECTS_CSUPPCommand Supported
NVME_CMD_EFFECTS_LBCCLogical Block Content Change
NVME_CMD_EFFECTS_NCCNamespace Capability Change
NVME_CMD_EFFECTS_NICNamespace Inventory Change
NVME_CMD_EFFECTS_CCCController Capability Change
NVME_CMD_EFFECTS_CSE_MASKCommand Submission and Execution
NVME_CMD_EFFECTS_UUID_SELUUID Selection Supported
-
struct
nvme_st_result¶ Self-test Result
Definition
struct nvme_st_result {
__u8 dsts;
__u8 seg;
__u8 vdi;
__u8 rsvd;
__le64 poh;
__le32 nsid;
__le64 flba;
__u8 sct;
__u8 sc;
__u8 vs[2];
};
Members
dstsDevice Self-test Status: Indicates the device self-test code and the status of the operation (see
enum nvme_status_resultandenum nvme_st_code).segSegment Number: Iindicates the segment number where the first self-test failure occurred. If Device Self-test Status (dsts) is not set to #NVME_ST_RESULT_KNOWN_SEG_FAIL, then this field should be ignored.
vdiValid Diagnostic Information: Indicates the diagnostic failure information that is reported. See
enum nvme_st_valid_diag_info.rsvdReserved
pohPower On Hours (POH): Indicates the number of power-on hours at the time the device self-test operation was completed or aborted. This does not include time that the controller was powered and in a low power state condition.
nsidNamespace Identifier (NSID): Indicates the namespace that the Failing LBA occurred on. Valid only when the NSID Valid bit (#NVME_ST_VALID_DIAG_INFO_NSID) is set in the Valid Diagnostic Information (vdi) field.
flbaFailing LBA: indicates the LBA of the logical block that caused the test to fail. If the device encountered more than one failed logical block during the test, then this field only indicates one of those failed logical blocks. Valid only when the NSID Valid bit (#NVME_ST_VALID_DIAG_INFO_FLBA) is set in the Valid Diagnostic Information (vdi) field.
sctStatus Code Type: This field may contain additional information related to errors or conditions. Bits 2:0 may contain additional information relating to errors or conditions that occurred during the device self-test operation represented in the same format used in the Status Code Type field of the completion queue entry (refer to
enum nvme_status_field). Valid only when the NSID Valid bit (#NVME_ST_VALID_DIAG_INFO_SCT) is set in the Valid Diagnostic Information (vdi) field.scStatus Code: This field may contain additional information relating to errors or conditions that occurred during the device self-test operation represented in the same format used in the Status Code field of the completion queue entry. Valid only when the SCT Valid bit (#NVME_ST_VALID_DIAG_INFO_SC) is set in the Valid Diagnostic Information (vdi) field.
vsVendor Specific.
-
enum
nvme_status_result¶ Result of the device self-test operation
Constants
NVME_ST_RESULT_NO_ERROperation completed without error.
NVME_ST_RESULT_ABORTEDOperation was aborted by a Device Self-test command.
NVME_ST_RESULT_CLROperation was aborted by a Controller Level Reset.
NVME_ST_RESULT_NS_REMOVEDOperation was aborted due to a removal of a namespace from the namespace inventory.
NVME_ST_RESULT_ABORTED_FORMATOperation was aborted due to the processing of a Format NVM command.
NVME_ST_RESULT_FATAL_ERRA fatal error or unknown test error occurred while the controller was executing the device self-test operation and the operation did not complete.
NVME_ST_RESULT_UNKNOWN_SEG_FAILOperation completed with a segment that failed and the segment that failed is not known.
NVME_ST_RESULT_KNOWN_SEG_FAILOperation completed with one or more failed segments and the first segment that failed is indicated in the Segment Number field.
NVME_ST_RESULT_ABORTED_UNKNOWNOperation was aborted for unknown reason.
NVME_ST_RESULT_ABORTED_SANITIZEOperation was aborted due to a sanitize operation.
NVME_ST_RESULT_NOT_USEDEntry not used (does not contain a test result).
NVME_ST_RESULT_MASKMask to get the status result value from the
struct nvme_st_result.dsts field.
-
enum
nvme_st_code¶ Self-test Code value
Constants
NVME_ST_CODE_RESERVEDReserved.
NVME_ST_CODE_SHORTShort device self-test operation.
NVME_ST_CODE_EXTENDEDExtended device self-test operation.
NVME_ST_CODE_VSVendor specific.
NVME_ST_CODE_ABORTAbort device self-test operation.
NVME_ST_CODE_SHIFTShift amount to get the code value from the
struct nvme_st_result.dsts field.
-
enum
nvme_st_curr_op¶ Current Device Self-Test Operation
Constants
NVME_ST_CURR_OP_NOT_RUNNINGNo device self-test operation in progress.
NVME_ST_CURR_OP_SHORTShort device self-test operation in progress.
NVME_ST_CURR_OP_EXTENDEDExtended device self-test operation in progress.
NVME_ST_CURR_OP_VSVendor specific.
NVME_ST_CURR_OP_RESERVEDReserved.
NVME_ST_CURR_OP_MASKMask to get the current operation value from the
struct nvme_self_test_log.current_operation field.NVME_ST_CURR_OP_CMPL_MASKMask to get the current operation completion value from the
struct nvme_self_test_log.completion field.
-
enum
nvme_st_valid_diag_info¶ Valid Diagnostic Information
Constants
NVME_ST_VALID_DIAG_INFO_NSIDNSID Valid: if set, then the contents of the Namespace Identifier field are valid.
NVME_ST_VALID_DIAG_INFO_FLBAFLBA Valid: if set, then the contents of the Failing LBA field are valid.
NVME_ST_VALID_DIAG_INFO_SCTSCT Valid: if set, then the contents of the Status Code Type field are valid.
NVME_ST_VALID_DIAG_INFO_SCSC Valid: if set, then the contents of the Status Code field are valid.
-
struct
nvme_self_test_log¶ Device Self-test (Log Identifier 06h)
Definition
struct nvme_self_test_log {
__u8 current_operation;
__u8 completion;
__u8 rsvd[2];
struct nvme_st_result result[NVME_LOG_ST_MAX_RESULTS];
};
Members
current_operationCurrent Device Self-Test Operation: indicates the status of the current device self-test operation. If a device self-test operation is in process (i.e., this field is set to #NVME_ST_CURR_OP_SHORT or #NVME_ST_CURR_OP_EXTENDED), then the controller shall not set this field to #NVME_ST_CURR_OP_NOT_RUNNING until a new Self-test Result Data Structure is created (i.e., if a device self-test operation completes or is aborted, then the controller shall create a Self-test Result Data Structure prior to setting this field to #NVME_ST_CURR_OP_NOT_RUNNING). See
enum nvme_st_curr_op.completionCurrent Device Self-Test Completion: indicates the percentage of the device self-test operation that is complete (e.g., a value of 25 indicates that 25% of the device self-test operation is complete and 75% remains to be tested). If the current_operation field is cleared to #NVME_ST_CURR_OP_NOT_RUNNING (indicating there is no device self-test operation in progress), then this field is ignored.
rsvdReserved
resultSelf-test Result Data Structures, see
struct nvme_st_result.
-
enum
nvme_cmd_get_log_telemetry_host_lsp¶ Telemetry Host-Initiated log specific field
Constants
NVME_LOG_TELEM_HOST_LSP_RETAINGet Telemetry Data Blocks
NVME_LOG_TELEM_HOST_LSP_CREATECreate Telemetry Data Blocks
-
struct
nvme_telemetry_log¶ Retrieve internal data specific to the manufacturer.
Definition
struct nvme_telemetry_log {
__u8 lpi;
__u8 rsvd1[4];
__u8 ieee[3];
__le16 dalb1;
__le16 dalb2;
__le16 dalb3;
__u8 rsvd14[2];
__le32 dalb4;
__u8 rsvd20[361];
__u8 hostdgn;
__u8 ctrlavail;
__u8 ctrldgn;
__u8 rsnident[128];
__u8 data_area[];
};
Members
lpiLog Identifier, either
NVME_LOG_LID_TELEMETRY_HOSTorNVME_LOG_LID_TELEMETRY_CTRLrsvd1Reserved
ieeeIEEE OUI Identifier is the Organization Unique Identifier (OUI) for the controller vendor that is able to interpret the data.
dalb1Telemetry Controller-Initiated Data Area 1 Last Block is the value of the last block in this area.
dalb2Telemetry Controller-Initiated Data Area 1 Last Block is the value of the last block in this area.
dalb3Telemetry Controller-Initiated Data Area 1 Last Block is the value of the last block in this area.
rsvd14Reserved
dalb4Telemetry Controller-Initiated Data Area 4 Last Block is the value of the last block in this area.
rsvd20Reserved
hostdgnTelemetry Host-Initiated Data Generation Number is a value that is incremented each time the host initiates a capture of its internal controller state in the controller .
ctrlavailTelemetry Controller-Initiated Data Available, if cleared, then the controller telemetry log does not contain saved internal controller state. If this field is set to 1h, the controller log contains saved internal controller state. If this field is set to 1h, the data will be latched until the host releases it by reading the log with RAE cleared.
ctrldgnTelemetry Controller-Initiated Data Generation Number is a value that is incremented each time the controller initiates a capture of its internal controller state in the controller .
rsnidentReason Identifiers a vendor specific identifier that describes the operating conditions of the controller at the time of capture.
data_areaTelemetry data blocks, vendor specific information data.
Description
This log consists of a header describing the log and zero or more Telemetry
Data Blocks. All Telemetry Data Blocks are NVME_LOG_TELEM_BLOCK_SIZE, 512
bytes, in size. This log captures the controller’s internal state.
-
struct
nvme_endurance_group_log¶ Endurance Group Information Log
Definition
struct nvme_endurance_group_log {
__u8 critical_warning;
__u8 endurance_group_features;
__u8 rsvd2;
__u8 avl_spare;
__u8 avl_spare_threshold;
__u8 percent_used;
__le16 domain_identifier;
__u8 rsvd8[24];
__u8 endurance_estimate[16];
__u8 data_units_read[16];
__u8 data_units_written[16];
__u8 media_units_written[16];
__u8 host_read_cmds[16];
__u8 host_write_cmds[16];
__u8 media_data_integrity_err[16];
__u8 num_err_info_log_entries[16];
__u8 total_end_grp_cap[16];
__u8 unalloc_end_grp_cap[16];
__u8 rsvd192[320];
};
Members
critical_warningCritical Warning
endurance_group_featuresEndurance Group Features
rsvd2Reserved
avl_spareAvailable Spare
avl_spare_thresholdAvailable Spare Threshold
percent_usedPercentage Used
domain_identifierDomain Identifier
rsvd8Reserved
endurance_estimateEndurance Estimate
data_units_readData Units Read
data_units_writtenData Units Written
media_units_writtenMedia Units Written
host_read_cmdsHost Read Commands
host_write_cmdsHost Write Commands
media_data_integrity_errMedia and Data Integrity Errors
num_err_info_log_entriesNumber of Error Information Log Entries
total_end_grp_capTotal Endurance Group Capacity
unalloc_end_grp_capUnallocated Endurance Group Capacity
rsvd192Reserved
-
enum
nvme_eg_critical_warning_flags¶ Endurance Group Information Log - Critical Warning
Constants
NVME_EG_CRITICAL_WARNING_SPAREAvailable spare capacity of the Endurance Group has fallen below the threshold
NVME_EG_CRITICAL_WARNING_DEGRADEDEndurance Group reliability has been degraded
NVME_EG_CRITICAL_WARNING_READ_ONLYEndurance Group have been placed in read only mode
-
struct
nvme_aggregate_endurance_group_event¶ Endurance Group Event Aggregate
Definition
struct nvme_aggregate_endurance_group_event {
__le64 num_entries;
__le16 entries[];
};
Members
num_entriesNumber or entries
entriesList of entries
-
struct
nvme_nvmset_predictable_lat_log¶ Predictable Latency Mode - Deterministic Threshold Configuration Data
Definition
struct nvme_nvmset_predictable_lat_log {
__u8 status;
__u8 rsvd1;
__le16 event_type;
__u8 rsvd4[28];
__le64 dtwin_rt;
__le64 dtwin_wt;
__le64 dtwin_tmax;
__le64 ndwin_tmin_hi;
__le64 ndwin_tmin_lo;
__u8 rsvd72[56];
__le64 dtwin_re;
__le64 dtwin_we;
__le64 dtwin_te;
__u8 rsvd152[360];
};
Members
statusStatus
rsvd1Reserved
event_typeEvent Type
rsvd4Reserved
dtwin_rtDTWIN Reads Typical
dtwin_wtDTWIN Writes Typical
dtwin_tmaxDTWIN Time Maximum
ndwin_tmin_hiNDWIN Time Minimum High
ndwin_tmin_loNDWIN Time Minimum Low
rsvd72Reserved
dtwin_reDTWIN Reads Estimate
dtwin_weDTWIN Writes Estimate
dtwin_teDTWIN Time Estimate
rsvd152Reserved
-
enum
nvme_nvmeset_pl_status¶ Predictable Latency Per NVM Set Log - Status
Constants
NVME_NVMSET_PL_STATUS_DISABLEDNot used (Predictable Latency Mode not enabled)
NVME_NVMSET_PL_STATUS_DTWINDeterministic Window (DTWIN)
NVME_NVMSET_PL_STATUS_NDWINNon-Deterministic Window (NDWIN)
-
enum
nvme_nvmset_pl_events¶ Predictable Latency Per NVM Set Log - Event Type
Constants
NVME_NVMSET_PL_EVENT_DTWIN_READ_WARNDTWIN Reads Warning
NVME_NVMSET_PL_EVENT_DTWIN_WRITE_WARNDTWIN Writes Warning
NVME_NVMSET_PL_EVENT_DTWIN_TIME_WARNDTWIN Time Warning
NVME_NVMSET_PL_EVENT_DTWIN_EXCEEDEDAutonomous transition from DTWIN to NDWIN due to typical or maximum value exceeded
NVME_NVMSET_PL_EVENT_DTWIN_EXCURSIONAutonomous transition from DTWIN to NDWIN due to Deterministic Excursion
-
struct
nvme_aggregate_predictable_lat_event¶ Predictable Latency Event Aggregate Log Page
Definition
struct nvme_aggregate_predictable_lat_event {
__le64 num_entries;
__le16 entries[];
};
Members
num_entriesNumber of entries
entriesEntry list
-
struct
nvme_ana_group_desc¶ ANA Group Descriptor
Definition
struct nvme_ana_group_desc {
__le32 grpid;
__le32 nnsids;
__le64 chgcnt;
__u8 state;
__u8 rsvd17[15];
__le32 nsids[];
};
Members
grpidANA group id
nnsidsNumber of namespaces in nsids
chgcntChange counter
stateANA state
rsvd17Reserved
nsidsList of namespaces
-
enum
nvme_ana_state¶ ANA Group Descriptor - Asymmetric Namespace Access State
Constants
NVME_ANA_STATE_OPTIMIZEDANA Optimized state
NVME_ANA_STATE_NONOPTIMIZEDANA Non-Optimized state
NVME_ANA_STATE_INACCESSIBLEANA Inaccessible state
NVME_ANA_STATE_PERSISTENT_LOSSANA Persistent Loss state
NVME_ANA_STATE_CHANGEANA Change state
-
struct
nvme_ana_log¶ Asymmetric Namespace Access Log
Definition
struct nvme_ana_log {
__le64 chgcnt;
__le16 ngrps;
__u8 rsvd10[6];
struct nvme_ana_group_desc descs[];
};
Members
chgcntChange Count
ngrpsNumber of ANA Group Descriptors
rsvd10Reserved
descsANA Group Descriptor
-
struct
nvme_persistent_event_log¶ Persistent Event Log
Definition
struct nvme_persistent_event_log {
__u8 lid;
__u8 rsvd1[3];
__le32 tnev;
__le64 tll;
__u8 rv;
__u8 rsvd17;
__le16 lhl;
__le64 ts;
__u8 poh[16];
__le64 pcc;
__le16 vid;
__le16 ssvid;
char sn[20];
char mn[40];
char subnqn[NVME_NQN_LENGTH];
__le16 gen_number;
__le32 rci;
__u8 rsvd378[102];
__u8 seb[32];
};
Members
lidLog Identifier
rsvd1Reserved
tnevTotal Number of Events
tllTotal Log Length
rvLog Revision
rsvd17Reserved
lhlLog Header Length
tsTimestamp
pohPower on Hours
pccPower Cycle Count
vidPCI Vendor ID
ssvidPCI Subsystem Vendor ID
snSerial Number
mnModel Number
subnqnNVM Subsystem NVMe Qualified Name
gen_numberGeneration Number
rciReporting Context Information
rsvd378Reserved
sebSupported Events Bitmap
-
struct
nvme_persistent_event_entry¶ Persistent Event
Definition
struct nvme_persistent_event_entry {
__u8 etype;
__u8 etype_rev;
__u8 ehl;
__u8 ehai;
__le16 cntlid;
__le64 ets;
__le16 pelpid;
__u8 rsvd16[4];
__le16 vsil;
__le16 el;
};
Members
etypeEvent Type
etype_revEvent Type Revision
ehlEvent Header Length
ehaiEvent Header Additional Info
cntlidController Identifier
etsEvent Timestamp
pelpidPort Identifier
rsvd16Reserved
vsilVendor Specific Information Length
elEvent Length
-
enum
nvme_persistent_event_types¶ Persistent event log events
Constants
NVME_PEL_SMART_HEALTH_EVENTSMART / Health Log Snapshot Event
NVME_PEL_FW_COMMIT_EVENTFirmware Commit Event
NVME_PEL_TIMESTAMP_EVENTTimestamp Change Event
NVME_PEL_POWER_ON_RESET_EVENTPower-on or Reset Event
NVME_PEL_NSS_HW_ERROR_EVENTNVM Subsystem Hardware Error Event
NVME_PEL_CHANGE_NS_EVENTChange Namespace Event
NVME_PEL_FORMAT_START_EVENTFormat NVM Start Event
NVME_PEL_FORMAT_COMPLETION_EVENTFormat NVM Completion Event
NVME_PEL_SANITIZE_START_EVENTSanitize Start Event
NVME_PEL_SANITIZE_COMPLETION_EVENTSanitize Completion Event
NVME_PEL_SET_FEATURE_EVENTSet Feature Event
NVME_PEL_TELEMETRY_CRTTelemetry Log Create Event
NVME_PEL_THERMAL_EXCURSION_EVENTThermal Excursion Event
-
struct
nvme_fw_commit_event¶ Firmware Commit Event Data
Definition
struct nvme_fw_commit_event {
__le64 old_fw_rev;
__le64 new_fw_rev;
__u8 fw_commit_action;
__u8 fw_slot;
__u8 sct_fw;
__u8 sc_fw;
__le16 vndr_assign_fw_commit_rc;
};
Members
old_fw_revOld Firmware Revision
new_fw_revNew Firmware Revision
fw_commit_actionFirmware Commit Action
fw_slotFirmware Slot
sct_fwStatus Code Type for Firmware Commit Command
sc_fwStatus Returned for Firmware Commit Command
vndr_assign_fw_commit_rcVendor Assigned Firmware Commit Result Code
-
struct
nvme_timestamp¶ Timestamp - Data Structure for Get Features
Definition
struct nvme_timestamp {
__u8 timestamp[6];
__u8 attr;
__u8 rsvd;
};
Members
timestampTimestamp value based on origin and synch field
attrAttribute
rsvdReserved
-
struct
nvme_time_stamp_change_event¶ Timestamp Change Event
Definition
struct nvme_time_stamp_change_event {
__le64 previous_timestamp;
__le64 ml_secs_since_reset;
};
Members
previous_timestampPrevious Timestamp
ml_secs_since_resetMilliseconds Since Reset
-
struct
nvme_power_on_reset_info_list¶ Controller Reset Information
Definition
struct nvme_power_on_reset_info_list {
__le16 cid;
__u8 fw_act;
__u8 op_in_prog;
__u8 rsvd4[12];
__le32 ctrl_power_cycle;
__le64 power_on_ml_seconds;
__le64 ctrl_time_stamp;
};
Members
cidController ID
fw_actFirmware Activation
op_in_progOperation in Progress
rsvd4Reserved
ctrl_power_cycleController Power Cycle
power_on_ml_secondsPower on milliseconds
ctrl_time_stampController Timestamp
-
struct
nvme_nss_hw_err_event¶ NVM Subsystem Hardware Error Event
Definition
struct nvme_nss_hw_err_event {
__le16 nss_hw_err_event_code;
__u8 rsvd2[2];
__u8 *add_hw_err_info;
};
Members
nss_hw_err_event_codeNVM Subsystem Hardware Error Event Code
rsvd2Reserved
add_hw_err_infoAdditional Hardware Error Information
-
struct
nvme_change_ns_event¶ Change Namespace Event Data
Definition
struct nvme_change_ns_event {
__le32 nsmgt_cdw10;
__u8 rsvd4[4];
__le64 nsze;
__u8 rsvd16[8];
__le64 nscap;
__u8 flbas;
__u8 dps;
__u8 nmic;
__u8 rsvd35;
__le32 ana_grp_id;
__le16 nvmset_id;
__le16 rsvd42;
__le32 nsid;
};
Members
nsmgt_cdw10Namespace Management CDW10
rsvd4Reserved
nszeNamespace Size
rsvd16Reserved
nscapNamespace Capacity
flbasFormatted LBA Size
dpsEnd-to-end Data Protection Type Settings
nmicNamespace Multi-path I/O and Namespace Sharing Capabilities
rsvd35Reserved
ana_grp_idANA Group Identifier
nvmset_idNVM Set Identifier
rsvd42Reserved
nsidNamespace ID
-
struct
nvme_format_nvm_start_event¶ Format NVM Start Event Data
Definition
struct nvme_format_nvm_start_event {
__le32 nsid;
__u8 fna;
__u8 rsvd5[3];
__le32 format_nvm_cdw10;
};
Members
nsidNamespace Identifier
fnaFormat NVM Attributes
rsvd5Reserved
format_nvm_cdw10Format NVM CDW10
-
struct
nvme_format_nvm_compln_event¶ Format NVM Completion Event Data
Definition
struct nvme_format_nvm_compln_event {
__le32 nsid;
__u8 smallest_fpi;
__u8 format_nvm_status;
__le16 compln_info;
__le32 status_field;
};
Members
nsidNamespace Identifier
smallest_fpiSmallest Format Progress Indicator
format_nvm_statusFormat NVM Status
compln_infoCompletion Information
status_fieldStatus Field
-
struct
nvme_sanitize_start_event¶ Sanitize Start Event Data
Definition
struct nvme_sanitize_start_event {
__le32 sani_cap;
__le32 sani_cdw10;
__le32 sani_cdw11;
};
Members
sani_capSANICAP
sani_cdw10Sanitize CDW10
sani_cdw11Sanitize CDW11
-
struct
nvme_sanitize_compln_event¶ Sanitize Completion Event Data
Definition
struct nvme_sanitize_compln_event {
__le16 sani_prog;
__le16 sani_status;
__le16 cmpln_info;
__u8 rsvd6[2];
};
Members
sani_progSanitize Progress
sani_statusSanitize Status
cmpln_infoCompletion Information
rsvd6Reserved
-
struct
nvme_set_feature_event¶ Set Feature Event Data
Definition
struct nvme_set_feature_event {
__le32 layout;
__le32 cdw_mem[0];
};
Members
layoutSet Feature Event Layout
cdw_memCommand Dwords Memory buffer
-
struct
nvme_thermal_exc_event¶ Thermal Excursion Event Data
Definition
struct nvme_thermal_exc_event {
__u8 over_temp;
__u8 threshold;
};
Members
over_tempOver Temperature
thresholdtemperature threshold
-
struct
nvme_lba_rd¶ LBA Range Descriptor
Definition
struct nvme_lba_rd {
__le64 rslba;
__le32 rnlb;
__u8 rsvd12[4];
};
Members
rslbaRange Starting LBA
rnlbRange Number of Logical Blocks
rsvd12Reserved
-
struct
nvme_lbas_ns_element¶ LBA Status Log Namespace Element
Definition
struct nvme_lbas_ns_element {
__le32 neid;
__le32 nlrd;
__u8 ratype;
__u8 rsvd8[7];
struct nvme_lba_rd lba_rd[];
};
Members
neidNamespace Element Identifier
nlrdNumber of LBA Range Descriptors
ratypeRecommended Action Type. see enum nvme_lba_status_atype
rsvd8Reserved
lba_rdLBA Range Descriptor
-
enum
nvme_lba_status_atype¶ Potentially Unrecoverable LBAs
Constants
NVME_LBA_STATUS_ATYPE_SCAN_UNTRACKEDPotentially Unrecoverable LBAs
NVME_LBA_STATUS_ATYPE_SCAN_TRACKEDPotentially Unrecoverable LBAs associated with physical storage
-
struct
nvme_lba_status_log¶ LBA Status Information Log
Definition
struct nvme_lba_status_log {
__le32 lslplen;
__le32 nlslne;
__le32 estulb;
__u8 rsvd12[2];
__le16 lsgc;
struct nvme_lbas_ns_element elements[];
};
Members
lslplenLBA Status Log Page Length
nlslneNumber of LBA Status Log Namespace Elements
estulbEstimate of Unrecoverable Logical Blocks
rsvd12Reserved
lsgcLBA Status Generation Counter
elementsLBA Status Log Namespace Element List
-
struct
nvme_eg_event_aggregate_log¶ Endurance Group Event Aggregate
Definition
struct nvme_eg_event_aggregate_log {
__le64 nr_entries;
__le16 egids[];
};
Members
nr_entriesNumber of Entries
egidsEndurance Group Identifier
-
enum
nvme_fid_supported_effects¶ FID Supported and Effects Data Structure definitions
Constants
NVME_FID_SUPPORTED_EFFECTS_FSUPPFID Supported
NVME_FID_SUPPORTED_EFFECTS_UDCCUser Data Content Change
NVME_FID_SUPPORTED_EFFECTS_NCCNamespace Capability Change
NVME_FID_SUPPORTED_EFFECTS_NICNamespace Inventory Change
NVME_FID_SUPPORTED_EFFECTS_CCCController Capability Change
NVME_FID_SUPPORTED_EFFECTS_UUID_SELUUID Selection Supported
NVME_FID_SUPPORTED_EFFECTS_SCOPE_SHIFTFID Scope Shift
NVME_FID_SUPPORTED_EFFECTS_SCOPE_MASKFID Scope Mask
NVME_FID_SUPPORTED_EFFECTS_SCOPE_NSNamespace Scope
NVME_FID_SUPPORTED_EFFECTS_SCOPE_CTRLController Scope
NVME_FID_SUPPORTED_EFFECTS_SCOPE_NVM_SETNVM Set Scope
NVME_FID_SUPPORTED_EFFECTS_SCOPE_ENDGRPEndurance Group Scope
NVME_FID_SUPPORTED_EFFECTS_SCOPE_DOMAINDomain Scope
NVME_FID_SUPPORTED_EFFECTS_SCOPE_NSSNVM Subsystem Scope
-
struct
nvme_fid_supported_effects_log¶ Feature Identifiers Supported and Effects
Definition
struct nvme_fid_supported_effects_log {
__le32 fid_support[NVME_LOG_FID_SUPPORTED_EFFECTS_MAX];
};
Members
fid_supportFeature Identifier Supported
-
enum
nvme_mi_cmd_supported_effects¶ MI Command Supported and Effects Data Structure
Constants
NVME_MI_CMD_SUPPORTED_EFFECTS_CSUPPCommand Supported
NVME_MI_CMD_SUPPORTED_EFFECTS_UDCCUser Data Content Change
NVME_MI_CMD_SUPPORTED_EFFECTS_NCCNamespace Capability Change
NVME_MI_CMD_SUPPORTED_EFFECTS_NICNamespace Inventory Change
NVME_MI_CMD_SUPPORTED_EFFECTS_CCCController Capability Change
NVME_MI_CMD_SUPPORTED_EFFECTS_SCOPE_SHIFT20 bit shift
NVME_MI_CMD_SUPPORTED_EFFECTS_SCOPE_MASK12 bit mask - 0xfff
NVME_MI_CMD_SUPPORTED_EFFECTS_SCOPE_NSNamespace Scope
NVME_MI_CMD_SUPPORTED_EFFECTS_SCOPE_CTRLController Scope
NVME_MI_CMD_SUPPORTED_EFFECTS_SCOPE_NVM_SETNVM Set Scope
NVME_MI_CMD_SUPPORTED_EFFECTS_SCOPE_ENDGRPEndurance Group Scope
NVME_MI_CMD_SUPPORTED_EFFECTS_SCOPE_DOMAINDomain Scope
NVME_MI_CMD_SUPPORTED_EFFECTS_SCOPE_NSSNVM Subsystem Scope
-
struct
nvme_mi_cmd_supported_effects_log¶ NVMe-MI Commands Supported and Effects Log
Definition
struct nvme_mi_cmd_supported_effects_log {
__le32 mi_cmd_support[NVME_LOG_MI_CMD_SUPPORTED_EFFECTS_MAX];
__le32 reserved1[NVME_LOG_MI_CMD_SUPPORTED_EFFECTS_RESERVED];
};
Members
mi_cmd_supportNVMe-MI Commands Supported
reserved1Reserved
-
struct
nvme_boot_partition¶ Boot Partition Log
Definition
struct nvme_boot_partition {
__u8 lid;
__u8 rsvd1[3];
__le32 bpinfo;
__u8 rsvd8[8];
__u8 boot_partition_data[];
};
Members
lidBoot Partition Identifier
rsvd1Reserved
bpinfoBoot Partition Information
rsvd8Reserved
boot_partition_dataContains the contents of the specified Boot Partition
-
struct
nvme_eom_lane_desc¶ EOM Lane Descriptor
Definition
struct nvme_eom_lane_desc {
__u8 rsvd0;
__u8 mstatus;
__u8 lane;
__u8 eye;
__le16 top;
__le16 bottom;
__le16 left;
__le16 right;
__le16 nrows;
__le16 ncols;
__le16 edlen;
__u8 rsvd18[14];
__u8 eye_desc[];
};
Members
rsvd0Reserved
mstatusMeasurement Status
laneLane number
eyeEye number
topAbsolute number of rows from center to top edge of eye
bottomAbsolute number of rows from center to bottom edge of eye
leftAbsolute number of rows from center to left edge of eye
rightAbsolute number of rows from center to right edge of eye
nrowsNumber of Rows
ncolsNumber of Columns
edlenEye Data Length
rsvd18Reserved
eye_descPrintable Eye, Eye Data, and any Padding
-
struct
nvme_phy_rx_eom_log¶ Physical Interface Receiver Eye Opening Measurement Log
Definition
struct nvme_phy_rx_eom_log {
__u8 lid;
__u8 eomip;
__le16 hsize;
__le32 rsize;
__u8 eomdgn;
__u8 lr;
__u8 odp;
__u8 lanes;
__u8 epl;
__u8 lspfc;
__u8 li;
__u8 rsvd15[3];
__le16 lsic;
__le32 dsize;
__le16 nd;
__le16 maxtb;
__le16 maxlr;
__le16 etgood;
__le16 etbetter;
__le16 etbest;
__u8 rsvd36[28];
struct nvme_eom_lane_desc descs[];
};
Members
lidLog Identifier
eomipEOM In Progress
hsizeHeader Size
rsizeResult Size
eomdgnEOM Data Generation Number
lrLog Revision
odpOptional Data Present
lanesNumber of lanes configured for this port
eplEyes Per Lane
lspfcLog Specific Parameter Field Copy
liLink Information
rsvd15Reserved
lsicLog Specific Identifier Copy
dsizeDescriptor Size
ndNumber of Descriptors
maxtbMaximum Top Bottom
maxlrMaximum Left Right
etgoodEstimated Time for Good Quality
etbetterEstimated Time for Better Quality
etbestEstimated Time for Best Quality
rsvd36Reserved
descsEOM Lane Descriptors
-
enum
nvme_eom_optional_data¶ EOM Optional Data Present Fields
Constants
NVME_EOM_EYE_DATA_PRESENTEye Data Present
NVME_EOM_PRINTABLE_EYE_PRESENTPrintable Eye Present
-
enum
nvme_phy_rx_eom_progress¶ EOM In Progress Values
Constants
NVME_PHY_RX_EOM_NOT_STARTEDEOM Not Started
NVME_PHY_RX_EOM_IN_PROGRESSEOM In Progress
NVME_PHY_RX_EOM_COMPLETEDEOM Completed
-
struct
nvme_media_unit_stat_desc¶ Media Unit Status Descriptor
Definition
struct nvme_media_unit_stat_desc {
__le16 muid;
__le16 domainid;
__le16 endgid;
__le16 nvmsetid;
__le16 cap_adj_fctr;
__u8 avl_spare;
__u8 percent_used;
__u8 mucs;
__u8 cio;
};
Members
muidMedia Unit Identifier
domainidDomain Identifier
endgidEndurance Group Identifier
nvmsetidNVM Set Identifier
cap_adj_fctrCapacity Adjustment Factor
avl_spareAvailable Spare
percent_usedPercentage Used
mucsNumber of Channels attached to media units
cioChannel Identifiers Offset
-
struct
nvme_media_unit_stat_log¶ Media Unit Status
Definition
struct nvme_media_unit_stat_log {
__le16 nmu;
__le16 cchans;
__le16 sel_config;
__u8 rsvd6[10];
struct nvme_media_unit_stat_desc mus_desc[];
};
Members
nmuNumber unit status descriptor
cchansNumber of Channels
sel_configSelected Configuration
rsvd6Reserved
mus_descMedia unit statistic descriptors
-
struct
nvme_media_unit_config_desc¶ Media Unit Configuration Descriptor
Definition
struct nvme_media_unit_config_desc {
__le16 muid;
__u8 rsvd2[4];
__le16 mudl;
};
Members
muidMedia Unit Identifier
rsvd2Reserved
mudlMedia Unit Descriptor Length
-
struct
nvme_channel_config_desc¶ Channel Configuration Descriptor
Definition
struct nvme_channel_config_desc {
__le16 chanid;
__le16 chmus;
struct nvme_media_unit_config_desc mu_config_desc[];
};
Members
chanidChannel Identifier
chmusNumber Channel Media Units
mu_config_descChannel Unit config descriptors. See struct nvme_media_unit_config_desc
-
struct
nvme_end_grp_chan_desc¶ Endurance Group Channel Configuration Descriptor
Definition
struct nvme_end_grp_chan_desc {
__le16 egchans;
struct nvme_channel_config_desc chan_config_desc[];
};
Members
egchansNumber of Channels
chan_config_descChannel config descriptors. See struct nvme_channel_config_desc
-
struct
nvme_end_grp_config_desc¶ Endurance Group Configuration Descriptor
Definition
struct nvme_end_grp_config_desc {
__le16 endgid;
__le16 cap_adj_factor;
__u8 rsvd4[12];
__u8 tegcap[16];
__u8 segcap[16];
__u8 end_est[16];
__u8 rsvd64[16];
__le16 egsets;
__le16 nvmsetid[];
};
Members
endgidEndurance Group Identifier
cap_adj_factorCapacity Adjustment Factor
rsvd4Reserved
tegcapTotal Endurance Group Capacity
segcapSpare Endurance Group Capacity
end_estEndurance Estimate
rsvd64Reserved
egsetsNumber of NVM Sets
nvmsetidNVM Set Identifier
-
struct
nvme_capacity_config_desc¶ Capacity Configuration structure definitions
Definition
struct nvme_capacity_config_desc {
__le16 cap_config_id;
__le16 domainid;
__le16 egcn;
__u8 rsvd6[26];
struct nvme_end_grp_config_desc egcd[];
};
Members
cap_config_idCapacity Configuration Identifier
domainidDomain Identifier
egcnNumber Endurance Group Configuration Descriptors
rsvd6Reserved
egcdEndurance Group Config descriptors. See struct nvme_end_grp_config_desc
-
struct
nvme_supported_cap_config_list_log¶ Supported Capacity Configuration list log page
Definition
struct nvme_supported_cap_config_list_log {
__u8 sccn;
__u8 rsvd1[15];
struct nvme_capacity_config_desc cap_config_desc[];
};
Members
sccnNumber of capacity configuration
rsvd1Reserved
cap_config_descCapacity configuration descriptor. See struct nvme_capacity_config_desc
-
struct
nvme_resv_notification_log¶ Reservation Notification Log
Definition
struct nvme_resv_notification_log {
__le64 lpc;
__u8 rnlpt;
__u8 nalp;
__u8 rsvd9[2];
__le32 nsid;
__u8 rsvd16[48];
};
Members
lpcLog Page Count
rnlptnalpNumber of Available Log Pages
rsvd9Reserved
nsidNamespace ID
rsvd16Reserved
-
enum
nvme_resv_notify_rnlpt¶ Reservation Notification Log - Reservation Notification Log Page Type
Constants
NVME_RESV_NOTIFY_RNLPT_EMPTYEmpty Log Page
NVME_RESV_NOTIFY_RNLPT_REGISTRATION_PREEMPTEDRegistration Preempted
NVME_RESV_NOTIFY_RNLPT_RESERVATION_RELEASEDReservation Released
NVME_RESV_NOTIFY_RNLPT_RESERVATION_PREEMPTEDReservation Preempted
-
struct
nvme_sanitize_log_page¶ Sanitize Status (Log Identifier 81h)
Definition
struct nvme_sanitize_log_page {
__le16 sprog;
__le16 sstat;
__le32 scdw10;
__le32 eto;
__le32 etbe;
__le32 etce;
__le32 etond;
__le32 etbend;
__le32 etcend;
__u8 rsvd32[480];
};
Members
sprogSanitize Progress (SPROG): indicates the fraction complete of the sanitize operation. The value is a numerator of the fraction complete that has 65,536 (10000h) as its denominator. This value shall be set to FFFFh if the sstat field is not set to
NVME_SANITIZE_SSTAT_STATUS_IN_PROGESS.sstatSanitize Status (SSTAT): indicates the status associated with the most recent sanitize operation. See
enum nvme_sanitize_sstat.scdw10Sanitize Command Dword 10 Information (SCDW10): contains the value of the Command Dword 10 field of the Sanitize command that started the sanitize operation.
etoEstimated Time For Overwrite: indicates the number of seconds required to complete an Overwrite sanitize operation with 16 passes in the background when the No-Deallocate Modifies Media After Sanitize field is not set to 10b. A value of 0h indicates that the sanitize operation is expected to be completed in the background when the Sanitize command that started that operation is completed. A value of FFFFFFFFh indicates that no time period is reported.
etbeEstimated Time For Block Erase: indicates the number of seconds required to complete a Block Erase sanitize operation in the background when the No-Deallocate Modifies Media After Sanitize field is not set to 10b. A value of 0h indicates that the sanitize operation is expected to be completed in the background when the Sanitize command that started that operation is completed. A value of FFFFFFFFh indicates that no time period is reported.
etceEstimated Time For Crypto Erase: indicates the number of seconds required to complete a Crypto Erase sanitize operation in the background when the No-Deallocate Modifies Media After Sanitize field is not set to 10b. A value of 0h indicates that the sanitize operation is expected to be completed in the background when the Sanitize command that started that operation is completed. A value of FFFFFFFFh indicates that no time period is reported.
etondEstimated Time For Overwrite With No-Deallocate Media Modification: indicates the number of seconds required to complete an Overwrite sanitize operation and the associated additional media modification after the Overwrite sanitize operation in the background when the No-Deallocate After Sanitize bit was set to 1 in the Sanitize command that requested the Overwrite sanitize operation; and the No-Deallocate Modifies Media After Sanitize field is set to 10b. A value of 0h indicates that the sanitize operation is expected to be completed in the background when the Sanitize command that started that operation is completed. A value of FFFFFFFFh indicates that no time period is reported.
etbendEstimated Time For Block Erase With No-Deallocate Media Modification: indicates the number of seconds required to complete a Block Erase sanitize operation and the associated additional media modification after the Block Erase sanitize operation in the background when the No-Deallocate After Sanitize bit was set to 1 in the Sanitize command that requested the Overwrite sanitize operation; and the No-Deallocate Modifies Media After Sanitize field is set to 10b. A value of 0h indicates that the sanitize operation is expected to be completed in the background when the Sanitize command that started that operation is completed. A value of FFFFFFFFh indicates that no time period is reported.
etcendEstimated Time For Crypto Erase With No-Deallocate Media Modification: indicates the number of seconds required to complete a Crypto Erase sanitize operation and the associated additional media modification after the Crypto Erase sanitize operation in the background when the No-Deallocate After Sanitize bit was set to 1 in the Sanitize command that requested the Overwrite sanitize operation; and the No-Deallocate Modifies Media After Sanitize field is set to 10b. A value of 0h indicates that the sanitize operation is expected to be completed in the background when the Sanitize command that started that operation is completed. A value of FFFFFFFFh indicates that no time period is reported.
rsvd32Reserved
-
enum
nvme_sanitize_sstat¶ Sanitize Status (SSTAT)
Constants
NVME_SANITIZE_SSTAT_STATUS_SHIFTShift amount to get the status value of the most recent sanitize operation from the
struct nvme_sanitize_log_page.sstat field.NVME_SANITIZE_SSTAT_STATUS_MASKMask to get the status value of the most recent sanitize operation.
NVME_SANITIZE_SSTAT_STATUS_NEVER_SANITIZEDThe NVM subsystem has never been sanitized.
NVME_SANITIZE_SSTAT_STATUS_COMPLETE_SUCCESSThe most recent sanitize operation completed successfully including any additional media modification.
NVME_SANITIZE_SSTAT_STATUS_IN_PROGESSA sanitize operation is currently in progress.
NVME_SANITIZE_SSTAT_STATUS_COMPLETED_FAILEDThe most recent sanitize operation failed.
NVME_SANITIZE_SSTAT_STATUS_ND_COMPLETE_SUCCESSThe most recent sanitize operation for which No-Deallocate After Sanitize was requested has completed successfully with deallocation of all user data.
NVME_SANITIZE_SSTAT_COMPLETED_PASSES_SHIFTShift amount to get the number of completed passes if the most recent sanitize operation was an Overwrite. This value shall be cleared to 0h if the most recent sanitize operation was not an Overwrite.
NVME_SANITIZE_SSTAT_COMPLETED_PASSES_MASKMask to get the number of completed passes.
NVME_SANITIZE_SSTAT_GLOBAL_DATA_ERASED_SHIFTShift amount to get the Global Data Erased value from the
struct nvme_sanitize_log_page.sstat field.NVME_SANITIZE_SSTAT_GLOBAL_DATA_ERASED_MASKMask to get the Global Data Erased value.
NVME_SANITIZE_SSTAT_GLOBAL_DATA_ERASEDGlobal Data Erased: if set, then no namespace user data in the NVM subsystem has been written to and no Persistent Memory Region in the NVM subsystem has been enabled since being manufactured and the NVM subsystem has never been sanitized; or since the most recent successful sanitize operation.
-
struct
nvme_zns_changed_zone_log¶ ZNS Changed Zone List log
Definition
struct nvme_zns_changed_zone_log {
__le16 nrzid;
__u8 rsvd2[6];
__le64 zid[NVME_ZNS_CHANGED_ZONES_MAX];
};
Members
nrzidNumber of Zone Identifiers
rsvd2Reserved
zidZone Identifier
-
enum
nvme_zns_zt¶ Zone Descriptor Data Structure - Zone Type
Constants
NVME_ZONE_TYPE_SEQWRITE_REQSequential Write Required
-
enum
nvme_zns_za¶ Zone Descriptor Data Structure
Constants
NVME_ZNS_ZA_ZFCZone Finished by Controller
NVME_ZNS_ZA_FZRFinish Zone Recommended
NVME_ZNS_ZA_RZRReset Zone Recommended
NVME_ZNS_ZA_ZRWAV
NVME_ZNS_ZA_ZDEVZone Descriptor Extension Valid
-
enum
nvme_zns_zs¶ Zone Descriptor Data Structure - Zone State
Constants
NVME_ZNS_ZS_EMPTYEmpty state
NVME_ZNS_ZS_IMPL_OPENImplicitly open state
NVME_ZNS_ZS_EXPL_OPENExplicitly open state
NVME_ZNS_ZS_CLOSEDClosed state
NVME_ZNS_ZS_READ_ONLYRead only state
NVME_ZNS_ZS_FULLFull state
NVME_ZNS_ZS_OFFLINEOffline state
-
struct
nvme_zns_desc¶ Zone Descriptor Data Structure
Definition
struct nvme_zns_desc {
__u8 zt;
__u8 zs;
__u8 za;
__u8 zai;
__u8 rsvd4[4];
__le64 zcap;
__le64 zslba;
__le64 wp;
__u8 rsvd32[32];
};
Members
ztZone Type
zsZone State
zaZone Attributes
zaiZone Attributes Information
rsvd4Reserved
zcapZone Capacity
zslbaZone Start Logical Block Address
wpWrite Pointer
rsvd32Reserved
-
struct
nvme_zone_report¶ Report Zones Data Structure
Definition
struct nvme_zone_report {
__le64 nr_zones;
__u8 rsvd8[56];
struct nvme_zns_desc entries[];
};
Members
nr_zonesNumber of descriptors in entries
rsvd8Reserved
entriesZoned namespace descriptors
-
enum
nvme_fdp_ruh_type¶ Reclaim Unit Handle Type
Constants
NVME_FDP_RUHT_INITIALLY_ISOLATEDInitially Isolated
NVME_FDP_RUHT_PERSISTENTLY_ISOLATEDPersistently Isolated
-
struct
nvme_fdp_ruh_desc¶ Reclaim Unit Handle Descriptor
Definition
struct nvme_fdp_ruh_desc {
__u8 ruht;
__u8 rsvd1[3];
};
Members
ruhtReclaim Unit Handle Type
rsvd1Reserved
-
enum
nvme_fdp_config_fdpa¶ FDP Attributes
Constants
NVME_FDP_CONFIG_FDPA_RGIF_SHIFTReclaim Group Identifier Format Shift
NVME_FDP_CONFIG_FDPA_RGIF_MASKReclaim Group Identifier Format Mask
NVME_FDP_CONFIG_FDPA_FDPVWC_SHIFTFDP Volatile Write Cache Shift
NVME_FDP_CONFIG_FDPA_FDPVWC_MASKFDP Volatile Write Cache Mask
NVME_FDP_CONFIG_FDPA_VALID_SHIFTFDP Configuration Valid Shift
NVME_FDP_CONFIG_FDPA_VALID_MASKFDP Configuration Valid Mask
-
struct
nvme_fdp_config_desc¶ FDP Configuration Descriptor
Definition
struct nvme_fdp_config_desc {
__le16 size;
__u8 fdpa;
__u8 vss;
__le32 nrg;
__le16 nruh;
__le16 maxpids;
__le32 nnss;
__le64 runs;
__le32 erutl;
__u8 rsvd28[36];
struct nvme_fdp_ruh_desc ruhs[];
};
Members
sizeDescriptor size
fdpaFDP Attributes (
enum nvme_fdp_config_fdpa)vssVendor Specific Size
nrgNumber of Reclaim Groups
nruhNumber of Reclaim Unit Handles
maxpidsMax Placement Identifiers
nnssNumber of Namespaces Supported
runsReclaim Unit Nominal Size
erutlEstimated Reclaim Unit Time Limit
rsvd28Reserved
ruhsReclaim Unit Handle descriptors (
struct nvme_fdp_ruh_desc)
-
struct
nvme_fdp_config_log¶ FDP Configurations Log Page
Definition
struct nvme_fdp_config_log {
__le16 n;
__u8 version;
__u8 rsvd3;
__le32 size;
__u8 rsvd8[8];
struct nvme_fdp_config_desc configs[];
};
Members
nNumber of FDP Configurations
versionLog page version
rsvd3Reserved
sizeLog page size in bytes
rsvd8Reserved
configsFDP Configuration descriptors (
struct nvme_fdp_config_desc)
-
enum
nvme_fdp_ruha¶ Reclaim Unit Handle Attributes
Constants
NVME_FDP_RUHA_HOST_SHIFTHost Specified Reclaim Unit Handle Shift
NVME_FDP_RUHA_HOST_MASKHost Specified Reclaim Unit Handle Mask
NVME_FDP_RUHA_CTRL_SHIFTController Specified Reclaim Unit Handle Shift
NVME_FDP_RUHA_CTRL_MASKController Specified Reclaim Unit Handle Mask
-
struct
nvme_fdp_ruhu_desc¶ Reclaim Unit Handle Usage Descriptor
Definition
struct nvme_fdp_ruhu_desc {
__u8 ruha;
__u8 rsvd1[7];
};
Members
ruhaReclaim Unit Handle Attributes (
enum nvme_fdp_ruha)rsvd1Reserved
-
struct
nvme_fdp_ruhu_log¶ Reclaim Unit Handle Usage Log Page
Definition
struct nvme_fdp_ruhu_log {
__le16 nruh;
__u8 rsvd2[6];
struct nvme_fdp_ruhu_desc ruhus[];
};
Members
nruhNumber of Reclaim Unit Handles
rsvd2Reserved
ruhusReclaim Unit Handle Usage descriptors
-
struct
nvme_fdp_stats_log¶ FDP Statistics Log Page
Definition
struct nvme_fdp_stats_log {
__u8 hbmw[16];
__u8 mbmw[16];
__u8 mbe[16];
__u8 rsvd48[16];
};
Members
hbmwHost Bytes with Metadata Written
mbmwMedia Bytes with Metadata Written
mbeMedia Bytes Erased
rsvd48Reserved
-
enum
nvme_fdp_event_type¶ FDP Event Types
Constants
NVME_FDP_EVENT_RUNFWReclaim Unit Not Fully Written
NVME_FDP_EVENT_RUTLEReclaim Unit Time Limit Exceeded
NVME_FDP_EVENT_RESETController Level Reset Modified Reclaim Unit Handles
NVME_FDP_EVENT_PIDInvalid Placement Identifier
NVME_FDP_EVENT_REALLOCMedia Reallocated
NVME_FDP_EVENT_MODIFYImplicitly Modified Reclaim Unit Handle
-
enum
nvme_fdp_event_realloc_flags¶ Media Reallocated Event Type Specific Flags
Constants
NVME_FDP_EVENT_REALLOC_F_LBAVLBA Valid
-
struct
nvme_fdp_event_realloc¶ Media Reallocated Event Type Specific Information
Definition
struct nvme_fdp_event_realloc {
__u8 flags;
__u8 rsvd1;
__le16 nlbam;
__le64 lba;
__u8 rsvd12[4];
};
Members
flagsEvent Type Specific flags (
enum nvme_fdp_event_realloc_flags)rsvd1Reserved
nlbamNumber of LBAs Moved
lbaLogical Block Address
rsvd12Reserved
-
enum
nvme_fdp_event_flags¶ FDP Event Flags
Constants
NVME_FDP_EVENT_F_PIVPlacement Identifier Valid
NVME_FDP_EVENT_F_NSIDVNamespace Identifier Valid
NVME_FDP_EVENT_F_LVLocation Valid
-
struct
nvme_fdp_event¶ FDP Event
Definition
struct nvme_fdp_event {
__u8 type;
__u8 flags;
__le16 pid;
struct nvme_timestamp ts;
__le32 nsid;
__u8 type_specific[16];
__le16 rgid;
__u8 ruhid;
__u8 rsvd35[5];
__u8 vs[24];
};
Members
typeEvent Type (
enum nvme_fdp_event_type)flagsEvent Flags (
enum nvme_fdp_event_flags)pidPlacement Identifier
tsTimestamp
nsidNamespace Identifier
type_specificEvent Type Specific Information
rgidReclaim Group Identifier
ruhidReclaim Unit Handle Identifier
rsvd35Reserved
vsVendor Specific
-
struct
nvme_fdp_events_log¶ FDP Events Log Page
Definition
struct nvme_fdp_events_log {
__le32 n;
__u8 rsvd4[60];
struct nvme_fdp_event events[63];
};
Members
nNumber of FDP Events
rsvd4Reserved
eventsFDP Events (
struct nvme_fdp_event)
-
struct
nvme_feat_fdp_events_cdw11¶ FDP Events Feature Command Dword 11
Definition
struct nvme_feat_fdp_events_cdw11 {
__le16 phndl;
__u8 noet;
__u8 rsvd24;
};
Members
phndlPlacement Handle
noetNumber of FDP Event Types
rsvd24Reserved
-
enum
nvme_fdp_supported_event_attributes¶ Supported FDP Event Attributes
Constants
NVME_FDP_SUPP_EVENT_ENABLED_SHIFTFDP Event Enable Shift
NVME_FDP_SUPP_EVENT_ENABLED_MASKFDP Event Enable Mask
-
struct
nvme_fdp_supported_event_desc¶ Supported FDP Event Descriptor
Definition
struct nvme_fdp_supported_event_desc {
__u8 evt;
__u8 evta;
};
Members
evtFDP Event Type
evtaFDP Event Type Attributes (
enum nvme_fdp_supported_event_attributes)
-
struct
nvme_fdp_ruh_status_desc¶ Reclaim Unit Handle Status Descriptor
Definition
struct nvme_fdp_ruh_status_desc {
__le16 pid;
__le16 ruhid;
__le32 earutr;
__le64 ruamw;
__u8 rsvd16[16];
};
Members
pidPlacement Identifier
ruhidReclaim Unit Handle Identifier
earutrEstimated Active Reclaim Unit Time Remaining
ruamwReclaim Unit Available Media Writes
rsvd16Reserved
-
struct
nvme_fdp_ruh_status¶ Reclaim Unit Handle Status
Definition
struct nvme_fdp_ruh_status {
__u8 rsvd0[14];
__le16 nruhsd;
struct nvme_fdp_ruh_status_desc ruhss[];
};
Members
rsvd0Reserved
nruhsdNumber of Reclaim Unit Handle Status Descriptors
ruhssReclaim Unit Handle Status descriptors
-
struct
nvme_lba_status_desc¶ LBA Status Descriptor Entry
Definition
struct nvme_lba_status_desc {
__le64 dslba;
__le32 nlb;
__u8 rsvd12;
__u8 status;
__u8 rsvd14[2];
};
Members
dslbaDescriptor Starting LBA
nlbNumber of Logical Blocks
rsvd12Reserved
statusAdditional status about this LBA range
rsvd14Reserved
-
struct
nvme_lba_status¶ LBA Status Descriptor List
Definition
struct nvme_lba_status {
__le32 nlsd;
__u8 cmpc;
__u8 rsvd5[3];
struct nvme_lba_status_desc descs[];
};
Members
nlsdNumber of LBA Status Descriptors
cmpcCompletion Condition
rsvd5Reserved
descsLBA status descriptor Entry
-
struct
nvme_feat_auto_pst¶ Autonomous Power State Transition
Definition
struct nvme_feat_auto_pst {
__le64 apst_entry[32];
};
Members
apst_entry
-
enum
nvme_apst_entry¶ Autonomous Power State Transition
Constants
NVME_APST_ENTRY_ITPS_SHIFTIdle Transition Power State Shift
NVME_APST_ENTRY_ITPT_SHIFTIdle Time Prior to Transition Shift
NVME_APST_ENTRY_ITPS_MASKIdle Transition Power State Mask
NVME_APST_ENTRY_ITPT_MASKIdle Time Prior to Transition Mask
-
struct
nvme_metadata_element_desc¶ Metadata Element Descriptor
Definition
struct nvme_metadata_element_desc {
__u8 type;
__u8 rev;
__le16 len;
__u8 val[0];
};
Members
typeElement Type (ET)
revElement Revision (ER)
lenElement Length (ELEN)
valElement Value (EVAL), UTF-8 string
-
struct
nvme_host_metadata¶ Host Metadata Data Structure
Definition
struct nvme_host_metadata {
__u8 ndesc;
__u8 rsvd1;
union {
struct nvme_metadata_element_desc descs[0];
__u8 descs_buf[4094];
};
};
Members
ndescNumber of metadata element descriptors
rsvd1Reserved
{unnamed_union}anonymous
descsMetadata element descriptors
descs_bufMetadata element descriptor buffer
-
enum
nvme_ctrl_metadata_type¶ Controller Metadata Element Types
Constants
NVME_CTRL_METADATA_OS_CTRL_NAMEName of the controller in the operating system.
NVME_CTRL_METADATA_OS_DRIVER_NAMEName of the driver in the operating system.
NVME_CTRL_METADATA_OS_DRIVER_VERVersion of the driver in the operating system.
NVME_CTRL_METADATA_PRE_BOOT_CTRL_NAMEName of the controller in the pre-boot environment.
NVME_CTRL_METADATA_PRE_BOOT_DRIVER_NAMEName of the driver in the pre-boot environment.
NVME_CTRL_METADATA_PRE_BOOT_DRIVER_VERVersion of the driver in the pre-boot environment.
NVME_CTRL_METADATA_SYS_PROC_MODELModel of the processor.
NVME_CTRL_METADATA_CHIPSET_DRV_NAMEChipset driver name.
NVME_CTRL_METADATA_CHIPSET_DRV_VERSIONChipset driver version.
NVME_CTRL_METADATA_OS_NAME_AND_BUILDOperating system name and build.
NVME_CTRL_METADATA_SYS_PROD_NAMESystem product name.
NVME_CTRL_METADATA_FIRMWARE_VERSIONHost firmware (e.g UEFI) version.
NVME_CTRL_METADATA_OS_DRIVER_FILENAMEOperating system driver filename.
NVME_CTRL_METADATA_DISPLAY_DRV_NAMEDisplay driver name.
NVME_CTRL_METADATA_DISPLAY_DRV_VERSIONDisplay driver version.
NVME_CTRL_METADATA_HOST_DET_FAIL_RECFailure record.
-
enum
nvme_ns_metadata_type¶ Namespace Metadata Element Types
Constants
NVME_NS_METADATA_OS_NS_NAMEName of the namespace in the operating system
NVME_NS_METADATA_PRE_BOOT_NS_NAMEName of the namespace in the pre-boot environment.
NVME_NS_METADATA_OS_NS_QUAL_1First qualifier of the Operating System Namespace Name.
NVME_NS_METADATA_OS_NS_QUAL_2Second qualifier of the Operating System Namespace Name.
-
struct
nvme_lba_range_type_entry¶ LBA Range Type - Data Structure Entry
Definition
struct nvme_lba_range_type_entry {
__u8 type;
__u8 attributes;
__u8 rsvd2[14];
__le64 slba;
__le64 nlb;
__u8 guid[16];
__u8 rsvd48[16];
};
Members
typeSpecifies the Type of the LBA range
attributesSpecifies attributes of the LBA range
rsvd2Reserved
slbaStarting LBA
nlbNumber of Logical Blocks
guidUnique Identifier
rsvd48Reserved
-
enum
nvme_lbart¶ LBA Range Type - Data Structure Entry
Constants
NVME_LBART_TYPE_GPGeneral Purpose
NVME_LBART_TYPE_FSFilesystem
NVME_LBART_TYPE_RAIDRAID
NVME_LBART_TYPE_CACHECache
NVME_LBART_TYPE_SWAPPage / swap file
NVME_LBART_ATTRIB_TEMPTemp
NVME_LBART_ATTRIB_HIDEHidden
-
struct
nvme_lba_range_type¶ LBA Range Type
Definition
struct nvme_lba_range_type {
struct nvme_lba_range_type_entry entry[NVME_FEAT_LBA_RANGE_MAX];
};
Members
entryLBA range type entry. See struct nvme_lba_range_type_entry
-
struct
nvme_plm_config¶ Predictable Latency Mode - Deterministic Threshold Configuration Data Structure
Definition
struct nvme_plm_config {
__le16 ee;
__u8 rsvd2[30];
__le64 dtwinrt;
__le64 dtwinwt;
__le64 dtwintt;
__u8 rsvd56[456];
};
Members
eeEnable Event
rsvd2Reserved
dtwinrtDTWIN Reads Threshold
dtwinwtDTWIN Writes Threshold
dtwinttDTWIN Time Threshold
rsvd56Reserved
-
struct
nvme_feat_host_behavior¶ Host Behavior Support - Data Structure
Definition
struct nvme_feat_host_behavior {
__u8 acre;
__u8 rsvd1[511];
};
Members
acreAdvanced Command Retry Enable
rsvd1Reserved
-
enum
nvme_host_behavior_support¶ Enable Advanced Command
Constants
NVME_ENABLE_ACREEnable Advanced Command Retry Enable
-
struct
nvme_dsm_range¶ Dataset Management - Range Definition
Definition
struct nvme_dsm_range {
__le32 cattr;
__le32 nlb;
__le64 slba;
};
Members
cattrContext Attributes
nlbLength in logical blocks
slbaStarting LBA
-
struct
nvme_copy_range¶ Copy - Source Range Entries Descriptor Format
Definition
struct nvme_copy_range {
__u8 rsvd0[8];
__le64 slba;
__le16 nlb;
__u8 rsvd18[6];
__le32 eilbrt;
__le16 elbat;
__le16 elbatm;
};
Members
rsvd0Reserved
slbaStarting LBA
nlbNumber of Logical Blocks
rsvd18Reserved
eilbrtExpected Initial Logical Block Reference Tag / Expected Logical Block Storage Tag
elbatExpected Logical Block Application Tag
elbatmExpected Logical Block Application Tag Mask
-
struct
nvme_copy_range_f1¶ Copy - Source Range Entries Descriptor Format 1h
Definition
struct nvme_copy_range_f1 {
__u8 rsvd0[8];
__le64 slba;
__le16 nlb;
__u8 rsvd18[8];
__u8 elbt[10];
__le16 elbat;
__le16 elbatm;
};
Members
rsvd0Reserved
slbaStarting LBA
nlbNumber of Logical Blocks
rsvd18Reserved
elbtExpected Initial Logical Block Reference Tag / Expected Logical Block Storage Tag
elbatExpected Logical Block Application Tag
elbatmExpected Logical Block Application Tag Mask
-
struct
nvme_registered_ctrl¶ Registered Controller Data Structure
Definition
struct nvme_registered_ctrl {
__le16 cntlid;
__u8 rcsts;
__u8 rsvd3[5];
__le64 hostid;
__le64 rkey;
};
Members
cntlidController ID
rcstsReservation Status
rsvd3Reserved
hostidHost Identifier
rkeyReservation Key
-
struct
nvme_registered_ctrl_ext¶ Registered Controller Extended Data Structure
Definition
struct nvme_registered_ctrl_ext {
__le16 cntlid;
__u8 rcsts;
__u8 rsvd3[5];
__le64 rkey;
__u8 hostid[16];
__u8 rsvd32[32];
};
Members
cntlidController ID
rcstsReservation Status
rsvd3Reserved
rkeyReservation Key
hostidHost Identifier
rsvd32Reserved
-
struct
nvme_resv_status¶ Reservation Status Data Structure
Definition
struct nvme_resv_status {
__le32 gen;
__u8 rtype;
__u8 regctl[2];
__u8 rsvd7[2];
__u8 ptpls;
__u8 rsvd10[14];
union {
struct {
__u8 rsvd24[40];
struct nvme_registered_ctrl_ext regctl_eds[0];
};
struct nvme_registered_ctrl regctl_ds[0];
};
};
Members
genGeneration
rtypeReservation Type
regctlNumber of Registered Controllers
rsvd7Reserved
ptplsPersist Through Power Loss State
rsvd10Reserved
{unnamed_union}anonymous
{unnamed_struct}anonymous
rsvd24Reserved
regctl_edsRegistered Controller Extended Data Structure
regctl_dsRegistered Controller Data Structure
-
struct
nvme_streams_directive_params¶ Streams Directive - Return Parameters Data Structure
Definition
struct nvme_streams_directive_params {
__le16 msl;
__le16 nssa;
__le16 nsso;
__u8 nssc;
__u8 rsvd[9];
__le32 sws;
__le16 sgs;
__le16 nsa;
__le16 nso;
__u8 rsvd2[6];
};
Members
mslMax Streams Limit
nssaNVM Subsystem Streams Available
nssoNVM Subsystem Streams Open
nsscNVM Subsystem Stream Capability
rsvdReserved
swsStream Write Size
sgsStream Granularity Size
nsaNamespace Streams Allocated
nsoNamespace Streams Open
rsvd2Reserved
-
struct
nvme_streams_directive_status¶ Streams Directive - Get Status Data Structure
Definition
struct nvme_streams_directive_status {
__le16 osc;
__le16 sid[];
};
Members
oscOpen Stream Count
sidStream Identifier
-
struct
nvme_id_directives¶ Identify Directive - Return Parameters Data Structure
Definition
struct nvme_id_directives {
__u8 supported[32];
__u8 enabled[32];
__u8 rsvd64[4032];
};
Members
supportedIdentify directive is supported
enabledIdentify directive is Enabled
rsvd64Reserved
-
enum
nvme_directive_types¶ Directives Supported or Enabled
Constants
NVME_ID_DIR_ID_BITIdentify directive is supported
NVME_ID_DIR_SD_BITStreams directive is supported
NVME_ID_DIR_DP_BITDirect Placement directive is supported
-
struct
nvme_host_mem_buf_attrs¶ Host Memory Buffer - Attributes Data Structure
Definition
struct nvme_host_mem_buf_attrs {
__le32 hsize;
__le32 hmdlal;
__le32 hmdlau;
__le32 hmdlec;
__u8 rsvd16[4080];
};
Members
hsizeHost Memory Buffer Size
hmdlalHost Memory Descriptor List Lower Address
hmdlauHost Memory Descriptor List Upper Address
hmdlecHost Memory Descriptor List Entry Count
rsvd16Reserved
-
enum
nvme_ae_type¶ Asynchronous Event Type
Constants
NVME_AER_ERRORError event
NVME_AER_SMARTSMART / Health Status event
NVME_AER_NOTICENotice event
NVME_AER_CSSNVM Command Set Specific events
NVME_AER_VSVendor Specific event
-
enum
nvme_ae_info_error¶ Asynchronous Event Information - Error Status
Constants
NVME_AER_ERROR_INVALID_DB_REGWrite to Invalid Doorbell Register
NVME_AER_ERROR_INVALID_DB_VALInvalid Doorbell Write Value
NVME_AER_ERROR_DIAG_FAILUREDiagnostic Failure
NVME_AER_ERROR_PERSISTENT_INTERNAL_ERRORPersistent Internal Error
NVME_AER_ERROR_TRANSIENT_INTERNAL_ERRORTransient Internal Error
NVME_AER_ERROR_FW_IMAGE_LOAD_ERRORFirmware Image Load Error
-
enum
nvme_ae_info_smart¶ Asynchronous Event Information - SMART / Health Status
Constants
NVME_AER_SMART_SUBSYSTEM_RELIABILITYNVM subsystem Reliability
NVME_AER_SMART_TEMPERATURE_THRESHOLDTemperature Threshold
NVME_AER_SMART_SPARE_THRESHOLDSpare Below Threshold
-
enum
nvme_ae_info_css_nvm¶ Asynchronous Event Information - I/O Command Specific Status
Constants
NVME_AER_CSS_NVM_RESERVATIONReservation Log Page Available
NVME_AER_CSS_NVM_SANITIZE_COMPLETEDSanitize Operation Completed
NVME_AER_CSS_NVM_UNEXPECTED_SANITIZE_DEALLOCSanitize Operation Completed With Unexpected Deallocation
-
enum
nvme_ae_info_notice¶ Asynchronous Event Information - Notice
Constants
NVME_AER_NOTICE_NS_CHANGEDNamespace Attribute Changed
NVME_AER_NOTICE_FW_ACT_STARTINGFirmware Activation Starting
NVME_AER_NOTICE_TELEMETRYTelemetry Log Changed
NVME_AER_NOTICE_ANAAsymmetric Namespace Access Change
NVME_AER_NOTICE_PL_EVENTPredictable Latency Event Aggregate Log Change
NVME_AER_NOTICE_LBA_STATUS_ALERTLBA Status Information Alert
NVME_AER_NOTICE_EG_EVENTEndurance Group Event Aggregate Log Page Change
NVME_AER_NOTICE_DISC_CHANGEDDiscovery Log Page Change
-
enum
nvme_subsys_type¶ Type of the NVM subsystem.
Constants
NVME_NQN_DISCDiscovery type target subsystem. Describes a referral to another Discovery Service composed of Discovery controllers that provide additional discovery records. Multiple Referral entries may be reported for each Discovery Service (if that Discovery Service has multiple NVM subsystem ports or supports multiple protocols).
NVME_NQN_NVMENVME type target subsystem. Describes an NVM subsystem whose controllers may have attached namespaces (an NVM subsystem that is not composed of Discovery controllers). Multiple NVM Subsystem entries may be reported for each NVM subsystem if that NVM subsystem has multiple NVM subsystem ports.
NVME_NQN_CURRCurrent Discovery type target subsystem. Describes this Discovery subsystem (the Discovery Service that contains the controller processing the Get Log Page command). Multiple Current Discovery Subsystem entries may be reported for this Discovery subsystem if the current Discovery subsystem has multiple NVM subsystem ports.
-
enum
nvmf_disc_eflags¶ Discovery Log Page entry flags.
Constants
NVMF_DISC_EFLAGS_NONEIndicates that none of the DUPRETINFO or EPCSD features are supported.
NVMF_DISC_EFLAGS_DUPRETINFODuplicate Returned Information (DUPRETINFO): Indicates that using the content of this entry to access this Discovery Service returns the same information that is returned by using the content of other entries in this log page that also have this flag set.
NVMF_DISC_EFLAGS_EPCSDExplicit Persistent Connection Support for Discovery (EPCSD): Indicates that Explicit Persistent Connections are supported for the Discovery controller.
NVMF_DISC_EFLAGS_NCCNo CDC Connectivity (NCC): If set to ‘1’, then no DDC that describes this entry is currently connected to the CDC. If cleared to ‘0’, then at least one DDC that describes this entry is currently connected to the CDC. If the Discovery controller returning this log page is not a CDC, then this bit shall be cleared to ‘0’ and should be ignored by the host.
-
union
nvmf_tsas¶ Transport Specific Address Subtype
Definition
union nvmf_tsas {
char common[NVMF_TSAS_SIZE];
struct rdma {
__u8 qptype;
__u8 prtype;
__u8 cms;
__u8 rsvd3[5];
__le16 pkey;
__u8 rsvd10[246];
} rdma;
struct tcp {
__u8 sectype;
} tcp;
};
Members
commonCommon transport specific attributes
rdmaRDMA transport specific attribute settings
tcpTCP transport specific attribute settings
-
struct
nvmf_disc_log_entry¶ Discovery Log Page entry
Definition
struct nvmf_disc_log_entry {
__u8 trtype;
__u8 adrfam;
__u8 subtype;
__u8 treq;
__le16 portid;
__le16 cntlid;
__le16 asqsz;
__le16 eflags;
__u8 rsvd12[20];
char trsvcid[NVMF_TRSVCID_SIZE];
__u8 rsvd64[192];
char subnqn[NVME_NQN_LENGTH];
char traddr[NVMF_TRADDR_SIZE];
union nvmf_tsas tsas;
};
Members
trtypeTransport Type (TRTYPE): Specifies the NVMe Transport type. See
enum nvmf_trtype.adrfamAddress Family (ADRFAM): Specifies the address family. See
enum nvmf_addr_family.subtypeSubsystem Type (SUBTYPE): Specifies the type of the NVM subsystem that is indicated in this entry. See
enum nvme_subsys_type.treqTransport Requirements (TREQ): Indicates requirements for the NVMe Transport. See
enum nvmf_treq.portidPort ID (PORTID): Specifies a particular NVM subsystem port. Different NVMe Transports or address families may utilize the same Port ID value (e.g. a Port ID may support both iWARP and RoCE).
cntlidController ID (CNTLID): Specifies the controller ID. If the NVM subsystem uses a dynamic controller model, then this field shall be set to FFFFh. If the NVM subsystem uses a static controller model, then this field may be set to a specific controller ID (values 0h to FFEFh are valid). If the NVM subsystem uses a static controller model and the value indicated is FFFEh, then the host should remember the Controller ID returned as part of the Fabrics Connect command in order to re-establish an association in the future with the same controller.
asqszAdmin Max SQ Size (ASQSZ): Specifies the maximum size of an Admin Submission Queue. This applies to all controllers in the NVM subsystem. The value shall be a minimum of 32 entries.
eflagsEntry Flags (EFLAGS): Indicates additional information related to the current entry. See
enum nvmf_disc_eflags.rsvd12Reserved
trsvcidTransport Service Identifier (TRSVCID): Specifies the NVMe Transport service identifier as an ASCII string. The NVMe Transport service identifier is specified by the associated NVMe Transport binding specification.
rsvd64Reserved
subnqnNVM Subsystem Qualified Name (SUBNQN): NVMe Qualified Name (NQN) that uniquely identifies the NVM subsystem. For a subsystem, if that Discovery subsystem has a unique NQN (i.e., the NVM Subsystem NVMe Qualified Name (SUBNQN) field in that Discovery subsystem’s Identify Controller data structure contains a unique NQN value), then the value returned shall be that unique NQN. If the Discovery subsystem does not have a unique NQN, then the value returned shall be the well-known Discovery Service NQN (nqn.2014-08.org.nvmexpress.discovery).
traddrTransport Address (TRADDR): Specifies the address of the NVM subsystem that may be used for a Connect command as an ASCII string. The Address Family field describes the reference for parsing this field.
tsasTransport specific attribute settings
-
enum
nvmf_trtype¶ Transport Type codes for Discovery Log Page entry TRTYPE field
Constants
NVMF_TRTYPE_UNSPECIFIEDNot indicated
NVMF_TRTYPE_RDMARDMA
NVMF_TRTYPE_FCFibre Channel
NVMF_TRTYPE_TCPTCP
NVMF_TRTYPE_LOOPIntra-host Transport (i.e., loopback), reserved for host usage.
NVMF_TRTYPE_MAXMaximum value for
enum nvmf_trtype
-
enum
nvmf_addr_family¶ Address Family codes for Discovery Log Page entry ADRFAM field
Constants
NVMF_ADDR_FAMILY_PCIPCIe
NVMF_ADDR_FAMILY_IP4AF_INET: IPv4 address family.
NVMF_ADDR_FAMILY_IP6AF_INET6: IPv6 address family.
NVMF_ADDR_FAMILY_IBAF_IB: InfiniBand address family.
NVMF_ADDR_FAMILY_FCFibre Channel address family.
NVMF_ADDR_FAMILY_LOOPIntra-host Transport (i.e., loopback), reserved for host usage.
-
enum
nvmf_treq¶ Transport Requirements codes for Discovery Log Page entry TREQ field
Constants
NVMF_TREQ_NOT_SPECIFIEDNot specified
NVMF_TREQ_REQUIREDRequired
NVMF_TREQ_NOT_REQUIREDNot Required
NVMF_TREQ_DISABLE_SQFLOWSQ flow control disable supported
-
enum
nvmf_rdma_qptype¶ RDMA QP Service Type codes for Discovery Log Page entry TSAS RDMA_QPTYPE field
Constants
NVMF_RDMA_QPTYPE_CONNECTEDReliable Connected
NVMF_RDMA_QPTYPE_DATAGRAMReliable Datagram
-
enum
nvmf_rdma_prtype¶ RDMA Provider Type codes for Discovery Log Page entry TSAS RDMA_PRTYPE field
Constants
NVMF_RDMA_PRTYPE_NOT_SPECIFIEDNo Provider Specified
NVMF_RDMA_PRTYPE_IBInfiniBand
NVMF_RDMA_PRTYPE_ROCEInfiniBand RoCE
NVMF_RDMA_PRTYPE_ROCEV2InfiniBand RoCEV2
NVMF_RDMA_PRTYPE_IWARPiWARP
-
enum
nvmf_rdma_cms¶ RDMA Connection Management Service Type codes for Discovery Log Page entry TSAS RDMA_CMS field
Constants
NVMF_RDMA_CMS_RDMA_CMSockets based endpoint addressing
-
enum
nvmf_tcp_sectype¶ Transport Specific Address Subtype Definition for NVMe/TCP Transport
Constants
NVMF_TCP_SECTYPE_NONENo Security
NVMF_TCP_SECTYPE_TLSTransport Layer Security version 1.2
NVMF_TCP_SECTYPE_TLS13Transport Layer Security version 1.3 or a subsequent version. The TLS protocol negotiates the version and cipher suite for each TCP connection.
-
enum
nvmf_log_discovery_lid_support¶ Discovery log specific support
Constants
NVMF_LOG_DISC_LID_NONENone
NVMF_LOG_DISC_LID_EXTDLPESExtended Discovery Log Page Entries Supported
NVMF_LOG_DISC_LID_PLEOSPort Local Entries Only Supported
NVMF_LOG_DISC_LID_ALLSUBESAll NVM Subsystem Entries Supported
-
enum
nvmf_log_discovery_lsp¶ Discovery log specific field
Constants
NVMF_LOG_DISC_LSP_NONENone
NVMF_LOG_DISC_LSP_EXTDLPEExtended Discovery Log Page Entries
NVMF_LOG_DISC_LSP_PLEOPort Local Entries Only
NVMF_LOG_DISC_LSP_ALLSUBEAll NVM Subsystem Entries
-
struct
nvmf_discovery_log¶ Discovery Log Page (Log Identifier 70h)
Definition
struct nvmf_discovery_log {
__le64 genctr;
__le64 numrec;
__le16 recfmt;
__u8 rsvd14[1006];
struct nvmf_disc_log_entry entries[];
};
Members
genctrGeneration Counter (GENCTR): Indicates the version of the discovery information, starting at a value of 0h. For each change in the Discovery Log Page, this counter is incremented by one. If the value of this field is FFFFFFFF_FFFFFFFFh, then the field shall be cleared to 0h when incremented (i.e., rolls over to 0h).
numrecNumber of Records (NUMREC): Indicates the number of records contained in the log.
recfmtRecord Format (RECFMT): Specifies the format of the Discovery Log Page. If a new format is defined, this value is incremented by one. The format of the record specified in this definition shall be 0h.
rsvd14Reserved
entriesDiscovery Log Page Entries - see
struct nvmf_disc_log_entry.
-
enum
nvmf_dim_tas¶ Discovery Information Management Task
Constants
NVMF_DIM_TAS_REGISTERRegister
NVMF_DIM_TAS_DEREGISTERDeregister
NVMF_DIM_TAS_UPDATEUpdate
-
enum
nvmf_dim_entfmt¶ Discovery Information Management Entry Format
Constants
NVMF_DIM_ENTFMT_BASICBasic discovery information entry
NVMF_DIM_ENTFMT_EXTENDEDExtended discovery information entry
-
enum
nvmf_dim_etype¶ Discovery Information Management Entity Type
Constants
NVMF_DIM_ETYPE_HOSTHost
NVMF_DIM_ETYPE_DDCDirect Discovery controller
NVMF_DIM_ETYPE_CDCCentralized Discovery controller
-
enum
nvmf_exattype¶ Extended Attribute Type
Constants
NVMF_EXATTYPE_HOSTIDHost Identifier
NVMF_EXATTYPE_SYMNAMESymblic Name
-
struct
nvmf_ext_attr¶ Extended Attribute (EXAT)
Definition
struct nvmf_ext_attr {
__le16 exattype;
__le16 exatlen;
__u8 exatval[];
};
Members
exattypeExtended Attribute Type (EXATTYPE) - see enum nvmf_exattype
exatlenExtended Attribute Length (EXATLEN)
exatvalExtended Attribute Value (EXATVAL) - size allocated for array must be a multiple of 4 bytes
-
struct
nvmf_ext_die¶ Extended Discovery Information Entry (DIE)
Definition
struct nvmf_ext_die {
__u8 trtype;
__u8 adrfam;
__u8 subtype;
__u8 treq;
__le16 portid;
__le16 cntlid;
__le16 asqsz;
__u8 rsvd10[22];
char trsvcid[NVMF_TRSVCID_SIZE];
__u8 resv64[192];
char nqn[NVME_NQN_LENGTH];
char traddr[NVMF_TRADDR_SIZE];
union nvmf_tsas tsas;
__le32 tel;
__le16 numexat;
__u8 resv1030[2];
struct nvmf_ext_attr exat[];
};
Members
trtypeTransport Type (
enum nvmf_trtype)adrfamAddress Family (
enum nvmf_addr_family)subtypeSubsystem Type (
enum nvme_subsys_type)treqTransport Requirements (
enum nvmf_treq)portidPort ID
cntlidController ID
asqszAdmin Max SQ Size
rsvd10Reserved
trsvcidTransport Service Identifier
resv64Reserved
nqnNVM Qualified Name
traddrTransport Address
tsasTransport Specific Address Subtype (
union nvmf_tsas)telTotal Entry Length
numexatNumber of Extended Attributes
resv1030Reserved
exatExtended Attributes 0 (
struct nvmf_ext_attr)
-
union
nvmf_die¶ Discovery Information Entry (DIE)
Definition
union nvmf_die {
struct nvmf_disc_log_entry basic[0];
struct nvmf_ext_die extended;
};
Members
basicBasic format (
struct nvmf_disc_log_entry)extendedExtended format (
struct nvmf_ext_die)
Description
Depending on the ENTFMT specified in the DIM, DIEs can be entered with the Basic or Extended formats. For Basic format, each entry has a fixed length. Therefore, the “basic” field defined below can be accessed as a C array. For the Extended format, however, each entry is of variable length (TEL). Therefore, the “extended” field defined below cannot be accessed as a C array. Instead, the “extended” field is akin to a linked-list, where one can “walk” through the list. To move to the next entry, one simply adds the current entry’s length (TEL) to the “walk” pointer. The number of entries in the list is specified by NUMENT. Although extended entries are of a variable lengths (TEL), TEL is always a multiple of 4 bytes.
-
struct
nvmf_dim_data¶ Discovery Information Management (DIM) - Data
Definition
struct nvmf_dim_data {
__le32 tdl;
__u8 rsvd4[4];
__le64 nument;
__le16 entfmt;
__le16 etype;
__u8 portlcl;
__u8 rsvd21;
__le16 ektype;
char eid[NVME_NQN_LENGTH];
char ename[NVMF_ENAME_LEN];
char ever[NVMF_EVER_LEN];
__u8 rsvd600[424];
union nvmf_die die[];
};
Members
tdlTotal Data Length
rsvd4Reserved
numentNumber of entries
entfmtEntry Format (
enum nvmf_dim_entfmt)etypeEntity Type (
enum nvmf_dim_etype)portlclPort Local
rsvd21Reserved
ektypeEntry Key Type
eidEntity Identifier (e.g. Host NQN)
enameEntity Name (e.g. hostname)
everEntity Version (e.g. OS Name/Version)
rsvd600Reserved
dieDiscovery Information Entry (see nument above)
-
struct
nvmf_connect_data¶ Data payload for the ‘connect’ command
Definition
struct nvmf_connect_data {
__u8 hostid[16];
__le16 cntlid;
char rsvd4[238];
char subsysnqn[NVME_NQN_LENGTH];
char hostnqn[NVME_NQN_LENGTH];
char rsvd5[256];
};
Members
hostidHost ID of the connecting host
cntlidRequested controller ID
rsvd4Reserved
subsysnqnSubsystem NQN to connect to
hostnqnHost NQN of the connecting host
rsvd5Reserved
-
struct
nvme_mi_read_nvm_ss_info¶ NVM Subsystem Information Data Structure
Definition
struct nvme_mi_read_nvm_ss_info {
__u8 nump;
__u8 mjr;
__u8 mnr;
__u8 rsvd3[29];
};
Members
numpNumber of Ports
mjrNVMe-MI Major Version Number
mnrNVMe-MI Minor Version Number
rsvd3Reserved
-
struct
nvme_mi_port_pcie¶ PCIe Port Specific Data
Definition
struct nvme_mi_port_pcie {
__u8 mps;
__u8 sls;
__u8 cls;
__u8 mlw;
__u8 nlw;
__u8 pn;
__u8 rsvd14[18];
};
Members
mpsPCIe Maximum Payload Size
slsPCIe Supported Link Speeds Vector
clsPCIe Current Link Speed
mlwPCIe Maximum Link Width
nlwPCIe Negotiated Link Width
pnPCIe Port Number
rsvd14Reserved
-
struct
nvme_mi_port_smb¶ SMBus Port Specific Data
Definition
struct nvme_mi_port_smb {
__u8 vpd_addr;
__u8 mvpd_freq;
__u8 mme_addr;
__u8 mme_freq;
__u8 nvmebm;
__u8 rsvd13[19];
};
Members
vpd_addrCurrent VPD SMBus/I2C Address
mvpd_freqMaximum VPD Access SMBus/I2C Frequency
mme_addrCurrent Management Endpoint SMBus/I2C Address
mme_freqMaximum Management Endpoint SMBus/I2C Frequency
nvmebmNVMe Basic Management
rsvd13Reserved
-
struct
nvme_mi_read_port_info¶ Port Information Data Structure
Definition
struct nvme_mi_read_port_info {
__u8 portt;
__u8 rsvd1;
__le16 mmctptus;
__le32 meb;
union {
struct nvme_mi_port_pcie pcie;
struct nvme_mi_port_smb smb;
};
};
Members
porttPort Type
rsvd1Reserved
mmctptusMaximum MCTP Transmission Unit Size
mebManagement Endpoint Buffer Size
{unnamed_union}anonymous
pciePCIe Port Specific Data
smbSMBus Port Specific Data
-
struct
nvme_mi_read_ctrl_info¶ Controller Information Data Structure
Definition
struct nvme_mi_read_ctrl_info {
__u8 portid;
__u8 rsvd1[4];
__u8 prii;
__le16 pri;
__le16 vid;
__le16 did;
__le16 ssvid;
__le16 ssid;
__u8 rsvd16[16];
};
Members
portidPort Identifier
rsvd1Reserved
priiPCIe Routing ID Information
priPCIe Routing ID
vidPCI Vendor ID
didPCI Device ID
ssvidPCI Subsystem Vendor ID
ssidPCI Subsystem Device ID
rsvd16Reserved
-
struct
nvme_mi_osc¶ Optionally Supported Command Data Structure
Definition
struct nvme_mi_osc {
__u8 type;
__u8 opc;
};
Members
typeCommand Type
opcOpcode
-
struct
nvme_mi_read_sc_list¶ Management Endpoint Buffer Supported Command List Data Structure
Definition
struct nvme_mi_read_sc_list {
__le16 numcmd;
struct nvme_mi_osc cmds[];
};
Members
numcmdNumber of Commands
cmdsMEB supported Command Data Structure. See struct nvme_mi_osc
-
struct
nvme_mi_nvm_ss_health_status¶ Subsystem Management Data Structure
Definition
struct nvme_mi_nvm_ss_health_status {
__u8 nss;
__u8 sw;
__u8 ctemp;
__u8 pdlu;
__le16 ccs;
__u8 rsvd8[2];
};
Members
nssNVM Subsystem Status
swSmart Warnings
ctempComposite Temperature
pdluPercentage Drive Life Used
ccsComposite Controller Status
rsvd8Reserved
-
enum
nvme_mi_ccs¶ Get State Control Primitive Success Response Fields - Control Primitive Specific Response
Constants
NVME_MI_CCS_RDYReady
NVME_MI_CCS_CFSController Fatal Status
NVME_MI_CCS_SHSTShutdown Status
NVME_MI_CCS_NSSRONVM Subsystem Reset Occurred
NVME_MI_CCS_CECOController Enable Change Occurred
NVME_MI_CCS_NACNamespace Attribute Changed
NVME_MI_CCS_FAFirmware Activated
NVME_MI_CCS_CSTSController Status Change
NVME_MI_CCS_CTEMPComposite Temperature Change
NVME_MI_CCS_PDLUPercentage Used
NVME_MI_CCS_SPAREAvailable Spare
NVME_MI_CCS_CCWARNCritical Warning
-
struct
nvme_mi_ctrl_health_status¶ Controller Health Data Structure (CHDS)
Definition
struct nvme_mi_ctrl_health_status {
__le16 ctlid;
__le16 csts;
__le16 ctemp;
__u8 pdlu;
__u8 spare;
__u8 cwarn;
__u8 rsvd9[7];
};
Members
ctlidController Identifier
cstsController Status
ctempComposite Temperature
pdluPercentage Used
spareAvailable Spare
cwarnCritical Warning
rsvd9Reserved
-
enum
nvme_mi_csts¶ Controller Health Data Structure (CHDS) - Controller Status (CSTS)
Constants
NVME_MI_CSTS_RDYReady
NVME_MI_CSTS_CFSController Fatal Status
NVME_MI_CSTS_SHSTShutdown Status
NVME_MI_CSTS_NSSRONVM Subsystem Reset Occurred
NVME_MI_CSTS_CECOController Enable Change Occurred
NVME_MI_CSTS_NACNamespace Attribute Changed
NVME_MI_CSTS_FAFirmware Activated
-
enum
nvme_mi_cwarn¶ Controller Health Data Structure (CHDS) - Critical Warning (CWARN)
Constants
NVME_MI_CWARN_STSpare Threshold
NVME_MI_CWARN_TAUTTemperature Above or Under Threshold
NVME_MI_CWARN_RDReliability Degraded
NVME_MI_CWARN_RORead Only
NVME_MI_CWARN_VMBFVolatile Memory Backup Failed
-
struct
nvme_mi_vpd_mra¶ NVMe MultiRecord Area
Definition
struct nvme_mi_vpd_mra {
__u8 nmravn;
__u8 ff;
__u8 rsvd7[6];
__u8 i18vpwr;
__u8 m18vpwr;
__u8 i33vpwr;
__u8 m33vpwr;
__u8 rsvd17;
__u8 m33vapsr;
__u8 i5vapsr;
__u8 m5vapsr;
__u8 i12vapsr;
__u8 m12vapsr;
__u8 mtl;
__u8 tnvmcap[16];
__u8 rsvd37[27];
};
Members
nmravnNVMe MultiRecord Area Version Number
ffForm Factor
rsvd7Reserved
i18vpwrInitial 1.8 V Power Supply Requirements
m18vpwrMaximum 1.8 V Power Supply Requirements
i33vpwrInitial 3.3 V Power Supply Requirements
m33vpwrMaximum 3.3 V Power Supply Requirements
rsvd17Reserved
m33vapsrMaximum 3.3 Vi aux Power Supply Requirements
i5vapsrInitial 5 V Power Supply Requirements
m5vapsrMaximum 5 V Power Supply Requirements
i12vapsrInitial 12 V Power Supply Requirements
m12vapsrMaximum 12 V Power Supply Requirements
mtlMaximum Thermal Load
tnvmcapTotal NVM Capacity
rsvd37Reserved
-
struct
nvme_mi_vpd_ppmra¶ NVMe PCIe Port MultiRecord Area
Definition
struct nvme_mi_vpd_ppmra {
__u8 nppmravn;
__u8 pn;
__u8 ppi;
__u8 ls;
__u8 mlw;
__u8 mctp;
__u8 refccap;
__u8 pi;
__u8 rsvd13[3];
};
Members
nppmravnNVMe PCIe Port MultiRecord Area Version Number
pnPCIe Port Number
ppiPort Information
lsPCIe Link Speed
mlwPCIe Maximum Link Width
mctpMCTP Support
refccapRef Clk Capability
piPort Identifier
rsvd13Reserved
-
struct
nvme_mi_vpd_telem¶ Vital Product Data Element Descriptor
Definition
struct nvme_mi_vpd_telem {
__u8 type;
__u8 rev;
__u8 len;
__u8 data[0];
};
Members
typeType of the Element Descriptor
revRevision of the Element Descriptor
lenNumber of bytes in the Element Descriptor
dataType-specific information associated with the Element Descriptor
-
enum
nvme_mi_elem¶ Element Descriptor Types
Constants
NVME_MI_ELEM_EEDExtended Element Descriptor
NVME_MI_ELEM_USCEUpstream Connector Element Descriptor
NVME_MI_ELEM_ECEDExpansion Connector Element Descriptor
NVME_MI_ELEM_LEDLabel Element Descriptor
NVME_MI_ELEM_SMBMEDSMBus/I2C Mux Element Descriptor
NVME_MI_ELEM_PCIESEDPCIe Switch Element Descriptor
NVME_MI_ELEM_NVMEDNVM Subsystem Element Descriptor
-
struct
nvme_mi_vpd_tra¶ Vital Product Data Topology MultiRecord
Definition
struct nvme_mi_vpd_tra {
__u8 vn;
__u8 rsvd6;
__u8 ec;
struct nvme_mi_vpd_telem elems[0];
};
Members
vnVersion Number
rsvd6Reserved
ecElement Count
elemsElement Descriptor
-
struct
nvme_mi_vpd_mr_common¶ NVMe MultiRecord Area
Definition
struct nvme_mi_vpd_mr_common {
__u8 type;
__u8 rf;
__u8 rlen;
__u8 rchksum;
__u8 hchksum;
union {
struct nvme_mi_vpd_mra nmra;
struct nvme_mi_vpd_ppmra ppmra;
struct nvme_mi_vpd_tra tmra;
};
};
Members
typeNVMe Record Type ID
rfRecord Format
rlenRecord Length
rchksumRecord Checksum
hchksumHeader Checksum
{unnamed_union}anonymous
nmraNVMe MultiRecord Area
ppmraNVMe PCIe Port MultiRecord Area
tmraTopology MultiRecord Area
-
struct
nvme_mi_vpd_hdr¶ Vital Product Data Common Header
Definition
struct nvme_mi_vpd_hdr {
__u8 ipmiver;
__u8 iuaoff;
__u8 ciaoff;
__u8 biaoff;
__u8 piaoff;
__u8 mrioff;
__u8 rsvd6;
__u8 chchk;
__u8 vpd[];
};
Members
ipmiverIPMI Format Version Number
iuaoffInternal Use Area Starting Offset
ciaoffChassis Info Area Starting Offset
biaoffBoard Info Area Starting Offset
piaoffProduct Info Area Starting Offset
mrioffMultiRecord Info Area Starting Offset
rsvd6Reserved
chchkCommon Header Checksum
vpdVital Product Data
-
enum
nvme_status_field¶ Defines all parts of the nvme status field: status code, status code type, and additional flags.
Constants
NVME_SCT_GENERICGeneric errors applicable to multiple opcodes
NVME_SCT_CMD_SPECIFICErrors associated to a specific opcode
NVME_SCT_MEDIAErrors associated with media and data integrity
NVME_SCT_PATHErrors associated with the paths connection
NVME_SCT_VSVendor specific errors
NVME_SCT_MASKMask to get the value of the Status Code Type
NVME_SCT_SHIFTShift value to get the value of the Status Code Type
NVME_SC_MASKMask to get the value of the status code.
NVME_SC_SHIFTShift value to get the value of the status code.
NVME_SC_SUCCESSSuccessful Completion: The command completed without error.
NVME_SC_INVALID_OPCODEInvalid Command Opcode: A reserved coded value or an unsupported value in the command opcode field.
NVME_SC_INVALID_FIELDInvalid Field in Command: A reserved coded value or an unsupported value in a defined field.
NVME_SC_CMDID_CONFLICTCommand ID Conflict: The command identifier is already in use.
NVME_SC_DATA_XFER_ERRORData Transfer Error: Transferring the data or metadata associated with a command experienced an error.
NVME_SC_POWER_LOSSCommands Aborted due to Power Loss Notification: Indicates that the command was aborted due to a power loss notification.
NVME_SC_INTERNALInternal Error: The command was not completed successfully due to an internal error.
NVME_SC_ABORT_REQCommand Abort Requested: The command was aborted due to an Abort command being received that specified the Submission Queue Identifier and Command Identifier of this command.
NVME_SC_ABORT_QUEUECommand Aborted due to SQ Deletion: The command was aborted due to a Delete I/O Submission Queue request received for the Submission Queue to which the command was submitted.
NVME_SC_FUSED_FAILCommand Aborted due to Failed Fused Command: The command was aborted due to the other command in a fused operation failing.
NVME_SC_FUSED_MISSINGAborted due to Missing Fused Command: The fused command was aborted due to the adjacent submission queue entry not containing a fused command that is the other command.
NVME_SC_INVALID_NSInvalid Namespace or Format: The namespace or the format of that namespace is invalid.
NVME_SC_CMD_SEQ_ERRORCommand Sequence Error: The command was aborted due to a protocol violation in a multi-command sequence.
NVME_SC_SGL_INVALID_LASTInvalid SGL Segment Descriptor: The command includes an invalid SGL Last Segment or SGL Segment descriptor.
NVME_SC_SGL_INVALID_COUNTInvalid Number of SGL Descriptors: There is an SGL Last Segment descriptor or an SGL Segment descriptor in a location other than the last descriptor of a segment based on the length indicated.
NVME_SC_SGL_INVALID_DATAData SGL Length Invalid: This may occur if the length of a Data SGL is too short. This may occur if the length of a Data SGL is too long and the controller does not support SGL transfers longer than the amount of data to be transferred as indicated in the SGL Support field of the Identify Controller data structure.
NVME_SC_SGL_INVALID_METADATAMetadata SGL Length Invalid: This may occur if the length of a Metadata SGL is too short. This may occur if the length of a Metadata SGL is too long and the controller does not support SGL transfers longer than the amount of data to be transferred as indicated in the SGL Support field of the Identify Controller data structure.
NVME_SC_SGL_INVALID_TYPESGL Descriptor Type Invalid: The type of an SGL Descriptor is a type that is not supported by the controller.
NVME_SC_CMB_INVALID_USEInvalid Use of Controller Memory Buffer: The attempted use of the Controller Memory Buffer is not supported by the controller.
NVME_SC_PRP_INVALID_OFFSETPRP Offset Invalid: The Offset field for a PRP entry is invalid.
NVME_SC_AWU_EXCEEDEDAtomic Write Unit Exceeded: The length specified exceeds the atomic write unit size.
NVME_SC_OP_DENIEDOperation Denied: The command was denied due to lack of access rights. Refer to the appropriate security specification.
NVME_SC_SGL_INVALID_OFFSETSGL Offset Invalid: The offset specified in a descriptor is invalid. This may occur when using capsules for data transfers in NVMe over Fabrics implementations and an invalid offset in the capsule is specified.
NVME_SC_HOSTID_FORMATHost Identifier Inconsistent Format: The NVM subsystem detected the simultaneous use of 64- bit and 128-bit Host Identifier values on different controllers.
NVME_SC_KAT_EXPIREDKeep Alive Timer Expired: The Keep Alive Timer expired.
NVME_SC_KAT_INVALIDKeep Alive Timeout Invalid: The Keep Alive Timeout value specified is invalid.
NVME_SC_CMD_ABORTED_PREMEPTCommand Aborted due to Preempt and Abort: The command was aborted due to a Reservation Acquire command.
NVME_SC_SANITIZE_FAILEDSanitize Failed: The most recent sanitize operation failed and no recovery action has been successfully completed.
NVME_SC_SANITIZE_IN_PROGRESSSanitize In Progress: The requested function (e.g., command) is prohibited while a sanitize operation is in progress.
NVME_SC_SGL_INVALID_GRANULARITYSGL Data Block Granularity Invalid: The Address alignment or Length granularity for an SGL Data Block descriptor is invalid.
NVME_SC_CMD_IN_CMBQ_NOT_SUPPCommand Not Supported for Queue in CMB: The implementation does not support submission of the command to a Submission Queue in the Controller Memory Buffer or command completion to a Completion Queue in the Controller Memory Buffer.
NVME_SC_NS_WRITE_PROTECTEDNamespace is Write Protected: The command is prohibited while the namespace is write protected as a result of a change in the namespace write protection state as defined by the Namespace Write Protection State Machine.
NVME_SC_CMD_INTERRUPTEDCommand Interrupted: Command processing was interrupted and the controller is unable to successfully complete the command. The host should retry the command.
NVME_SC_TRAN_TPORT_ERRORTransient Transport Error: A transient transport error was detected. If the command is retried on the same controller, the command is likely to succeed. A command that fails with a transient transport error four or more times should be treated as a persistent transport error that is not likely to succeed if retried on the same controller.
NVME_SC_PROHIBITED_BY_CMD_AND_FEATCommand Prohibited by Command and Feature Lockdown: The command was aborted due to command execution being prohibited by the Command and Feature Lockdown.
NVME_SC_ADMIN_CMD_MEDIA_NOT_READYAdmin Command Media Not Ready: The Admin command requires access to media and the media is not ready.
NVME_SC_FDP_DISABLEDCommand is not allowed when Flexible Data Placement is disabled.
NVME_SC_INVALID_PLACEMENT_HANDLE_LISTThe Placement Handle List is invalid due to invalid Reclaim Unit Handle Identifier or valid Reclaim Unit Handle Identifier but restricted or the Placement Handle List number of entries exceeded the maximum number allowed.
NVME_SC_LBA_RANGELBA Out of Range: The command references an LBA that exceeds the size of the namespace.
NVME_SC_CAP_EXCEEDEDCapacity Exceeded: Execution of the command has caused the capacity of the namespace to be exceeded.
NVME_SC_NS_NOT_READYNamespace Not Ready: The namespace is not ready to be accessed as a result of a condition other than a condition that is reported as an Asymmetric Namespace Access condition.
NVME_SC_RESERVATION_CONFLICTReservation Conflict: The command was aborted due to a conflict with a reservation held on the accessed namespace.
NVME_SC_FORMAT_IN_PROGRESSFormat In Progress: A Format NVM command is in progress on the namespace.
NVME_SC_CQ_INVALIDCompletion Queue Invalid: The Completion Queue identifier specified in the command does not exist.
NVME_SC_QID_INVALIDInvalid Queue Identifier: The creation of the I/O Completion Queue failed due to an invalid queue identifier specified as part of the command. An invalid queue identifier is one that is currently in use or one that is outside the range supported by the controller.
NVME_SC_QUEUE_SIZEInvalid Queue Size: The host attempted to create an I/O Completion Queue with an invalid number of entries.
NVME_SC_ABORT_LIMITAbort Command Limit Exceeded: The number of concurrently outstanding Abort commands has exceeded the limit indicated in the Identify Controller data structure.
NVME_SC_ABORT_MISSINGAbort Command is missing: The abort command is missing.
NVME_SC_ASYNC_LIMITAsynchronous Event Request Limit Exceeded: The number of concurrently outstanding Asynchronous Event Request commands has been exceeded.
NVME_SC_FIRMWARE_SLOTInvalid Firmware Slot: The firmware slot indicated is invalid or read only. This error is indicated if the firmware slot exceeds the number supported.
NVME_SC_FIRMWARE_IMAGEInvalid Firmware Image: The firmware image specified for activation is invalid and not loaded by the controller.
NVME_SC_INVALID_VECTORInvalid Interrupt Vector: The creation of the I/O Completion Queue failed due to an invalid interrupt vector specified as part of the command.
NVME_SC_INVALID_LOG_PAGEInvalid Log Page: The log page indicated is invalid. This error condition is also returned if a reserved log page is requested.
NVME_SC_INVALID_FORMATInvalid Format: The LBA Format specified is not supported.
NVME_SC_FW_NEEDS_CONV_RESETFirmware Activation Requires Conventional Reset: The firmware commit was successful, however, activation of the firmware image requires a conventional reset.
NVME_SC_INVALID_QUEUEInvalid Queue Deletion: Invalid I/O Completion Queue specified to delete.
NVME_SC_FEATURE_NOT_SAVEABLEFeature Identifier Not Saveable: The Feature Identifier specified does not support a saveable value.
NVME_SC_FEATURE_NOT_CHANGEABLEFeature Not Changeable: The Feature Identifier is not able to be changed.
NVME_SC_FEATURE_NOT_PER_NSFeature Not Namespace Specific: The Feature Identifier specified is not namespace specific. The Feature Identifier settings apply across all namespaces.
NVME_SC_FW_NEEDS_SUBSYS_RESETFirmware Activation Requires NVM Subsystem Reset: The firmware commit was successful, however, activation of the firmware image requires an NVM Subsystem.
NVME_SC_FW_NEEDS_RESETFirmware Activation Requires Controller Level Reset: The firmware commit was successful; however, the image specified does not support being activated without a reset.
NVME_SC_FW_NEEDS_MAX_TIMEFirmware Activation Requires Maximum Time Violation: The image specified if activated immediately would exceed the Maximum Time for Firmware Activation (MTFA) value reported in Identify Controller.
NVME_SC_FW_ACTIVATE_PROHIBITEDFirmware Activation Prohibited: The image specified is being prohibited from activation by the controller for vendor specific reasons.
NVME_SC_OVERLAPPING_RANGEOverlapping Range: The downloaded firmware image has overlapping ranges.
NVME_SC_NS_INSUFFICIENT_CAPNamespace Insufficient Capacity: Creating the namespace requires more free space than is currently available.
NVME_SC_NS_ID_UNAVAILABLENamespace Identifier Unavailable: The number of namespaces supported has been exceeded.
NVME_SC_NS_ALREADY_ATTACHEDNamespace Already Attached: The controller is already attached to the namespace specified.
NVME_SC_NS_IS_PRIVATENamespace Is Private: The namespace is private and is already attached to one controller.
NVME_SC_NS_NOT_ATTACHEDNamespace Not Attached: The request to detach the controller could not be completed because the controller is not attached to the namespace.
NVME_SC_THIN_PROV_NOT_SUPPThin Provisioning Not Supported: Thin provisioning is not supported by the controller.
NVME_SC_CTRL_LIST_INVALIDController List Invalid: The controller list provided contains invalid controller ids.
NVME_SC_SELF_TEST_IN_PROGRESSDevice Self-test In Progress: The controller or NVM subsystem already has a device self-test operation in process.
NVME_SC_BP_WRITE_PROHIBITEDBoot Partition Write Prohibited: The command is trying to modify a locked Boot Partition.
NVME_SC_INVALID_CTRL_IDInvalid Controller Identifier:
NVME_SC_INVALID_SEC_CTRL_STATEInvalid Secondary Controller State
NVME_SC_INVALID_CTRL_RESOURCESInvalid Number of Controller Resources
NVME_SC_INVALID_RESOURCE_IDInvalid Resource Identifier
NVME_SC_PMR_SAN_PROHIBITEDSanitize Prohibited While Persistent Memory Region is Enabled
NVME_SC_ANA_GROUP_ID_INVALIDANA Group Identifier Invalid: The specified ANA Group Identifier (ANAGRPID) is not supported in the submitted command.
NVME_SC_ANA_ATTACH_FAILEDANA Attach Failed: The controller is not attached to the namespace as a result of an ANA condition.
NVME_SC_INSUFFICIENT_CAPInsufficient Capacity: Requested operation requires more free space than is currently available.
NVME_SC_NS_ATTACHMENT_LIMIT_EXCEEDEDNamespace Attachment Limit Exceeded: Attaching the ns to a controller causes max number of ns attachments allowed to be exceeded.
NVME_SC_PROHIBIT_CMD_EXEC_NOT_SUPPORTEDProhibition of Command Execution Not Supported
NVME_SC_IOCS_NOT_SUPPORTEDI/O Command Set Not Supported
NVME_SC_IOCS_NOT_ENABLEDI/O Command Set Not Enabled
NVME_SC_IOCS_COMBINATION_REJECTEDI/O Command Set Combination Rejected
NVME_SC_INVALID_IOCSInvalid I/O Command Set
NVME_SC_ID_UNAVAILABLEIdentifier Unavailable
NVME_SC_INVALID_DISCOVERY_INFOThe discovery information provided in one or more extended discovery information entries is not applicable for the type of entity selected in the Entity Type (ETYPE) field of the Discovery Information Management command data portion’s header.
NVME_SC_ZONING_DATA_STRUCT_LOCKEDThe requested Zoning data structure is locked on the CDC.
NVME_SC_ZONING_DATA_STRUCT_NOTFNDThe requested Zoning data structure does not exist on the CDC.
NVME_SC_INSUFFICIENT_DISC_RESThe number of discover information entries provided in the data portion of the Discovery Information Management command for a registration task (i.e., TAS field cleared to 0h) exceeds the available capacity for new discovery information entries on the CDC or DDC. This may be a transient condition.
NVME_SC_REQSTD_FUNCTION_DISABLEDFabric Zoning is not enabled on the CDC
NVME_SC_ZONEGRP_ORIGINATOR_INVLDThe NQN contained in the ZoneGroup Originator field does not match the Host NQN used by the DDC to connect to the CDC.
NVME_SC_BAD_ATTRIBUTESConflicting Dataset Management Attributes
NVME_SC_INVALID_PIInvalid Protection Information
NVME_SC_READ_ONLYAttempted Write to Read Only Range
NVME_SC_CMD_SIZE_LIMIT_EXCEEDEDCommand Size Limit Exceeded
NVME_SC_CONNECT_FORMATIncompatible Format: The NVM subsystem does not support the record format specified by the host.
NVME_SC_CONNECT_CTRL_BUSYController Busy: The controller is already associated with a host.
NVME_SC_CONNECT_INVALID_PARAMConnect Invalid Parameters: One or more of the command parameters.
NVME_SC_CONNECT_RESTART_DISCConnect Restart Discovery: The NVM subsystem requested is not available.
NVME_SC_CONNECT_INVALID_HOSTConnect Invalid Host: The host is either not allowed to establish an association to any controller in the NVM subsystem or the host is not allowed to establish an association to the specified controller
NVME_SC_DISCONNECT_INVALID_QTYPEInvalid Queue Type: The command was sent on the wrong queue type.
NVME_SC_DISCOVERY_RESTARTDiscover Restart: The snapshot of the records is now invalid or out of date.
NVME_SC_AUTH_REQUIREDAuthentication Required: NVMe in-band authentication is required and the queue has not yet been authenticated.
NVME_SC_ZNS_INVALID_OP_REQUESTInvalid Zone Operation Request: The operation requested is invalid. This may be due to various conditions, including: attempting to allocate a ZRWA when a zone is not in the ZSE:Empty state; or invalid Flush Explicit ZRWA Range Send Zone Action operation.
NVME_SC_ZNS_ZRWA_RESOURCES_UNAVAILABLEZRWA Resources Unavailable: No ZRWAs are available.
NVME_SC_ZNS_BOUNDARY_ERRORZone Boundary Error: The command specifies logical blocks in more than one zone.
NVME_SC_ZNS_FULLZone Is Full: The accessed zone is in the ZSF:Full state.
NVME_SC_ZNS_READ_ONLYZone Is Read Only: The accessed zone is in the ZSRO:Read Only state.
NVME_SC_ZNS_OFFLINEZone Is Offline: The accessed zone is in the ZSO:Offline state.
NVME_SC_ZNS_INVALID_WRITEZone Invalid Write: The write to a zone was not at the write pointer.
NVME_SC_ZNS_TOO_MANY_ACTIVEToo Many Active Zones: The controller does not allow additional active zones.
NVME_SC_ZNS_TOO_MANY_OPENSToo Many Open Zones: The controller does not allow additional open zones.
NVME_SC_ZNS_INVAL_TRANSITIONInvalid Zone State Transition: The request is not a valid zone state transition.
NVME_SC_WRITE_FAULTWrite Fault: The write data could not be committed to the media.
NVME_SC_READ_ERRORUnrecovered Read Error: The read data could not be recovered from the media.
NVME_SC_GUARD_CHECKEnd-to-end Guard Check Error: The command was aborted due to an end-to-end guard check failure.
NVME_SC_APPTAG_CHECKEnd-to-end Application Tag Check Error: The command was aborted due to an end-to-end application tag check failure.
NVME_SC_REFTAG_CHECKEnd-to-end Reference Tag Check Error: The command was aborted due to an end-to-end reference tag check failure.
NVME_SC_COMPARE_FAILEDCompare Failure: The command failed due to a miscompare during a Compare command.
NVME_SC_ACCESS_DENIEDAccess Denied: Access to the namespace and/or LBA range is denied due to lack of access rights.
NVME_SC_UNWRITTEN_BLOCKDeallocated or Unwritten Logical Block: The command failed due to an attempt to read from or verify an LBA range containing a deallocated or unwritten logical block.
NVME_SC_STORAGE_TAG_CHECKEnd-to-End Storage Tag Check Error: The command was aborted due to an end-to-end storage tag check failure.
NVME_SC_ANA_INTERNAL_PATH_ERRORInternal Path Error: The command was not completed as the result of a controller internal error that is specific to the controller processing the command.
NVME_SC_ANA_PERSISTENT_LOSSAsymmetric Access Persistent Loss: The requested function (e.g., command) is not able to be performed as a result of the relationship between the controller and the namespace being in the ANA Persistent Loss state.
NVME_SC_ANA_INACCESSIBLEAsymmetric Access Inaccessible: The requested function (e.g., command) is not able to be performed as a result of the relationship between the controller and the namespace being in the ANA Inaccessible state.
NVME_SC_ANA_TRANSITIONAsymmetric Access Transition: The requested function (e.g., command) is not able to be performed as a result of the relationship between the controller and the namespace transitioning between Asymmetric Namespace Access states.
NVME_SC_CTRL_PATH_ERRORController Pathing Error: A pathing error was detected by the controller.
NVME_SC_HOST_PATH_ERRORHost Pathing Error: A pathing error was detected by the host.
NVME_SC_CMD_ABORTED_BY_HOSTCommand Aborted By Host: The command was aborted as a result of host action.
NVME_SC_CRDMask to get value of Command Retry Delay index
NVME_SC_MOREMore bit. If set, more status information for this command as part of the Error Information log that may be retrieved with the Get Log Page command.
NVME_SC_DNRDo Not Retry bit. If set, if the same command is re-submitted to any controller in the NVM subsystem, then that re-submitted command is expected to fail.
-
__u16
nvme_status_code_type(__u16 status_field)¶ Returns the NVMe Status Code Type
Parameters
__u16 status_fieldThe NVMe Completion Queue Entry’s Status Field See
enum nvme_status_field
Return
status code type
-
__u16
nvme_status_code(__u16 status_field)¶ Returns the NVMe Status Code
Parameters
__u16 status_fieldThe NVMe Completion Queue Entry’s Status Field See
enum nvme_status_field
Return
status code
-
enum
nvme_status_type¶ type encoding for NVMe return values, when represented as an int.
Constants
NVME_STATUS_TYPE_SHIFTshift value for status bits
NVME_STATUS_TYPE_MASKmask value for status bits
NVME_STATUS_TYPE_NVMENVMe command status value, typically from CDW3
NVME_STATUS_TYPE_MINVMe-MI header status
Description
The nvme_* api returns an int, with negative values indicating an internal or syscall error, zero signifying success, positive values representing the NVMe status.
That latter case (the NVMe status) may represent status values from different parts of the transport/controller/etc, and are at most 16 bits of data. So, we use the most-significant 3 bits of the signed int to indicate which type of status this is.
-
__u32
nvme_status_get_type(int status)¶ extract the type from a nvme_* return value
Parameters
int statusthe (non-negative) return value from the NVMe API
Return
the type component of the status.
-
__u32
nvme_status_get_value(int status)¶ extract the status value from a nvme_* return value
Parameters
int statusthe (non-negative) return value from the NVMe API
Return
the value component of the status; the set of values will depend on the status type.
-
__u32
nvme_status_equals(int status, enum nvme_status_type type, unsigned int value)¶ helper to check a status against a type and value
Parameters
int statusthe (non-negative) return value from the NVMe API
enum nvme_status_type typethe status type
unsigned int valuethe status value
Return
true if status is of the specified type and value
-
enum
nvme_admin_opcode¶ Known NVMe admin opcodes
Constants
nvme_admin_delete_sqDelete I/O Submission Queue
nvme_admin_create_sqCreate I/O Submission Queue
nvme_admin_get_log_pageGet Log Page
nvme_admin_delete_cqDelete I/O Completion Queue
nvme_admin_create_cqCreate I/O Completion Queue
nvme_admin_identifyIdentify
nvme_admin_abort_cmdAbort
nvme_admin_set_featuresSet Features
nvme_admin_get_featuresGet Features
nvme_admin_async_eventAsynchronous Event Request
nvme_admin_ns_mgmtNamespace Management
nvme_admin_fw_commitFirmware Commit
nvme_admin_fw_activateFirmware Commit
nvme_admin_fw_downloadFirmware Image Download
nvme_admin_dev_self_testDevice Self-test
nvme_admin_ns_attachNamespace Attachment
nvme_admin_keep_aliveKeep Alive
nvme_admin_directive_sendDirective Send
nvme_admin_directive_recvDirective Receive
nvme_admin_virtual_mgmtVirtualization Management
nvme_admin_nvme_mi_sendNVMe-MI Send
nvme_admin_nvme_mi_recvNVMe-MI Receive
nvme_admin_capacity_mgmtCapacity Management
nvme_admin_discovery_info_mgmtDiscovery Information Management (DIM)
nvme_admin_fabric_zoning_recvFabric Zoning Receive
nvme_admin_lockdownLockdown
nvme_admin_fabric_zoning_lookupFabric Zoning Lookup
nvme_admin_fabric_zoning_sendFabric Zoning Send
nvme_admin_dbbufDoorbell Buffer Config
nvme_admin_fabricsFabrics Commands
nvme_admin_format_nvmFormat NVM
nvme_admin_security_sendSecurity Send
nvme_admin_security_recvSecurity Receive
nvme_admin_sanitize_nvmSanitize
nvme_admin_get_lba_statusGet LBA Status
-
enum
nvme_identify_cns¶ Identify - CNS Values
Constants
NVME_IDENTIFY_CNS_NSIdentify Namespace data structure
NVME_IDENTIFY_CNS_CTRLIdentify Controller data structure
NVME_IDENTIFY_CNS_NS_ACTIVE_LISTActive Namespace ID list
NVME_IDENTIFY_CNS_NS_DESC_LISTNamespace Identification Descriptor list
NVME_IDENTIFY_CNS_NVMSET_LISTNVM Set List
NVME_IDENTIFY_CNS_CSI_NSI/O Command Set specific Identify Namespace data structure
NVME_IDENTIFY_CNS_CSI_CTRLI/O Command Set specific Identify Controller data structure
NVME_IDENTIFY_CNS_CSI_NS_ACTIVE_LISTActive Namespace ID list associated with the specified I/O Command Set
NVME_IDENTIFY_CNS_CSI_INDEPENDENT_ID_NSI/O Command Set Independent Identify
NVME_IDENTIFY_CNS_NS_USER_DATA_FORMATNamespace user data format
NVME_IDENTIFY_CNS_CSI_NS_USER_DATA_FORMATI/O Command Set specific user data format Namespace data structure
NVME_IDENTIFY_CNS_ALLOCATED_NS_LISTAllocated Namespace ID list
NVME_IDENTIFY_CNS_ALLOCATED_NSIdentify Namespace data structure for the specified allocated NSID
NVME_IDENTIFY_CNS_NS_CTRL_LISTController List of controllers attached to the specified NSID
NVME_IDENTIFY_CNS_CTRL_LISTController List of controllers that exist in the NVM subsystem
NVME_IDENTIFY_CNS_PRIMARY_CTRL_CAPPrimary Controller Capabilities data structure for the specified primary controller
NVME_IDENTIFY_CNS_SECONDARY_CTRL_LISTSecondary Controller list of controllers associated with the primary controller processing the command
NVME_IDENTIFY_CNS_NS_GRANULARITYA Namespace Granularity List
NVME_IDENTIFY_CNS_UUID_LISTA UUID List
NVME_IDENTIFY_CNS_DOMAIN_LISTDomain List
NVME_IDENTIFY_CNS_ENDURANCE_GROUP_IDEndurance Group List
NVME_IDENTIFY_CNS_CSI_ALLOCATED_NS_LISTI/O Command Set specific Allocated Namespace ID list
NVME_IDENTIFY_CNS_CSI_ID_NS_DATA_STRUCTUREI/O Command Set specific ID Namespace Data Structure for Allocated Namespace ID
NVME_IDENTIFY_CNS_COMMAND_SET_STRUCTUREBase Specification 2.0a section 5.17.2.21
-
enum
nvme_cmd_get_log_lid¶ Get Log Page -Log Page Identifiers
Constants
NVME_LOG_LID_SUPPORTED_LOG_PAGESSupported Log Pages
NVME_LOG_LID_ERRORError Information
NVME_LOG_LID_SMARTSMART / Health Information
NVME_LOG_LID_FW_SLOTFirmware Slot Information
NVME_LOG_LID_CHANGED_NSChanged Namespace List
NVME_LOG_LID_CMD_EFFECTSCommands Supported and Effects
NVME_LOG_LID_DEVICE_SELF_TESTDevice Self-test
NVME_LOG_LID_TELEMETRY_HOSTTelemetry Host-Initiated
NVME_LOG_LID_TELEMETRY_CTRLTelemetry Controller-Initiated
NVME_LOG_LID_ENDURANCE_GROUPEndurance Group Information
NVME_LOG_LID_PREDICTABLE_LAT_NVMSETPredictable Latency Per NVM Set
NVME_LOG_LID_PREDICTABLE_LAT_AGGPredictable Latency Event Aggregate
NVME_LOG_LID_ANAAsymmetric Namespace Access
NVME_LOG_LID_PERSISTENT_EVENTPersistent Event Log
NVME_LOG_LID_LBA_STATUSLBA Status Information
NVME_LOG_LID_ENDURANCE_GRP_EVTEndurance Group Event Aggregate
NVME_LOG_LID_MEDIA_UNIT_STATUSMedia Unit Status
NVME_LOG_LID_SUPPORTED_CAP_CONFIG_LISTSupported Capacity Configuration Lis
NVME_LOG_LID_FID_SUPPORTED_EFFECTSFeature Identifiers Supported and Effects
NVME_LOG_LID_MI_CMD_SUPPORTED_EFFECTSNVMe-MI Commands Supported and Effects
NVME_LOG_LID_BOOT_PARTITIONBoot Partition
NVME_LOG_LID_PHY_RX_EOMPhysical Interface Receiver Eye Opening Measurement
NVME_LOG_LID_FDP_CONFIGSFDP Configurations
NVME_LOG_LID_FDP_RUH_USAGEReclaim Unit Handle Usage
NVME_LOG_LID_FDP_STATSFDP Statistics
NVME_LOG_LID_FDP_EVENTSFDP Events
NVME_LOG_LID_DISCOVERDiscovery
NVME_LOG_LID_RESERVATIONReservation Notification
NVME_LOG_LID_SANITIZESanitize Status
NVME_LOG_LID_ZNS_CHANGED_ZONESChanged Zone List
-
enum
nvme_features_id¶ Features - Feature Identifiers
Constants
NVME_FEAT_FID_ARBITRATIONArbitration
NVME_FEAT_FID_POWER_MGMTPower Management
NVME_FEAT_FID_LBA_RANGELBA Range Type
NVME_FEAT_FID_TEMP_THRESHTemperature Threshold
NVME_FEAT_FID_ERR_RECOVERYError Recovery
NVME_FEAT_FID_VOLATILE_WCVolatile Write Cache
NVME_FEAT_FID_NUM_QUEUESNumber of Queues
NVME_FEAT_FID_IRQ_COALESCEInterrupt Coalescing
NVME_FEAT_FID_IRQ_CONFIGInterrupt Vector Configuration
NVME_FEAT_FID_WRITE_ATOMICWrite Atomicity Normal
NVME_FEAT_FID_ASYNC_EVENTAsynchronous Event Configuration
NVME_FEAT_FID_AUTO_PSTAutonomous Power State Transition
NVME_FEAT_FID_HOST_MEM_BUFHost Memory Buffer
NVME_FEAT_FID_TIMESTAMPTimestamp
NVME_FEAT_FID_KATOKeep Alive Timer
NVME_FEAT_FID_HCTMHost Controlled Thermal Management
NVME_FEAT_FID_NOPSCNon-Operational Power State Config
NVME_FEAT_FID_RRLRead Recovery Level Config
NVME_FEAT_FID_PLM_CONFIGPredictable Latency Mode Config
NVME_FEAT_FID_PLM_WINDOWPredictable Latency Mode Window
NVME_FEAT_FID_LBA_STS_INTERVALLBA Status Information Report Interval
NVME_FEAT_FID_HOST_BEHAVIORHost Behavior Support
NVME_FEAT_FID_SANITIZEEndurance Group Event Configuration
NVME_FEAT_FID_ENDURANCE_EVT_CFGEndurance Group Event Configuration
NVME_FEAT_FID_IOCS_PROFILEI/O Command Set Profile
NVME_FEAT_FID_SPINUP_CONTROLSpinup Control
NVME_FEAT_FID_FDPFlexible Data Placement
NVME_FEAT_FID_FDP_EVENTSFDP Events
NVME_FEAT_FID_ENH_CTRL_METADATAEnhanced Controller Metadata
NVME_FEAT_FID_CTRL_METADATAController Metadata
NVME_FEAT_FID_NS_METADATANamespace Metadata
NVME_FEAT_FID_SW_PROGRESSSoftware Progress Marker
NVME_FEAT_FID_HOST_IDHost Identifier
NVME_FEAT_FID_RESV_MASKReservation Notification Mask
NVME_FEAT_FID_RESV_PERSISTReservation Persistence
NVME_FEAT_FID_WRITE_PROTECTNamespace Write Protection Config
-
enum
nvme_feat¶ Features Access Shifts/Masks values
Constants
NVME_FEAT_ARBITRATION_BURST_SHIFT
NVME_FEAT_ARBITRATION_BURST_MASK
NVME_FEAT_ARBITRATION_LPW_SHIFT
NVME_FEAT_ARBITRATION_LPW_MASK
NVME_FEAT_ARBITRATION_MPW_SHIFT
NVME_FEAT_ARBITRATION_MPW_MASK
NVME_FEAT_ARBITRATION_HPW_SHIFT
NVME_FEAT_ARBITRATION_HPW_MASK
NVME_FEAT_PWRMGMT_PS_SHIFT
NVME_FEAT_PWRMGMT_PS_MASK
NVME_FEAT_PWRMGMT_WH_SHIFT
NVME_FEAT_PWRMGMT_WH_MASK
NVME_FEAT_LBAR_NR_SHIFT
NVME_FEAT_LBAR_NR_MASK
NVME_FEAT_TT_TMPTH_SHIFT
NVME_FEAT_TT_TMPTH_MASK
NVME_FEAT_TT_TMPSEL_SHIFT
NVME_FEAT_TT_TMPSEL_MASK
NVME_FEAT_TT_THSEL_SHIFT
NVME_FEAT_TT_THSEL_MASK
NVME_FEAT_ERROR_RECOVERY_TLER_SHIFT
NVME_FEAT_ERROR_RECOVERY_TLER_MASK
NVME_FEAT_ERROR_RECOVERY_DULBE_SHIFT
NVME_FEAT_ERROR_RECOVERY_DULBE_MASK
NVME_FEAT_VWC_WCE_SHIFT
NVME_FEAT_VWC_WCE_MASK
NVME_FEAT_NRQS_NSQR_SHIFT
NVME_FEAT_NRQS_NSQR_MASK
NVME_FEAT_NRQS_NCQR_SHIFT
NVME_FEAT_NRQS_NCQR_MASK
NVME_FEAT_IRQC_THR_SHIFT
NVME_FEAT_IRQC_THR_MASK
NVME_FEAT_IRQC_TIME_SHIFT
NVME_FEAT_IRQC_TIME_MASK
NVME_FEAT_ICFG_IV_SHIFT
NVME_FEAT_ICFG_IV_MASK
NVME_FEAT_ICFG_CD_SHIFT
NVME_FEAT_ICFG_CD_MASK
NVME_FEAT_WA_DN_SHIFT
NVME_FEAT_WA_DN_MASK
NVME_FEAT_AE_SMART_SHIFT
NVME_FEAT_AE_SMART_MASK
NVME_FEAT_AE_NAN_SHIFT
NVME_FEAT_AE_NAN_MASK
NVME_FEAT_AE_FW_SHIFT
NVME_FEAT_AE_FW_MASK
NVME_FEAT_AE_TELEM_SHIFT
NVME_FEAT_AE_TELEM_MASK
NVME_FEAT_AE_ANA_SHIFT
NVME_FEAT_AE_ANA_MASK
NVME_FEAT_AE_PLA_SHIFT
NVME_FEAT_AE_PLA_MASK
NVME_FEAT_AE_LBAS_SHIFT
NVME_FEAT_AE_LBAS_MASK
NVME_FEAT_AE_EGA_SHIFT
NVME_FEAT_AE_EGA_MASK
NVME_FEAT_APST_APSTE_SHIFT
NVME_FEAT_APST_APSTE_MASK
NVME_FEAT_HMEM_EHM_SHIFT
NVME_FEAT_HMEM_EHM_MASK
NVME_FEAT_HCTM_TMT2_SHIFT
NVME_FEAT_HCTM_TMT2_MASK
NVME_FEAT_HCTM_TMT1_SHIFT
NVME_FEAT_HCTM_TMT1_MASK
NVME_FEAT_NOPS_NOPPME_SHIFT
NVME_FEAT_NOPS_NOPPME_MASK
NVME_FEAT_RRL_RRL_SHIFT
NVME_FEAT_RRL_RRL_MASK
NVME_FEAT_PLM_PLME_SHIFT
NVME_FEAT_PLM_PLME_MASK
NVME_FEAT_PLMW_WS_SHIFT
NVME_FEAT_PLMW_WS_MASK
NVME_FEAT_LBAS_LSIRI_SHIFT
NVME_FEAT_LBAS_LSIRI_MASK
NVME_FEAT_LBAS_LSIPI_SHIFT
NVME_FEAT_LBAS_LSIPI_MASK
NVME_FEAT_SC_NODRM_SHIFT
NVME_FEAT_SC_NODRM_MASK
NVME_FEAT_EG_ENDGID_SHIFT
NVME_FEAT_EG_ENDGID_MASK
NVME_FEAT_EG_EGCW_SHIFT
NVME_FEAT_EG_EGCW_MASK
NVME_FEAT_SPM_PBSLC_SHIFT
NVME_FEAT_SPM_PBSLC_MASK
NVME_FEAT_HOSTID_EXHID_SHIFT
NVME_FEAT_HOSTID_EXHID_MASK
NVME_FEAT_RM_REGPRE_SHIFT
NVME_FEAT_RM_REGPRE_MASK
NVME_FEAT_RM_RESREL_SHIFT
NVME_FEAT_RM_RESREL_MASK
NVME_FEAT_RM_RESPRE_SHIFT
NVME_FEAT_RM_RESPRE_MASK
NVME_FEAT_RP_PTPL_SHIFT
NVME_FEAT_RP_PTPL_MASK
NVME_FEAT_WP_WPS_SHIFT
NVME_FEAT_WP_WPS_MASK
NVME_FEAT_IOCSP_IOCSCI_SHIFT
NVME_FEAT_IOCSP_IOCSCI_MASK
NVME_FEAT_FDP_ENABLED_SHIFT
NVME_FEAT_FDP_ENABLED_MASK
NVME_FEAT_FDP_INDEX_SHIFT
NVME_FEAT_FDP_INDEX_MASK
NVME_FEAT_FDP_EVENTS_ENABLE_SHIFT
NVME_FEAT_FDP_EVENTS_ENABLE_MASK
-
enum
nvme_get_features_sel¶ Get Features - Select
Constants
NVME_GET_FEATURES_SEL_CURRENTCurrent value
NVME_GET_FEATURES_SEL_DEFAULTDefault value
NVME_GET_FEATURES_SEL_SAVEDSaved value
NVME_GET_FEATURES_SEL_SUPPORTEDSupported capabilities
-
enum
nvme_cmd_format_mset¶ Format NVM - Metadata Settings
Constants
NVME_FORMAT_MSET_SEPARATEindicates that the metadata is transferred as part of a separate buffer.
NVME_FORMAT_MSET_EXTENDEDindicates that the metadata is transferred as part of an extended data LBA.
-
enum
nvme_cmd_format_pi¶ Format NVM - Protection Information
Constants
NVME_FORMAT_PI_DISABLEProtection information is not enabled.
NVME_FORMAT_PI_TYPE1Protection information is enabled, Type 1.
NVME_FORMAT_PI_TYPE2Protection information is enabled, Type 2.
NVME_FORMAT_PI_TYPE3Protection information is enabled, Type 3.
-
enum
nvme_cmd_format_pil¶ Format NVM - Protection Information Location
Constants
NVME_FORMAT_PIL_LASTProtection information is transferred as the last bytes of metadata.
NVME_FORMAT_PIL_FIRSTProtection information is transferred as the first bytes of metadata.
-
enum
nvme_cmd_format_ses¶ Format NVM - Secure Erase Settings
Constants
NVME_FORMAT_SES_NONENo secure erase operation requested.
NVME_FORMAT_SES_USER_DATA_ERASEUser Data Erase: All user data shall be erased, contents of the user data after the erase is indeterminate (e.g. the user data may be zero filled, one filled, etc.). If a User Data Erase is requested and all affected user data is encrypted, then the controller is allowed to use a cryptographic erase to perform the requested User Data Erase.
NVME_FORMAT_SES_CRYPTO_ERASECryptographic Erase: All user data shall be erased cryptographically. This is accomplished by deleting the encryption key.
-
enum
nvme_ns_mgmt_sel¶ Namespace Management - Select
Constants
NVME_NS_MGMT_SEL_CREATENamespace Create selection
NVME_NS_MGMT_SEL_DELETENamespace Delete selection
-
enum
nvme_ns_attach_sel¶ Namespace Attachment - Select
Constants
NVME_NS_ATTACH_SEL_CTRL_ATTACHNamespace attach selection
NVME_NS_ATTACH_SEL_CTRL_DEATTACHNamespace detach selection
-
enum
nvme_fw_commit_ca¶ Firmware Commit - Commit Action
Constants
NVME_FW_COMMIT_CA_REPLACEDownloaded image replaces the existing image, if any, in the specified Firmware Slot. The newly placed image is not activated.
NVME_FW_COMMIT_CA_REPLACE_AND_ACTIVATEDownloaded image replaces the existing image, if any, in the specified Firmware Slot. The newly placed image is activated at the next Controller Level Reset.
NVME_FW_COMMIT_CA_SET_ACTIVEThe existing image in the specified Firmware Slot is activated at the next Controller Level Reset.
NVME_FW_COMMIT_CA_REPLACE_AND_ACTIVATE_IMMEDIATEDownloaded image replaces the existing image, if any, in the specified Firmware Slot and is then activated immediately. If there is not a newly downloaded image, then the existing image in the specified firmware slot is activated immediately.
NVME_FW_COMMIT_CA_REPLACE_BOOT_PARTITIONDownloaded image replaces the Boot Partition specified by the Boot Partition ID field.
NVME_FW_COMMIT_CA_ACTIVATE_BOOT_PARTITIONMark the Boot Partition specified in the BPID field as active and update BPINFO.ABPID.
-
enum
nvme_directive_dtype¶ Directive Types
Constants
NVME_DIRECTIVE_DTYPE_IDENTIFYIdentify directive type
NVME_DIRECTIVE_DTYPE_STREAMSStreams directive type
-
enum
nvme_directive_receive_doper¶ Directive Receive Directive Operation
Constants
NVME_DIRECTIVE_RECEIVE_IDENTIFY_DOPER_PARAM
NVME_DIRECTIVE_RECEIVE_STREAMS_DOPER_PARAM
NVME_DIRECTIVE_RECEIVE_STREAMS_DOPER_STATUS
NVME_DIRECTIVE_RECEIVE_STREAMS_DOPER_RESOURCE
-
enum
nvme_directive_send_doper¶ Directive Send Directive Operation
Constants
NVME_DIRECTIVE_SEND_IDENTIFY_DOPER_ENDIR
NVME_DIRECTIVE_SEND_STREAMS_DOPER_RELEASE_IDENTIFIER
NVME_DIRECTIVE_SEND_STREAMS_DOPER_RELEASE_RESOURCE
-
enum
nvme_directive_send_identify_endir¶ Enable Directive
Constants
NVME_DIRECTIVE_SEND_IDENTIFY_ENDIR_DISABLE
NVME_DIRECTIVE_SEND_IDENTIFY_ENDIR_ENABLE
-
enum
nvme_sanitize_sanact¶ Sanitize Action
Constants
NVME_SANITIZE_SANACT_EXIT_FAILUREExit Failure Mode.
NVME_SANITIZE_SANACT_START_BLOCK_ERASEStart a Block Erase sanitize operation.
NVME_SANITIZE_SANACT_START_OVERWRITEStart an Overwrite sanitize operation.
NVME_SANITIZE_SANACT_START_CRYPTO_ERASEStart a Crypto Erase sanitize operation.
-
enum
nvme_dst_stc¶ Action taken by the Device Self-test command
Constants
NVME_DST_STC_SHORTStart a short device self-test operation
NVME_DST_STC_LONGStart an extended device self-test operation
NVME_DST_STC_VSStart a vendor specific device self-test operation
NVME_DST_STC_ABORTAbort device self-test operation
-
enum
nvme_virt_mgmt_act¶ Virtualization Management - Action
Constants
NVME_VIRT_MGMT_ACT_PRIM_CTRL_FLEX_ALLOCPrimary Controller Flexible Allocation
NVME_VIRT_MGMT_ACT_OFFLINE_SEC_CTRLSecondary Controller Offline
NVME_VIRT_MGMT_ACT_ASSIGN_SEC_CTRLSecondary Controller Assign
NVME_VIRT_MGMT_ACT_ONLINE_SEC_CTRLSecondary Controller Online
-
enum
nvme_virt_mgmt_rt¶ Virtualization Management - Resource Type
Constants
NVME_VIRT_MGMT_RT_VQ_RESOURCEVQ Resources
NVME_VIRT_MGMT_RT_VI_RESOURCEVI Resources
-
enum
nvme_ns_write_protect_cfg¶ Write Protection - Write Protection State
Constants
NVME_NS_WP_CFG_NONENo Write Protect
NVME_NS_WP_CFG_PROTECTWrite Protect
NVME_NS_WP_CFG_PROTECT_POWER_CYCLEWrite Protect Until Power Cycle
NVME_NS_WP_CFG_PROTECT_PERMANENTPermanent Write Protect
-
enum
nvme_log_ana_lsp¶ Asymmetric Namespace Access - Return Groups Only
Constants
NVME_LOG_ANA_LSP_RGO_NAMESPACES
NVME_LOG_ANA_LSP_RGO_GROUPS_ONLY
-
enum
nvme_log_phy_rx_eom_action¶ Physical Interface Receiver Eye Opening Measurement Action
Constants
NVME_LOG_PHY_RX_EOM_READRead Log Data
NVME_LOG_PHY_RX_EOM_START_READStart Measurement and Read Log Data
NVME_LOG_PHY_RX_EOM_ABORT_CLEARAbort Measurement and Clear Log Data
-
enum
nvme_log_phy_rx_eom_quality¶ Physical Interface Receiver Eye Opening Measurement Quality
Constants
NVME_LOG_PHY_RX_EOM_GOOD<= Better Quality
NVME_LOG_PHY_RX_EOM_BETTER<= Best Quality, >= Good Quality
NVME_LOG_PHY_RX_EOM_BEST>= Better Quality
-
enum
nvme_pevent_log_action¶ Persistent Event Log - Action
Constants
NVME_PEVENT_LOG_READRead Log Data
NVME_PEVENT_LOG_EST_CTX_AND_READEstablish Context and Read Log Data
NVME_PEVENT_LOG_RELEASE_CTXRelease Context
-
enum
nvme_feat_tmpthresh_thsel¶ Temperature Threshold - Threshold Type Select
Constants
NVME_FEATURE_TEMPTHRESH_THSEL_OVEROver temperature threshold select
NVME_FEATURE_TEMPTHRESH_THSEL_UNDERUnder temperature threshold select
-
enum
nvme_features_async_event_config_flags¶ Asynchronous Event Configuration configuration flags
Constants
NVME_FEATURE_AENCFG_SMART_CRIT_SPARE
NVME_FEATURE_AENCFG_SMART_CRIT_TEMPERATURE
NVME_FEATURE_AENCFG_SMART_CRIT_DEGRADED
NVME_FEATURE_AENCFG_SMART_CRIT_READ_ONLY
NVME_FEATURE_AENCFG_SMART_CRIT_VOLATILE_BACKUP
NVME_FEATURE_AENCFG_SMART_CRIT_READ_ONLY_PMR
NVME_FEATURE_AENCFG_NOTICE_NAMESPACE_ATTRIBUTES
NVME_FEATURE_AENCFG_NOTICE_FIRMWARE_ACTIVATION
NVME_FEATURE_AENCFG_NOTICE_TELEMETRY_LOG
NVME_FEATURE_AENCFG_NOTICE_ANA_CHANGE
NVME_FEATURE_AENCFG_NOTICE_PL_EVENT
NVME_FEATURE_AENCFG_NOTICE_LBA_STATUS
NVME_FEATURE_AENCFG_NOTICE_EG_EVENT
NVME_FEATURE_AENCFG_NOTICE_DISCOVERY_CHANGE
-
enum
nvme_feat_plm_window_select¶ Predictable Latency Per NVM Set Log
Constants
NVME_FEATURE_PLM_DTWINDeterministic Window select
NVME_FEATURE_PLM_NDWINNon-Deterministic Window select
-
enum
nvme_feat_resv_notify_flags¶ Reservation Notification Configuration
Constants
NVME_FEAT_RESV_NOTIFY_REGPREMask Registration Preempted Notification
NVME_FEAT_RESV_NOTIFY_RESRELMask Reservation Released Notification
NVME_FEAT_RESV_NOTIFY_RESPREMask Reservation Preempted Notification
-
enum
nvme_feat_nswpcfg_state¶ Write Protection - Write Protection State
Constants
NVME_FEAT_NS_NO_WRITE_PROTECTNo Write Protect
NVME_FEAT_NS_WRITE_PROTECTWrite Protect
NVME_FEAT_NS_WRITE_PROTECT_PWR_CYCLEWrite Protect Until Power Cycle
NVME_FEAT_NS_WRITE_PROTECT_PERMANENTPermanent Write Protect
-
enum
nvme_fctype¶ Fabrics Command Types
Constants
nvme_fabrics_type_property_setProperty set
nvme_fabrics_type_connectConnect
nvme_fabrics_type_property_getProperty Get
nvme_fabrics_type_auth_sendAuthentication Send
nvme_fabrics_type_auth_receiveAuthentication Receive
nvme_fabrics_type_disconnectDisconnect
-
enum
nvme_data_tfr¶ Data transfer direction of the command
Constants
NVME_DATA_TFR_NO_DATA_TFRNo data transfer
NVME_DATA_TFR_HOST_TO_CTRLHost to controller
NVME_DATA_TFR_CTRL_TO_HOSTController to host
NVME_DATA_TFR_BIDIRECTIONALBidirectional
-
enum
nvme_io_opcode¶ Opcodes for I/O Commands
Constants
nvme_cmd_flushFlush
nvme_cmd_writeWrite
nvme_cmd_readRead
nvme_cmd_write_uncorWrite Uncorrectable
nvme_cmd_compareCompare
nvme_cmd_write_zeroeswrite Zeros
nvme_cmd_dsmDataset Management
nvme_cmd_verifyVerify
nvme_cmd_resv_registerReservation Register
nvme_cmd_resv_reportReservation Report
nvme_cmd_resv_acquireReservation Acquire
nvme_cmd_io_mgmt_recvI/O Management Receive
nvme_cmd_resv_releaseReservation Release
nvme_cmd_copyCopy
nvme_cmd_io_mgmt_sendI/O Management Send
nvme_zns_cmd_mgmt_sendZone Management Send
nvme_zns_cmd_mgmt_recvZone Management Receive
nvme_zns_cmd_appendZone Append
-
enum
nvme_io_control_flags¶ I/O control flags
Constants
NVME_IO_DTYPE_STREAMSDirective Type Streams
NVME_IO_STCStorage Tag Check
NVME_IO_DEACDeallocate
NVME_IO_ZNS_APPEND_PIREMAPProtection Information Remap
NVME_IO_PRINFO_PRCHK_REFProtection Information Check Reference Tag
NVME_IO_PRINFO_PRCHK_APPProtection Information Check Application Tag
NVME_IO_PRINFO_PRCHK_GUARDProtection Information Check Guard field
NVME_IO_PRINFO_PRACTProtection Information Action
NVME_IO_FUAForce Unit Access
NVME_IO_LRLimited Retry
-
enum
nvme_io_dsm_flags¶ Dataset Management flags
Constants
NVME_IO_DSM_FREQ_UNSPECNo frequency information provided
NVME_IO_DSM_FREQ_TYPICALTypical number of reads and writes expected for this LBA range
NVME_IO_DSM_FREQ_RAREInfrequent writes and infrequent reads to the LBA range indicated
NVME_IO_DSM_FREQ_READSInfrequent writes and frequent reads to the LBA range indicated
NVME_IO_DSM_FREQ_WRITESFrequent writes and infrequent reads to the LBA range indicated
NVME_IO_DSM_FREQ_RWFrequent writes and frequent reads to the LBA range indicated
NVME_IO_DSM_FREQ_ONCE
NVME_IO_DSM_FREQ_PREFETCH
NVME_IO_DSM_FREQ_TEMP
NVME_IO_DSM_LATENCY_NONENo latency information provided
NVME_IO_DSM_LATENCY_IDLELonger latency acceptable
NVME_IO_DSM_LATENCY_NORMTypical latency
NVME_IO_DSM_LATENCY_LOWSmallest possible latency
NVME_IO_DSM_SEQ_REQ
NVME_IO_DSM_COMPRESSED
-
enum
nvme_dsm_attributes¶ Dataset Management attributes
Constants
NVME_DSMGMT_IDRAttribute -Integral Dataset for Read
NVME_DSMGMT_IDWAttribute - Integral Dataset for Write
NVME_DSMGMT_ADAttribute - Deallocate
-
enum
nvme_resv_rtype¶ Reservation Type Encoding
Constants
NVME_RESERVATION_RTYPE_WEWrite Exclusive Reservation
NVME_RESERVATION_RTYPE_EAExclusive Access Reservation
NVME_RESERVATION_RTYPE_WEROWrite Exclusive - Registrants Only Reservation
NVME_RESERVATION_RTYPE_EAROExclusive Access - Registrants Only Reservation
NVME_RESERVATION_RTYPE_WEARWrite Exclusive - All Registrants Reservation
NVME_RESERVATION_RTYPE_EAARExclusive Access - All Registrants Reservation
-
enum
nvme_resv_racqa¶ Reservation Acquire - Reservation Acquire Action
Constants
NVME_RESERVATION_RACQA_ACQUIREAcquire
NVME_RESERVATION_RACQA_PREEMPTPreempt
NVME_RESERVATION_RACQA_PREEMPT_AND_ABORTPreempt and Abort
-
enum
nvme_resv_rrega¶ Reservation Register - Reservation Register Action
Constants
NVME_RESERVATION_RREGA_REGISTER_KEYRegister Reservation Key
NVME_RESERVATION_RREGA_UNREGISTER_KEYUnregister Reservation Key
NVME_RESERVATION_RREGA_REPLACE_KEYReplace Reservation Key
-
enum
nvme_resv_cptpl¶ Reservation Register - Change Persist Through Power Loss State
Constants
NVME_RESERVATION_CPTPL_NO_CHANGENo change to PTPL state
NVME_RESERVATION_CPTPL_CLEARReservations are released and registrants are cleared on a power on
NVME_RESERVATION_CPTPL_PERSISTReservations and registrants persist across a power loss
-
enum
nvme_resv_rrela¶ Reservation Release - Reservation Release Action
Constants
NVME_RESERVATION_RRELA_RELEASERelease
NVME_RESERVATION_RRELA_CLEARClear
-
enum
nvme_zns_send_action¶ Zone Management Send - Zone Send Action
Constants
NVME_ZNS_ZSA_CLOSEClose Zone
NVME_ZNS_ZSA_FINISHFinish Zone
NVME_ZNS_ZSA_OPENOpen Zone
NVME_ZNS_ZSA_RESETReset Zone
NVME_ZNS_ZSA_OFFLINEOffline Zone
NVME_ZNS_ZSA_SET_DESC_EXTSet Zone Descriptor Extension
NVME_ZNS_ZSA_ZRWA_FLUSHFlush
-
enum
nvme_zns_recv_action¶ Zone Management Receive - Zone Receive Action Specific Features
Constants
NVME_ZNS_ZRA_REPORT_ZONESReport Zones
NVME_ZNS_ZRA_EXTENDED_REPORT_ZONESExtended Report Zones
-
enum
nvme_zns_report_options¶ Zone Management Receive - Zone Receive Action Specific Field
Constants
NVME_ZNS_ZRAS_REPORT_ALLList all zones
NVME_ZNS_ZRAS_REPORT_EMPTYList the zones in the ZSE:Empty state
NVME_ZNS_ZRAS_REPORT_IMPL_OPENEDList the zones in the ZSIO:Implicitly Opened state
NVME_ZNS_ZRAS_REPORT_EXPL_OPENEDList the zones in the ZSEO:Explicitly Opened state
NVME_ZNS_ZRAS_REPORT_CLOSEDList the zones in the ZSC:Closed state
NVME_ZNS_ZRAS_REPORT_FULLList the zones in the ZSF:Full state
NVME_ZNS_ZRAS_REPORT_READ_ONLYList the zones in the ZSRO:Read Only state
NVME_ZNS_ZRAS_REPORT_OFFLINEList the zones in the ZSO:Offline state
-
enum
nvme_io_mgmt_recv_mo¶ I/O Management Receive - Management Operation
Constants
NVME_IO_MGMT_RECV_RUH_STATUSReclaim Unit Handle Status
-
enum
nvme_io_mgmt_send_mo¶ I/O Management Send - Management Operation
Constants
NVME_IO_MGMT_SEND_RUH_UPDATEReclaim Unit Handle Update
-
struct
nvme_ns_mgmt_host_sw_specified¶ Namespace management Host Software Specified Fields.
Definition
struct nvme_ns_mgmt_host_sw_specified {
__le64 nsze;
__le64 ncap;
__u8 rsvd16[10];
__u8 flbas;
__u8 rsvd27[2];
__u8 dps;
__u8 nmic;
__u8 rsvd31[61];
__le32 anagrpid;
__u8 rsvd96[4];
__le16 nvmsetid;
__le16 endgid;
__u8 rsvd104[280];
__le64 lbstm;
__le16 nphndls;
__u8 rsvd394[105];
union {
__u8 rsvd499[13];
struct {
__u8 znsco;
__le32 rar;
__le32 ror;
__le32 rnumzrwa;
} zns;
};
__le16 phndl[128];
__u8 rsvd768[3328];
};
Members
nszeNamespace Size indicates the total size of the namespace in logical blocks. The number of logical blocks is based on the formatted LBA size.
ncapNamespace Capacity indicates the maximum number of logical blocks that may be allocated in the namespace at any point in time. The number of logical blocks is based on the formatted LBA size.
rsvd16Reserved
flbasFormatted LBA Size, see
enum nvme_id_ns_flbas.rsvd27Reserved
dpsEnd-to-end Data Protection Type Settings, see
enum nvme_id_ns_dps.nmicNamespace Multi-path I/O and Namespace Sharing Capabilities, see
enum nvme_id_ns_nmic.rsvd31Reserved
anagrpidANA Group Identifier indicates the ANA Group Identifier of the ANA group of which the namespace is a member.
rsvd96Reserved
nvmsetidNVM Set Identifier indicates the NVM Set with which this namespace is associated.
endgidEndurance Group Identifier indicates the Endurance Group with which this namespace is associated.
rsvd104Reserved
lbstmLogical Block Storage Tag Mask Identifies the mask for the Storage Tag field for the protection information
nphndlsNumber of Placement Handles specifies the number of Placement Handles included in the Placement Handle List
rsvd394Reserved
{unnamed_union}anonymous
rsvd499Reserved for I/O Command Sets that extend this specification.
znsrsvd499( Zoned Namespace Command Set specific field )
phndlPlacement Handle Associated RUH : This field specifies the Reclaim Unit Handle Identifier to be associated with the Placement Handle value. If the Flexible Data Placement capability is not supported or not enabled in specified Endurance Group, then the controller shall ignore this field.
rsvd768Reserved
ioctl.h
Linux NVMe ioctl interface functions
-
struct
nvme_passthru_cmd¶ nvme passthrough command structure
Definition
struct nvme_passthru_cmd {
__u8 opcode;
__u8 flags;
__u16 rsvd1;
__u32 nsid;
__u32 cdw2;
__u32 cdw3;
__u64 metadata;
__u64 addr;
__u32 metadata_len;
__u32 data_len;
__u32 cdw10;
__u32 cdw11;
__u32 cdw12;
__u32 cdw13;
__u32 cdw14;
__u32 cdw15;
__u32 timeout_ms;
__u32 result;
};
Members
opcodeOperation code, see
enum nvme_io_opcodesandenum nvme_admin_opcodesflagsNot supported: intended for command flags (eg: SGL, FUSE)
rsvd1Reserved for future use
nsidNamespace Identifier, or Fabrics type
cdw2Command Dword 2 (no spec defined use)
cdw3Command Dword 3 (no spec defined use)
metadataUser space address to metadata buffer (NULL if not used)
addrUser space address to data buffer (NULL if not used)
metadata_lenMetadata buffer transfer length
data_lenData buffer transfer length
cdw10Command Dword 10 (command specific)
cdw11Command Dword 11 (command specific)
cdw12Command Dword 12 (command specific)
cdw13Command Dword 13 (command specific)
cdw14Command Dword 14 (command specific)
cdw15Command Dword 15 (command specific)
timeout_msIf non-zero, overrides system default timeout in milliseconds
resultSet on completion to the command’s CQE DWORD 0 controller response
-
struct
nvme_passthru_cmd64¶ 64-bit nvme passthrough command structure
Definition
struct nvme_passthru_cmd64 {
__u8 opcode;
__u8 flags;
__u16 rsvd1;
__u32 nsid;
__u32 cdw2;
__u32 cdw3;
__u64 metadata;
__u64 addr;
__u32 metadata_len;
__u32 data_len;
__u32 cdw10;
__u32 cdw11;
__u32 cdw12;
__u32 cdw13;
__u32 cdw14;
__u32 cdw15;
__u32 timeout_ms;
__u32 rsvd2;
__u64 result;
};
Members
opcodeOperation code, see
enum nvme_io_opcodesandenum nvme_admin_opcodesflagsNot supported: intended for command flags (eg: SGL, FUSE)
rsvd1Reserved for future use
nsidNamespace Identifier, or Fabrics type
cdw2Command Dword 2 (no spec defined use)
cdw3Command Dword 3 (no spec defined use)
metadataUser space address to metadata buffer (NULL if not used)
addrUser space address to data buffer (NULL if not used)
metadata_lenMetadata buffer transfer length
data_lenData buffer transfer length
cdw10Command Dword 10 (command specific)
cdw11Command Dword 11 (command specific)
cdw12Command Dword 12 (command specific)
cdw13Command Dword 13 (command specific)
cdw14Command Dword 14 (command specific)
cdw15Command Dword 15 (command specific)
timeout_msIf non-zero, overrides system default timeout in milliseconds
rsvd2Reserved for future use (and fills an implicit struct pad
resultSet on completion to the command’s CQE DWORD 0-1 controller response
-
struct
nvme_uring_cmd¶ nvme uring command structure
Definition
struct nvme_uring_cmd {
__u8 opcode;
__u8 flags;
__u16 rsvd1;
__u32 nsid;
__u32 cdw2;
__u32 cdw3;
__u64 metadata;
__u64 addr;
__u32 metadata_len;
__u32 data_len;
__u32 cdw10;
__u32 cdw11;
__u32 cdw12;
__u32 cdw13;
__u32 cdw14;
__u32 cdw15;
__u32 timeout_ms;
__u32 rsvd2;
};
Members
opcodeOperation code, see
enum nvme_io_opcodesandenum nvme_admin_opcodesflagsNot supported: intended for command flags (eg: SGL, FUSE)
rsvd1Reserved for future use
nsidNamespace Identifier, or Fabrics type
cdw2Command Dword 2 (no spec defined use)
cdw3Command Dword 3 (no spec defined use)
metadataUser space address to metadata buffer (NULL if not used)
addrUser space address to data buffer (NULL if not used)
metadata_lenMetadata buffer transfer length
data_lenData buffer transfer length
cdw10Command Dword 10 (command specific)
cdw11Command Dword 11 (command specific)
cdw12Command Dword 12 (command specific)
cdw13Command Dword 13 (command specific)
cdw14Command Dword 14 (command specific)
cdw15Command Dword 15 (command specific)
timeout_msIf non-zero, overrides system default timeout in milliseconds
rsvd2Reserved for future use (and fills an implicit struct pad
-
sizeof_args¶
sizeof_args (type, member, align)
Helper function used to determine structure sizes
Parameters
typeArgument structure type
memberMember inside the type
alignAlignment information
-
int
nvme_submit_admin_passthru64(int fd, struct nvme_passthru_cmd64 *cmd, __u64 *result)¶ Submit a 64-bit nvme passthrough admin command
Parameters
int fdFile descriptor of nvme device
struct nvme_passthru_cmd64 *cmdThe nvme admin command to send
__u64 *resultOptional field to return the result from the CQE DW0-1
Description
Uses NVME_IOCTL_ADMIN64_CMD for the ioctl request.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_admin_passthru64(int fd, __u8 opcode, __u8 flags, __u16 rsvd, __u32 nsid, __u32 cdw2, __u32 cdw3, __u32 cdw10, __u32 cdw11, __u32 cdw12, __u32 cdw13, __u32 cdw14, __u32 cdw15, __u32 data_len, void *data, __u32 metadata_len, void *metadata, __u32 timeout_ms, __u64 *result)¶ Submit a 64-bit nvme passthrough command
Parameters
int fdFile descriptor of nvme device
__u8 opcodeThe nvme io command to send
__u8 flagsNVMe command flags (not used)
__u16 rsvdReserved for future use
__u32 nsidNamespace identifier
__u32 cdw2Command dword 2
__u32 cdw3Command dword 3
__u32 cdw10Command dword 10
__u32 cdw11Command dword 11
__u32 cdw12Command dword 12
__u32 cdw13Command dword 13
__u32 cdw14Command dword 14
__u32 cdw15Command dword 15
__u32 data_lenLength of the data transferred in this command in bytes
void *dataPointer to user address of the data buffer
__u32 metadata_lenLength of metadata transferred in this command
void *metadataPointer to user address of the metadata buffer
__u32 timeout_msHow long the kernel waits for the command to complete
__u64 *resultOptional field to return the result from the CQE dword 0
Description
Parameterized form of nvme_submit_admin_passthru64(). This sets up and
submits a struct nvme_passthru_cmd64.
Known values for opcode are defined in enum nvme_admin_opcode.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_submit_admin_passthru(int fd, struct nvme_passthru_cmd *cmd, __u32 *result)¶ Submit an nvme passthrough admin command
Parameters
int fdFile descriptor of nvme device
struct nvme_passthru_cmd *cmdThe nvme admin command to send
__u32 *resultOptional field to return the result from the CQE DW0
Description
Uses NVME_IOCTL_ADMIN_CMD for the ioctl request.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_admin_passthru(int fd, __u8 opcode, __u8 flags, __u16 rsvd, __u32 nsid, __u32 cdw2, __u32 cdw3, __u32 cdw10, __u32 cdw11, __u32 cdw12, __u32 cdw13, __u32 cdw14, __u32 cdw15, __u32 data_len, void *data, __u32 metadata_len, void *metadata, __u32 timeout_ms, __u32 *result)¶ Submit an nvme passthrough command
Parameters
int fdFile descriptor of nvme device
__u8 opcodeThe nvme io command to send
__u8 flagsNVMe command flags (not used)
__u16 rsvdReserved for future use
__u32 nsidNamespace identifier
__u32 cdw2Command dword 2
__u32 cdw3Command dword 3
__u32 cdw10Command dword 10
__u32 cdw11Command dword 11
__u32 cdw12Command dword 12
__u32 cdw13Command dword 13
__u32 cdw14Command dword 14
__u32 cdw15Command dword 15
__u32 data_lenLength of the data transferred in this command in bytes
void *dataPointer to user address of the data buffer
__u32 metadata_lenLength of metadata transferred in this command
void *metadataPointer to user address of the metadata buffer
__u32 timeout_msHow long the kernel waits for the command to complete
__u32 *resultOptional field to return the result from the CQE dword 0
Description
Parameterized form of nvme_submit_admin_passthru(). This sets up and
submits a struct nvme_passthru_cmd.
Known values for opcode are defined in enum nvme_admin_opcode.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_submit_io_passthru64(int fd, struct nvme_passthru_cmd64 *cmd, __u64 *result)¶ Submit a 64-bit nvme passthrough command
Parameters
int fdFile descriptor of nvme device
struct nvme_passthru_cmd64 *cmdThe nvme io command to send
__u64 *resultOptional field to return the result from the CQE DW0-1
Description
Uses NVME_IOCTL_IO64_CMD for the ioctl request.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_io_passthru64(int fd, __u8 opcode, __u8 flags, __u16 rsvd, __u32 nsid, __u32 cdw2, __u32 cdw3, __u32 cdw10, __u32 cdw11, __u32 cdw12, __u32 cdw13, __u32 cdw14, __u32 cdw15, __u32 data_len, void *data, __u32 metadata_len, void *metadata, __u32 timeout_ms, __u64 *result)¶ Submit an nvme io passthrough command
Parameters
int fdFile descriptor of nvme device
__u8 opcodeThe nvme io command to send
__u8 flagsNVMe command flags (not used)
__u16 rsvdReserved for future use
__u32 nsidNamespace identifier
__u32 cdw2Command dword 2
__u32 cdw3Command dword 3
__u32 cdw10Command dword 10
__u32 cdw11Command dword 11
__u32 cdw12Command dword 12
__u32 cdw13Command dword 13
__u32 cdw14Command dword 14
__u32 cdw15Command dword 15
__u32 data_lenLength of the data transferred in this command in bytes
void *dataPointer to user address of the data buffer
__u32 metadata_lenLength of metadata transferred in this command
void *metadataPointer to user address of the metadata buffer
__u32 timeout_msHow long the kernel waits for the command to complete
__u64 *resultOptional field to return the result from the CQE dword 0
Description
Parameterized form of nvme_submit_io_passthru64(). This sets up and submits
a struct nvme_passthru_cmd64.
Known values for opcode are defined in enum nvme_io_opcode.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_submit_io_passthru(int fd, struct nvme_passthru_cmd *cmd, __u32 *result)¶ Submit an nvme passthrough command
Parameters
int fdFile descriptor of nvme device
struct nvme_passthru_cmd *cmdThe nvme io command to send
__u32 *resultOptional field to return the result from the CQE DW0
Description
Uses NVME_IOCTL_IO_CMD for the ioctl request.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_io_passthru(int fd, __u8 opcode, __u8 flags, __u16 rsvd, __u32 nsid, __u32 cdw2, __u32 cdw3, __u32 cdw10, __u32 cdw11, __u32 cdw12, __u32 cdw13, __u32 cdw14, __u32 cdw15, __u32 data_len, void *data, __u32 metadata_len, void *metadata, __u32 timeout_ms, __u32 *result)¶ Submit an nvme io passthrough command
Parameters
int fdFile descriptor of nvme device
__u8 opcodeThe nvme io command to send
__u8 flagsNVMe command flags (not used)
__u16 rsvdReserved for future use
__u32 nsidNamespace identifier
__u32 cdw2Command dword 2
__u32 cdw3Command dword 3
__u32 cdw10Command dword 10
__u32 cdw11Command dword 11
__u32 cdw12Command dword 12
__u32 cdw13Command dword 13
__u32 cdw14Command dword 14
__u32 cdw15Command dword 15
__u32 data_lenLength of the data transferred in this command in bytes
void *dataPointer to user address of the data buffer
__u32 metadata_lenLength of metadata transferred in this command
void *metadataPointer to user address of the metadata buffer
__u32 timeout_msHow long the kernel waits for the command to complete
__u32 *resultOptional field to return the result from the CQE dword 0
Description
Parameterized form of nvme_submit_io_passthru(). This sets up and submits
a struct nvme_passthru_cmd.
Known values for opcode are defined in enum nvme_io_opcode.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_subsystem_reset(int fd)¶ Initiate a subsystem reset
Parameters
int fdFile descriptor of nvme device
Description
This should only be sent to controller handles, not to namespaces.
Return
Zero if a subsystem reset was initiated or -1 with errno set otherwise.
-
int
nvme_ctrl_reset(int fd)¶ Initiate a controller reset
Parameters
int fdFile descriptor of nvme device
Description
This should only be sent to controller handles, not to namespaces.
Return
0 if a reset was initiated or -1 with errno set otherwise.
-
int
nvme_ns_rescan(int fd)¶ Initiate a controller rescan
Parameters
int fdFile descriptor of nvme device
Description
This should only be sent to controller handles, not to namespaces.
Return
0 if a rescan was initiated or -1 with errno set otherwise.
-
int
nvme_get_nsid(int fd, __u32 *nsid)¶ Retrieve the NSID from a namespace file descriptor
Parameters
int fdFile descriptor of nvme namespace
__u32 *nsidUser pointer to namespace id
Description
This should only be sent to namespace handles, not to controllers. The kernel’s interface returns the nsid as the return value. This is unfortunate for many architectures that are incapable of allowing distinguishing a namespace id > 0x80000000 from a negative error number.
Return
0 if nsid was set successfully or -1 with errno set otherwise.
-
int
nvme_identify(struct nvme_identify_args *args)¶ Send the NVMe Identify command
Parameters
struct nvme_identify_args *argsstruct nvme_identify_argsargument structure
Description
The Identify command returns a data buffer that describes information about the NVM subsystem, the controller or the namespace(s).
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_identify_ctrl(int fd, struct nvme_id_ctrl *id)¶ Retrieves nvme identify controller
Parameters
int fdFile descriptor of nvme device
struct nvme_id_ctrl *idUser space destination address to transfer the data,
Description
Sends nvme identify with CNS value NVME_IDENTIFY_CNS_CTRL.
See struct nvme_id_ctrl for details on the data returned.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_identify_ns(int fd, __u32 nsid, struct nvme_id_ns *ns)¶ Retrieves nvme identify namespace
Parameters
int fdFile descriptor of nvme device
__u32 nsidNamespace to identify
struct nvme_id_ns *nsUser space destination address to transfer the data
Description
If the Namespace Identifier (NSID) field specifies an active NSID, then the Identify Namespace data structure is returned to the host for that specified namespace.
If the controller supports the Namespace Management capability and the NSID
field is set to NVME_NSID_ALL, then the controller returns an Identify Namespace
data structure that specifies capabilities that are common across namespaces
for this controller.
See struct nvme_id_ns for details on the structure returned.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_identify_allocated_ns(int fd, __u32 nsid, struct nvme_id_ns *ns)¶ Same as nvme_identify_ns, but only for allocated namespaces
Parameters
int fdFile descriptor of nvme device
__u32 nsidNamespace to identify
struct nvme_id_ns *nsUser space destination address to transfer the data
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_identify_active_ns_list(int fd, __u32 nsid, struct nvme_ns_list *list)¶ Retrieves active namespaces id list
Parameters
int fdFile descriptor of nvme device
__u32 nsidReturn namespaces greater than this identifier
struct nvme_ns_list *listUser space destination address to transfer the data
Description
A list of 1024 namespace IDs is returned to the host containing NSIDs in increasing order that are greater than the value specified in the Namespace Identifier (nsid) field of the command.
See struct nvme_ns_list for the definition of the returned structure.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_identify_allocated_ns_list(int fd, __u32 nsid, struct nvme_ns_list *list)¶ Retrieves allocated namespace id list
Parameters
int fdFile descriptor of nvme device
__u32 nsidReturn namespaces greater than this identifier
struct nvme_ns_list *listUser space destination address to transfer the data
Description
A list of 1024 namespace IDs is returned to the host containing NSIDs in increasing order that are greater than the value specified in the Namespace Identifier (nsid) field of the command.
See struct nvme_ns_list for the definition of the returned structure.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_identify_ctrl_list(int fd, __u16 cntid, struct nvme_ctrl_list *cntlist)¶ Retrieves identify controller list
Parameters
int fdFile descriptor of nvme device
__u16 cntidStarting CNTLID to return in the list
struct nvme_ctrl_list *cntlistUser space destination address to transfer the data
Description
Up to 2047 controller identifiers is returned containing a controller identifier greater than or equal to the controller identifier specified in cntid.
See struct nvme_ctrl_list for a definition of the structure returned.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_identify_nsid_ctrl_list(int fd, __u32 nsid, __u16 cntid, struct nvme_ctrl_list *cntlist)¶ Retrieves controller list attached to an nsid
Parameters
int fdFile descriptor of nvme device
__u32 nsidReturn controllers that are attached to this nsid
__u16 cntidStarting CNTLID to return in the list
struct nvme_ctrl_list *cntlistUser space destination address to transfer the data
Description
Up to 2047 controller identifiers are returned containing a controller identifier greater than or equal to the controller identifier specified in cntid attached to nsid.
See struct nvme_ctrl_list for a definition of the structure returned.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1
-
int
nvme_identify_ns_descs(int fd, __u32 nsid, struct nvme_ns_id_desc *descs)¶ Retrieves namespace descriptor list
Parameters
int fdFile descriptor of nvme device
__u32 nsidThe namespace id to retrieve descriptors
struct nvme_ns_id_desc *descsUser space destination address to transfer the data
Description
A list of Namespace Identification Descriptor structures is returned to the host for the namespace specified in the Namespace Identifier (NSID) field if it is an active NSID.
The data returned is in the form of an array of ‘struct nvme_ns_id_desc’.
See struct nvme_ns_id_desc for the definition of the returned structure.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_identify_nvmset_list(int fd, __u16 nvmsetid, struct nvme_id_nvmset_list *nvmset)¶ Retrieves NVM Set List
Parameters
int fdFile descriptor of nvme device
__u16 nvmsetidNVM Set Identifier
struct nvme_id_nvmset_list *nvmsetUser space destination address to transfer the data
Description
Retrieves an NVM Set List, struct nvme_id_nvmset_list. The data structure
is an ordered list by NVM Set Identifier, starting with the first NVM Set
Identifier supported by the NVM subsystem that is equal to or greater than
the NVM Set Identifier.
See struct nvme_id_nvmset_list for the definition of the returned structure.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_identify_primary_ctrl(int fd, __u16 cntid, struct nvme_primary_ctrl_cap *cap)¶ Retrieve NVMe Primary Controller identification
Parameters
int fdFile descriptor of nvme device
__u16 cntidReturn controllers starting at this identifier
struct nvme_primary_ctrl_cap *capUser space destination buffer address to transfer the data
Description
See struct nvme_primary_ctrl_cap for the definition of the returned structure, cap.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_identify_secondary_ctrl_list(int fd, __u16 cntid, struct nvme_secondary_ctrl_list *sc_list)¶ Retrieves secondary controller list
Parameters
int fdFile descriptor of nvme device
__u16 cntidReturn controllers starting at this identifier
struct nvme_secondary_ctrl_list *sc_listUser space destination address to transfer the data
Description
A Secondary Controller List is returned to the host for up to 127 secondary controllers associated with the primary controller processing this command. The list contains entries for controller identifiers greater than or equal to the value specified in the Controller Identifier (cntid).
See struct nvme_secondary_ctrls_list for a definition of the returned
structure.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_identify_ns_granularity(int fd, struct nvme_id_ns_granularity_list *gr_list)¶ Retrieves namespace granularity identification
Parameters
int fdFile descriptor of nvme device
struct nvme_id_ns_granularity_list *gr_listUser space destination address to transfer the data
Description
If the controller supports reporting of Namespace Granularity, then a Namespace Granularity List is returned to the host for up to sixteen namespace granularity descriptors
See struct nvme_id_ns_granularity_list for the definition of the returned
structure.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_identify_uuid(int fd, struct nvme_id_uuid_list *uuid_list)¶ Retrieves device’s UUIDs
Parameters
int fdFile descriptor of nvme device
struct nvme_id_uuid_list *uuid_listUser space destination address to transfer the data
Description
Each UUID List entry is either 0h, the NVMe Invalid UUID, or a valid UUID. Valid UUIDs are those which are non-zero and are not the NVMe Invalid UUID.
See struct nvme_id_uuid_list for the definition of the returned structure.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_identify_ns_csi(int fd, __u32 nsid, __u8 uuidx, enum nvme_csi csi, void *data)¶ I/O command set specific identify namespace data
Parameters
int fdFile descriptor of nvme device
__u32 nsidNamespace to identify
__u8 uuidxUUID Index for differentiating vendor specific encoding
enum nvme_csi csiCommand Set Identifier
void *dataUser space destination address to transfer the data
Description
An I/O Command Set specific Identify Namespace data structure is returned for the namespace specified in nsid.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_identify_ctrl_csi(int fd, enum nvme_csi csi, void *data)¶ I/O command set specific Identify Controller data
Parameters
int fdFile descriptor of nvme device
enum nvme_csi csiCommand Set Identifier
void *dataUser space destination address to transfer the data
Description
An I/O Command Set specific Identify Controller data structure is returned to the host for the controller processing the command. The specific Identify Controller data structure to be returned is specified by csi.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_identify_active_ns_list_csi(int fd, __u32 nsid, enum nvme_csi csi, struct nvme_ns_list *ns_list)¶ Active namespace ID list associated with a specified I/O command set
Parameters
int fdFile descriptor of nvme device
__u32 nsidReturn namespaces greater than this identifier
enum nvme_csi csiCommand Set Identifier
struct nvme_ns_list *ns_listUser space destination address to transfer the data
Description
A list of 1024 namespace IDs is returned to the host containing active NSIDs in increasing order that are greater than the value specified in the Namespace Identifier (nsid) field of the command and matching the I/O Command Set specified in the csi argument.
See struct nvme_ns_list for the definition of the returned structure.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_identify_allocated_ns_list_csi(int fd, __u32 nsid, enum nvme_csi csi, struct nvme_ns_list *ns_list)¶ Allocated namespace ID list associated with a specified I/O command set
Parameters
int fdFile descriptor of nvme device
__u32 nsidReturn namespaces greater than this identifier
enum nvme_csi csiCommand Set Identifier
struct nvme_ns_list *ns_listUser space destination address to transfer the data
Description
A list of 1024 namespace IDs is returned to the host containing allocated NSIDs in increasing order that are greater than the value specified in the nsid field of the command and matching the I/O Command Set specified in the csi argument.
See struct nvme_ns_list for the definition of the returned structure.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_identify_independent_identify_ns(int fd, __u32 nsid, struct nvme_id_independent_id_ns *ns)¶ I/O command set independent Identify namespace data
Parameters
int fdFile descriptor of nvme device
__u32 nsidReturn namespaces greater than this identifier
struct nvme_id_independent_id_ns *nsI/O Command Set Independent Identify Namespace data structure
Description
The I/O command set independent Identify namespace data structure for the namespace identified with ns is returned to the host.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_identify_ns_csi_user_data_format(int fd, __u16 user_data_format, __u8 uuidx, enum nvme_csi csi, void *data)¶ Identify namespace user data format
Parameters
int fdFile descriptor of nvme device
__u16 user_data_formatReturn namespaces capability of identifier
__u8 uuidxUUID selection, if supported
enum nvme_csi csiCommand Set Identifier
void *dataUser space destination address to transfer the data
Description
Identify Namespace data structure for the specified User Data Format index containing the namespace capabilities for the NVM Command Set.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_identify_iocs_ns_csi_user_data_format(int fd, __u16 user_data_format, __u8 uuidx, enum nvme_csi csi, void *data)¶ Identify I/O command set namespace data structure
Parameters
int fdFile descriptor of nvme device
__u16 user_data_formatReturn namespaces capability of identifier
__u8 uuidxUUID selection, if supported
enum nvme_csi csiCommand Set Identifier
void *dataUser space destination address to transfer the data
Description
I/O Command Set specific Identify Namespace data structure for the specified User Data Format index containing the namespace capabilities for the I/O Command Set specified in the CSI field.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_nvm_identify_ctrl(int fd, struct nvme_id_ctrl_nvm *id)¶ Identify controller data
Parameters
int fdFile descriptor of nvme device
struct nvme_id_ctrl_nvm *idUser space destination address to transfer the data
Description
Return an identify controller data structure to the host of processing controller.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_identify_domain_list(int fd, __u16 domid, struct nvme_id_domain_list *list)¶ Domain list data
Parameters
int fdFile descriptor of nvme device
__u16 domidDomain ID
struct nvme_id_domain_list *listUser space destination address to transfer data
Description
A list of 31 domain IDs is returned to the host containing domain attributes in increasing order that are greater than the value specified in the domid field.
See struct nvme_identify_domain_attr for the definition of the
returned structure.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_identify_endurance_group_list(int fd, __u16 endgrp_id, struct nvme_id_endurance_group_list *list)¶ Endurance group list data
Parameters
int fdFile descriptor of nvme device
__u16 endgrp_idEndurance group identifier
struct nvme_id_endurance_group_list *listArray of endurance group identifiers
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_identify_iocs(int fd, __u16 cntlid, struct nvme_id_iocs *iocs)¶ I/O command set data structure
Parameters
int fdFile descriptor of nvme device
__u16 cntlidController ID
struct nvme_id_iocs *iocsUser space destination address to transfer the data
Description
Retrieves list of the controller’s supported io command set vectors. See
struct nvme_id_iocs.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_zns_identify_ns(int fd, __u32 nsid, struct nvme_zns_id_ns *data)¶ ZNS identify namespace data
Parameters
int fdFile descriptor of nvme device
__u32 nsidNamespace to identify
struct nvme_zns_id_ns *dataUser space destination address to transfer the data
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_zns_identify_ctrl(int fd, struct nvme_zns_id_ctrl *id)¶ ZNS identify controller data
Parameters
int fdFile descriptor of nvme device
struct nvme_zns_id_ctrl *idUser space destination address to transfer the data
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_log(struct nvme_get_log_args *args)¶ NVMe Admin Get Log command
Parameters
struct nvme_get_log_args *argsstruct nvme_get_log_argsargument structure
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_log_page(int fd, __u32 xfer_len, struct nvme_get_log_args *args)¶ Get log page data
Parameters
int fdFile descriptor of nvme device
__u32 xfer_lenMax log transfer size per request to split the total.
struct nvme_get_log_args *argsstruct nvme_get_log_argsargument structure
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_log_supported_log_pages(int fd, bool rae, struct nvme_supported_log_pages *log)¶ Retrieve nmve supported log pages
Parameters
int fdFile descriptor of nvme device
bool raeRetain asynchronous events
struct nvme_supported_log_pages *logArray of LID supported and Effects data structures
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_log_error(int fd, unsigned int nr_entries, bool rae, struct nvme_error_log_page *err_log)¶ Retrieve nvme error log
Parameters
int fdFile descriptor of nvme device
unsigned int nr_entriesNumber of error log entries allocated
bool raeRetain asynchronous events
struct nvme_error_log_page *err_logArray of error logs of size ‘entries’
Description
This log page describes extended error information for a command that completed with error, or may report an error that is not specific to a particular command.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_log_smart(int fd, __u32 nsid, bool rae, struct nvme_smart_log *smart_log)¶ Retrieve nvme smart log
Parameters
int fdFile descriptor of nvme device
__u32 nsidOptional namespace identifier
bool raeRetain asynchronous events
struct nvme_smart_log *smart_logUser address to store the smart log
Description
This log page provides SMART and general health information. The information provided is over the life of the controller and is retained across power cycles. To request the controller log page, the namespace identifier specified is FFFFFFFFh. The controller may also support requesting the log page on a per namespace basis, as indicated by bit 0 of the LPA field in the Identify Controller data structure.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_log_fw_slot(int fd, bool rae, struct nvme_firmware_slot *fw_log)¶ Retrieves the controller firmware log
Parameters
int fdFile descriptor of nvme device
bool raeRetain asynchronous events
struct nvme_firmware_slot *fw_logUser address to store the log page
Description
This log page describes the firmware revision stored in each firmware slot supported. The firmware revision is indicated as an ASCII string. The log page also indicates the active slot number.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_log_changed_ns_list(int fd, bool rae, struct nvme_ns_list *ns_log)¶ Retrieve namespace changed list
Parameters
int fdFile descriptor of nvme device
bool raeRetain asynchronous events
struct nvme_ns_list *ns_logUser address to store the log page
Description
This log page describes namespaces attached to this controller that have changed since the last time the namespace was identified, been added, or deleted.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_log_cmd_effects(int fd, enum nvme_csi csi, struct nvme_cmd_effects_log *effects_log)¶ Retrieve nvme command effects log
Parameters
int fdFile descriptor of nvme device
enum nvme_csi csiCommand Set Identifier
struct nvme_cmd_effects_log *effects_logUser address to store the effects log
Description
This log page describes the commands that the controller supports and the effects of those commands on the state of the NVM subsystem.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_log_device_self_test(int fd, struct nvme_self_test_log *log)¶ Retrieve the device self test log
Parameters
int fdFile descriptor of nvme device
struct nvme_self_test_log *logUserspace address of the log payload
Description
The log page indicates the status of an in progress self test and the percent complete of that operation, and the results of the previous 20 self-test operations.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_log_create_telemetry_host(int fd, struct nvme_telemetry_log *log)¶ Create host telemetry log
Parameters
int fdFile descriptor of nvme device
struct nvme_telemetry_log *logUserspace address of the log payload
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_log_telemetry_host(int fd, __u64 offset, __u32 len, void *log)¶ Get Telemetry Host-Initiated log page
Parameters
int fdFile descriptor of nvme device
__u64 offsetOffset into the telemetry data
__u32 lenLength of provided user buffer to hold the log data in bytes
void *logUser address for log page data
Description
Retrieves the Telemetry Host-Initiated log page at the requested offset using the previously existing capture.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_log_telemetry_ctrl(int fd, bool rae, __u64 offset, __u32 len, void *log)¶ Get Telemetry Controller-Initiated log page
Parameters
int fdFile descriptor of nvme device
bool raeRetain asynchronous events
__u64 offsetOffset into the telemetry data
__u32 lenLength of provided user buffer to hold the log data in bytes
void *logUser address for log page data
Description
Retrieves the Telemetry Controller-Initiated log page at the requested offset using the previously existing capture.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_log_endurance_group(int fd, __u16 endgid, struct nvme_endurance_group_log *log)¶ Get Endurance Group log
Parameters
int fdFile descriptor of nvme device
__u16 endgidStarting group identifier to return in the list
struct nvme_endurance_group_log *logUser address to store the endurance log
Description
This log page indicates if an Endurance Group Event has occurred for a particular Endurance Group. If an Endurance Group Event has occurred, the details of the particular event are included in the Endurance Group Information log page for that Endurance Group. An asynchronous event is generated when an entry for an Endurance Group is newly added to this log page.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_log_predictable_lat_nvmset(int fd, __u16 nvmsetid, struct nvme_nvmset_predictable_lat_log *log)¶ Predictable Latency Per NVM Set
Parameters
int fdFile descriptor of nvme device
__u16 nvmsetidNVM set id
struct nvme_nvmset_predictable_lat_log *logUser address to store the predictable latency log
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_log_predictable_lat_event(int fd, bool rae, __u32 offset, __u32 len, void *log)¶ Retrieve Predictable Latency Event Aggregate Log Page
Parameters
int fdFile descriptor of nvme device
bool raeRetain asynchronous events
__u32 offsetOffset into the predictable latency event
__u32 lenLength of provided user buffer to hold the log data in bytes
void *logUser address for log page data
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_log_fdp_configurations(int fd, __u16 egid, __u32 offset, __u32 len, void *log)¶ Get list of Flexible Data Placement configurations
Parameters
int fdFile descriptor of nvme device
__u16 egidEndurance group identifier
__u32 offsetOffset into log page
__u32 lenLength (in bytes) of provided user buffer to hold the log data
void *logLog page data buffer
-
int
nvme_get_log_reclaim_unit_handle_usage(int fd, __u16 egid, __u32 offset, __u32 len, void *log)¶ Get reclaim unit handle usage
Parameters
int fdFile descriptor of nvme device
__u16 egidEndurance group identifier
__u32 offsetOffset into log page
__u32 lenLength (in bytes) of provided user buffer to hold the log data
void *logLog page data buffer
-
int
nvme_get_log_fdp_stats(int fd, __u16 egid, __u32 offset, __u32 len, void *log)¶ Get Flexible Data Placement statistics
Parameters
int fdFile descriptor of nvme device
__u16 egidEndurance group identifier
__u32 offsetOffset into log page
__u32 lenLength (in bytes) of provided user buffer to hold the log data
void *logLog page data buffer
-
int
nvme_get_log_fdp_events(int fd, __u16 egid, bool host_events, __u32 offset, __u32 len, void *log)¶ Get Flexible Data Placement events
Parameters
int fdFile descriptor of nvme device
__u16 egidEndurance group identifier
bool host_eventsWhether to report host or controller events
__u32 offsetOffset into log page
__u32 lenLength (in bytes) of provided user buffer to hold the log data
void *logLog page data buffer
-
int
nvme_get_log_ana(int fd, enum nvme_log_ana_lsp lsp, bool rae, __u64 offset, __u32 len, void *log)¶ Retrieve Asymmetric Namespace Access log page
Parameters
int fdFile descriptor of nvme device
enum nvme_log_ana_lsp lspLog specific, see
enum nvme_get_log_ana_lspbool raeRetain asynchronous events
__u64 offsetOffset to the start of the log page
__u32 lenThe allocated length of the log page
void *logUser address to store the ana log
Description
This log consists of a header describing the log and descriptors containing the asymmetric namespace access information for ANA Groups that contain namespaces that are attached to the controller processing the command.
See struct nvme_ana_rsp_hdr for the definition of the returned structure.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_log_ana_groups(int fd, bool rae, __u32 len, struct nvme_ana_group_desc *log)¶ Retrieve Asymmetric Namespace Access groups only log page
Parameters
int fdFile descriptor of nvme device
bool raeRetain asynchronous events
__u32 lenThe allocated length of the log page
struct nvme_ana_group_desc *logUser address to store the ana group log
Description
See struct nvme_ana_group_desc for the definition of the returned structure.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_log_lba_status(int fd, bool rae, __u64 offset, __u32 len, void *log)¶ Retrieve LBA Status
Parameters
int fdFile descriptor of nvme device
bool raeRetain asynchronous events
__u64 offsetOffset to the start of the log page
__u32 lenThe allocated length of the log page
void *logUser address to store the log page
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_log_endurance_grp_evt(int fd, bool rae, __u32 offset, __u32 len, void *log)¶ Retrieve Rotational Media Information
Parameters
int fdFile descriptor of nvme device
bool raeRetain asynchronous events
__u32 offsetOffset to the start of the log page
__u32 lenThe allocated length of the log page
void *logUser address to store the log page
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_log_fid_supported_effects(int fd, bool rae, struct nvme_fid_supported_effects_log *log)¶ Retrieve Feature Identifiers Supported and Effects
Parameters
int fdFile descriptor of nvme device
bool raeRetain asynchronous events
struct nvme_fid_supported_effects_log *logFID Supported and Effects data structure
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise
-
int
nvme_get_log_mi_cmd_supported_effects(int fd, bool rae, struct nvme_mi_cmd_supported_effects_log *log)¶ displays the MI Commands Supported by the controller
Parameters
int fdFile descriptor of nvme device
bool raeRetain asynchronous events
struct nvme_mi_cmd_supported_effects_log *logMI Command Supported and Effects data structure
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise
-
int
nvme_get_log_boot_partition(int fd, bool rae, __u8 lsp, __u32 len, struct nvme_boot_partition *part)¶ Retrieve Boot Partition
Parameters
int fdFile descriptor of nvme device
bool raeRetain asynchronous events
__u8 lspThe log specified field of LID
__u32 lenThe allocated size, minimum struct nvme_boot_partition
struct nvme_boot_partition *partUser address to store the log page
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise
-
int
nvme_get_log_phy_rx_eom(int fd, __u8 lsp, __u16 controller, __u32 len, struct nvme_phy_rx_eom_log *log)¶ Retrieve Physical Interface Receiver Eye Opening Measurement Log
Parameters
int fdFile descriptor of nvme device
__u8 lspLog specific, controls action and measurement quality
__u16 controllerTarget controller ID
__u32 lenThe allocated size, minimum struct nvme_phy_rx_eom_log
struct nvme_phy_rx_eom_log *logUser address to store the log page
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise
-
int
nvme_get_log_discovery(int fd, bool rae, __u32 offset, __u32 len, void *log)¶ Retrieve Discovery log page
Parameters
int fdFile descriptor of nvme device
bool raeRetain asynchronous events
__u32 offsetOffset of this log to retrieve
__u32 lenThe allocated size for this portion of the log
void *logUser address to store the discovery log
Description
Supported only by fabrics discovery controllers, returning discovery records.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_log_media_unit_stat(int fd, __u16 domid, struct nvme_media_unit_stat_log *mus)¶ Retrieve Media Unit Status
Parameters
int fdFile descriptor of nvme device
__u16 domidDomain Identifier selection, if supported
struct nvme_media_unit_stat_log *musUser address to store the Media Unit statistics log
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise
-
int
nvme_get_log_support_cap_config_list(int fd, __u16 domid, struct nvme_supported_cap_config_list_log *cap)¶ Retrieve Supported Capacity Configuration List
Parameters
int fdFile descriptor of nvme device
__u16 domidDomain Identifier selection, if supported
struct nvme_supported_cap_config_list_log *capUser address to store supported capabilities config list
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise
-
int
nvme_get_log_reservation(int fd, bool rae, struct nvme_resv_notification_log *log)¶ Retrieve Reservation Notification
Parameters
int fdFile descriptor of nvme device
bool raeRetain asynchronous events
struct nvme_resv_notification_log *logUser address to store the reservation log
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise
-
int
nvme_get_log_sanitize(int fd, bool rae, struct nvme_sanitize_log_page *log)¶ Retrieve Sanitize Status
Parameters
int fdFile descriptor of nvme device
bool raeRetain asynchronous events
struct nvme_sanitize_log_page *logUser address to store the sanitize log
Description
The Sanitize Status log page reports sanitize operation time estimates and information about the most recent sanitize operation.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_log_zns_changed_zones(int fd, __u32 nsid, bool rae, struct nvme_zns_changed_zone_log *log)¶ Retrieve list of zones that have changed
Parameters
int fdFile descriptor of nvme device
__u32 nsidNamespace ID
bool raeRetain asynchronous events
struct nvme_zns_changed_zone_log *logUser address to store the changed zone log
Description
The list of zones that have changed state due to an exceptional event.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_log_persistent_event(int fd, enum nvme_pevent_log_action action, __u32 size, void *pevent_log)¶ Retrieve Persistent Event Log
Parameters
int fdFile descriptor of nvme device
enum nvme_pevent_log_action actionAction the controller should take during processing this command
__u32 sizeSize of pevent_log
void *pevent_logUser address to store the persistent event log
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_set_features(struct nvme_set_features_args *args)¶ Set a feature attribute
Parameters
struct nvme_set_features_args *argsstruct nvme_set_features_argsargument structure
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_set_features_data(int fd, __u8 fid, __u32 nsid, __u32 cdw11, bool save, __u32 data_len, void *data, __u32 *result)¶ Helper function for nvme_set_features()
Parameters
int fdFile descriptor of nvme device
__u8 fidFeature identifier
__u32 nsidNamespace ID, if applicable
__u32 cdw11Value to set the feature to
bool saveSave value across power states
__u32 data_lenLength of feature data, if applicable, in bytes
void *dataUser address of feature data, if applicable
__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_set_features_simple(int fd, __u8 fid, __u32 nsid, __u32 cdw11, bool save, __u32 *result)¶ Helper function for nvme_set_features()
Parameters
int fdFile descriptor of nvme device
__u8 fidFeature identifier
__u32 nsidNamespace ID, if applicable
__u32 cdw11Value to set the feature to
bool saveSave value across power states
__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_set_features_arbitration(int fd, __u8 ab, __u8 lpw, __u8 mpw, __u8 hpw, bool save, __u32 *result)¶ Set arbitration features
Parameters
int fdFile descriptor of nvme device
__u8 abArbitration Burst
__u8 lpwLow Priority Weight
__u8 mpwMedium Priority Weight
__u8 hpwHigh Priority Weight
bool saveSave value across power states
__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_set_features_power_mgmt(int fd, __u8 ps, __u8 wh, bool save, __u32 *result)¶ Set power management feature
Parameters
int fdFile descriptor of nvme device
__u8 psPower State
__u8 whWorkload Hint
bool saveSave value across power states
__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_set_features_lba_range(int fd, __u32 nsid, __u8 nr_ranges, bool save, struct nvme_lba_range_type *data, __u32 *result)¶ Set LBA range feature
Parameters
int fdFile descriptor of nvme device
__u32 nsidNamespace ID
__u8 nr_rangesNumber of ranges in data
bool saveSave value across power states
struct nvme_lba_range_type *dataUser address of feature data
__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_set_features_temp_thresh(int fd, __u16 tmpth, __u8 tmpsel, enum nvme_feat_tmpthresh_thsel thsel, bool save, __u32 *result)¶ Set temperature threshold feature
Parameters
int fdFile descriptor of nvme device
__u16 tmpthTemperature Threshold
__u8 tmpselThreshold Temperature Select
enum nvme_feat_tmpthresh_thsel thselThreshold Type Select
bool saveSave value across power states
__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_set_features_err_recovery(int fd, __u32 nsid, __u16 tler, bool dulbe, bool save, __u32 *result)¶ Set error recovery feature
Parameters
int fdFile descriptor of nvme device
__u32 nsidNamespace ID
__u16 tlerTime-limited error recovery value
bool dulbeDeallocated or Unwritten Logical Block Error Enable
bool saveSave value across power states
__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_set_features_volatile_wc(int fd, bool wce, bool save, __u32 *result)¶ Set volatile write cache feature
Parameters
int fdFile descriptor of nvme device
bool wceWrite cache enable
bool saveSave value across power states
__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_set_features_irq_coalesce(int fd, __u8 thr, __u8 time, bool save, __u32 *result)¶ Set IRQ coalesce feature
Parameters
int fdFile descriptor of nvme device
__u8 thrAggregation Threshold
__u8 timeAggregation Time
bool saveSave value across power states
__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_set_features_irq_config(int fd, __u16 iv, bool cd, bool save, __u32 *result)¶ Set IRQ config feature
Parameters
int fdFile descriptor of nvme device
__u16 ivInterrupt Vector
bool cdCoalescing Disable
bool saveSave value across power states
__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_set_features_write_atomic(int fd, bool dn, bool save, __u32 *result)¶ Set write atomic feature
Parameters
int fdFile descriptor of nvme device
bool dnDisable Normal
bool saveSave value across power states
__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_set_features_async_event(int fd, __u32 events, bool save, __u32 *result)¶ Set asynchronous event feature
Parameters
int fdFile descriptor of nvme device
__u32 eventsEvents to enable
bool saveSave value across power states
__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_set_features_auto_pst(int fd, bool apste, bool save, struct nvme_feat_auto_pst *apst, __u32 *result)¶ Set autonomous power state feature
Parameters
int fdFile descriptor of nvme device
bool apsteAutonomous Power State Transition Enable
bool saveSave value across power states
struct nvme_feat_auto_pst *apstAutonomous Power State Transition
__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_set_features_timestamp(int fd, bool save, __u64 timestamp)¶ Set timestamp feature
Parameters
int fdFile descriptor of nvme device
bool saveSave value across power states
__u64 timestampThe current timestamp value to assign to this feature
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_set_features_hctm(int fd, __u16 tmt2, __u16 tmt1, bool save, __u32 *result)¶ Set thermal management feature
Parameters
int fdFile descriptor of nvme device
__u16 tmt2Thermal Management Temperature 2
__u16 tmt1Thermal Management Temperature 1
bool saveSave value across power states
__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_set_features_nopsc(int fd, bool noppme, bool save, __u32 *result)¶ Set non-operational power state feature
Parameters
int fdFile descriptor of nvme device
bool noppmeNon-Operational Power State Permissive Mode Enable
bool saveSave value across power states
__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_set_features_rrl(int fd, __u8 rrl, __u16 nvmsetid, bool save, __u32 *result)¶ Set read recovery level feature
Parameters
int fdFile descriptor of nvme device
__u8 rrlRead recovery level setting
__u16 nvmsetidNVM set id
bool saveSave value across power states
__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_set_features_plm_config(int fd, bool enable, __u16 nvmsetid, bool save, struct nvme_plm_config *data, __u32 *result)¶ Set predictable latency feature
Parameters
int fdFile descriptor of nvme device
bool enablePredictable Latency Enable
__u16 nvmsetidNVM Set Identifier
bool saveSave value across power states
struct nvme_plm_config *dataPointer to structure nvme_plm_config
__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_set_features_plm_window(int fd, enum nvme_feat_plm_window_select sel, __u16 nvmsetid, bool save, __u32 *result)¶ Set window select feature
Parameters
int fdFile descriptor of nvme device
enum nvme_feat_plm_window_select selWindow Select
__u16 nvmsetidNVM Set Identifier
bool saveSave value across power states
__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_set_features_lba_sts_interval(int fd, __u16 lsiri, __u16 lsipi, bool save, __u32 *result)¶ Set LBA status information feature
Parameters
int fdFile descriptor of nvme device
__u16 lsiriLBA Status Information Report Interval
__u16 lsipiLBA Status Information Poll Interval
bool saveSave value across power states
__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_set_features_host_behavior(int fd, bool save, struct nvme_feat_host_behavior *data)¶ Set host behavior feature
Parameters
int fdFile descriptor of nvme device
bool saveSave value across power states
struct nvme_feat_host_behavior *dataPointer to structure nvme_feat_host_behavior
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_set_features_sanitize(int fd, bool nodrm, bool save, __u32 *result)¶ Set sanitize feature
Parameters
int fdFile descriptor of nvme device
bool nodrmNo-Deallocate Response Mode
bool saveSave value across power states
__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_set_features_endurance_evt_cfg(int fd, __u16 endgid, __u8 egwarn, bool save, __u32 *result)¶ Set endurance event config feature
Parameters
int fdFile descriptor of nvme device
__u16 endgidEndurance Group Identifier
__u8 egwarnFlags to enable warning, see
enum nvme_eg_critical_warning_flagsbool saveSave value across power states
__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_set_features_sw_progress(int fd, __u8 pbslc, bool save, __u32 *result)¶ Set pre-boot software load count feature
Parameters
int fdFile descriptor of nvme device
__u8 pbslcPre-boot Software Load Count
bool saveSave value across power states
__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_set_features_host_id(int fd, bool exhid, bool save, __u8 *hostid)¶ Set enable extended host identifiers feature
Parameters
int fdFile descriptor of nvme device
bool exhidEnable Extended Host Identifier
bool saveSave value across power states
__u8 *hostidHost ID to set
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_set_features_resv_mask(int fd, __u32 mask, bool save, __u32 *result)¶ Set reservation notification mask feature
Parameters
int fdFile descriptor of nvme device
__u32 maskReservation Notification Mask Field
bool saveSave value across power states
__u32 *resultThe command completion result from CQE dword0
Description
Deprecated: doesn’t support specifying a NSID. Use nvme_set_features_resv_mask2() instead.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_set_features_resv_mask2(int fd, __u32 nsid, __u32 mask, bool save, __u32 *result)¶ Set reservation notification mask feature
Parameters
int fdFile descriptor of nvme device
__u32 nsidNamespace ID
__u32 maskReservation Notification Mask Field
bool saveSave value across power states
__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_set_features_resv_persist(int fd, bool ptpl, bool save, __u32 *result)¶ Set persist through power loss feature
Parameters
int fdFile descriptor of nvme device
bool ptplPersist Through Power Loss
bool saveSave value across power states
__u32 *resultThe command completion result from CQE dword0
Description
Deprecated: doesn’t support specifying a NSID. Use nvme_set_features_resv_persist2() instead.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_set_features_resv_persist2(int fd, __u32 nsid, bool ptpl, bool save, __u32 *result)¶ Set persist through power loss feature
Parameters
int fdFile descriptor of nvme device
__u32 nsidNamespace ID
bool ptplPersist Through Power Loss
bool saveSave value across power states
__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_set_features_write_protect(int fd, enum nvme_feat_nswpcfg_state state, bool save, __u32 *result)¶ Set write protect feature
Parameters
int fdFile descriptor of nvme device
enum nvme_feat_nswpcfg_state stateWrite Protection State
bool saveSave value across power states
__u32 *resultThe command completion result from CQE dword0
Description
Deprecated: doesn’t support specifying a NSID. Use nvme_set_features_write_protect2() instead.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_set_features_write_protect2(int fd, __u32 nsid, enum nvme_feat_nswpcfg_state state, bool save, __u32 *result)¶ Set write protect feature
Parameters
int fdFile descriptor of nvme device
__u32 nsidNamespace ID
enum nvme_feat_nswpcfg_state stateWrite Protection State
bool saveSave value across power states
__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_set_features_iocs_profile(int fd, __u16 iocsi, bool save)¶ Set I/O command set profile feature
Parameters
int fdFile descriptor of nvme device
__u16 iocsiI/O Command Set Combination Index
bool saveSave value across power states
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_features(struct nvme_get_features_args *args)¶ Retrieve a feature attribute
Parameters
struct nvme_get_features_args *argsstruct nvme_get_features_argsargument structure
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_features_data(int fd, enum nvme_features_id fid, __u32 nsid, __u32 data_len, void *data, __u32 *result)¶ Helper function for nvme_get_features()
Parameters
int fdFile descriptor of nvme device
enum nvme_features_id fidFeature identifier
__u32 nsidNamespace ID, if applicable
__u32 data_lenLength of feature data, if applicable, in bytes
void *dataUser address of feature data, if applicable
__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_features_simple(int fd, enum nvme_features_id fid, __u32 nsid, __u32 *result)¶ Helper function for nvme_get_features()
Parameters
int fdFile descriptor of nvme device
enum nvme_features_id fidFeature identifier
__u32 nsidNamespace ID, if applicable
__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_features_arbitration(int fd, enum nvme_get_features_sel sel, __u32 *result)¶ Get arbitration feature
Parameters
int fdFile descriptor of nvme device
enum nvme_get_features_sel selSelect which type of attribute to return, see
enum nvme_get_features_sel__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_features_power_mgmt(int fd, enum nvme_get_features_sel sel, __u32 *result)¶ Get power management feature
Parameters
int fdFile descriptor of nvme device
enum nvme_get_features_sel selSelect which type of attribute to return, see
enum nvme_get_features_sel__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_features_lba_range(int fd, enum nvme_get_features_sel sel, struct nvme_lba_range_type *data, __u32 *result)¶ Get LBA range feature
Parameters
int fdFile descriptor of nvme device
enum nvme_get_features_sel selSelect which type of attribute to return, see
enum nvme_get_features_selstruct nvme_lba_range_type *dataUser address of feature data, if applicable
__u32 *resultThe command completion result from CQE dword0
Description
Deprecated: doesn’t support specifying a NSID. Use nvme_get_features_lba_range2() instead.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_features_lba_range2(int fd, enum nvme_get_features_sel sel, __u32 nsid, struct nvme_lba_range_type *data, __u32 *result)¶ Get LBA range feature
Parameters
int fdFile descriptor of nvme device
enum nvme_get_features_sel selSelect which type of attribute to return, see
enum nvme_get_features_sel__u32 nsidNamespace ID
struct nvme_lba_range_type *dataBuffer to receive LBA Range Type data structure
__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_features_temp_thresh(int fd, enum nvme_get_features_sel sel, __u32 *result)¶ Get temperature threshold feature
Parameters
int fdFile descriptor of nvme device
enum nvme_get_features_sel selSelect which type of attribute to return, see
enum nvme_get_features_sel__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_features_err_recovery(int fd, enum nvme_get_features_sel sel, __u32 *result)¶ Get error recovery feature
Parameters
int fdFile descriptor of nvme device
enum nvme_get_features_sel selSelect which type of attribute to return, see
enum nvme_get_features_sel__u32 *resultThe command completion result from CQE dword0
Description
Deprecated: doesn’t support specifying a NSID. Use nvme_get_features_err_recovery2() instead.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_features_err_recovery2(int fd, enum nvme_get_features_sel sel, __u32 nsid, __u32 *result)¶ Get error recovery feature
Parameters
int fdFile descriptor of nvme device
enum nvme_get_features_sel selSelect which type of attribute to return, see
enum nvme_get_features_sel__u32 nsidNamespace ID
__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_features_volatile_wc(int fd, enum nvme_get_features_sel sel, __u32 *result)¶ Get volatile write cache feature
Parameters
int fdFile descriptor of nvme device
enum nvme_get_features_sel selSelect which type of attribute to return, see
enum nvme_get_features_sel__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_features_num_queues(int fd, enum nvme_get_features_sel sel, __u32 *result)¶ Get number of queues feature
Parameters
int fdFile descriptor of nvme device
enum nvme_get_features_sel selSelect which type of attribute to return, see
enum nvme_get_features_sel__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_features_irq_coalesce(int fd, enum nvme_get_features_sel sel, __u32 *result)¶ Get IRQ coalesce feature
Parameters
int fdFile descriptor of nvme device
enum nvme_get_features_sel selSelect which type of attribute to return, see
enum nvme_get_features_sel__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_features_irq_config(int fd, enum nvme_get_features_sel sel, __u16 iv, __u32 *result)¶ Get IRQ config feature
Parameters
int fdFile descriptor of nvme device
enum nvme_get_features_sel selSelect which type of attribute to return, see
enum nvme_get_features_sel
__u16 iv
__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_features_write_atomic(int fd, enum nvme_get_features_sel sel, __u32 *result)¶ Get write atomic feature
Parameters
int fdFile descriptor of nvme device
enum nvme_get_features_sel selSelect which type of attribute to return, see
enum nvme_get_features_sel__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_features_async_event(int fd, enum nvme_get_features_sel sel, __u32 *result)¶ Get asynchronous event feature
Parameters
int fdFile descriptor of nvme device
enum nvme_get_features_sel selSelect which type of attribute to return, see
enum nvme_get_features_sel__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_features_auto_pst(int fd, enum nvme_get_features_sel sel, struct nvme_feat_auto_pst *apst, __u32 *result)¶ Get autonomous power state feature
Parameters
int fdFile descriptor of nvme device
enum nvme_get_features_sel selSelect which type of attribute to return, see
enum nvme_get_features_sel
struct nvme_feat_auto_pst *apst
__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_features_host_mem_buf(int fd, enum nvme_get_features_sel sel, __u32 *result)¶ Get host memory buffer feature
Parameters
int fdFile descriptor of nvme device
enum nvme_get_features_sel selSelect which type of attribute to return, see
enum nvme_get_features_sel__u32 *resultThe command completion result from CQE dword0
Description
Deprecated: doesn’t fetch the Host Memory Buffer Attributes data structure. Use nvme_get_features_host_mem_buf2() instead.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_features_host_mem_buf2(int fd, enum nvme_get_features_sel sel, struct nvme_host_mem_buf_attrs *attrs, __u32 *result)¶ Get host memory buffer feature
Parameters
int fdFile descriptor of nvme device
enum nvme_get_features_sel selSelect which type of attribute to return, see
enum nvme_get_features_selstruct nvme_host_mem_buf_attrs *attrsBuffer for returned Host Memory Buffer Attributes
__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_features_timestamp(int fd, enum nvme_get_features_sel sel, struct nvme_timestamp *ts)¶ Get timestamp feature
Parameters
int fdFile descriptor of nvme device
enum nvme_get_features_sel selSelect which type of attribute to return, see
enum nvme_get_features_selstruct nvme_timestamp *tsCurrent timestamp
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_features_kato(int fd, enum nvme_get_features_sel sel, __u32 *result)¶ Get keep alive timeout feature
Parameters
int fdFile descriptor of nvme device
enum nvme_get_features_sel selSelect which type of attribute to return, see
enum nvme_get_features_sel__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_features_hctm(int fd, enum nvme_get_features_sel sel, __u32 *result)¶ Get thermal management feature
Parameters
int fdFile descriptor of nvme device
enum nvme_get_features_sel selSelect which type of attribute to return, see
enum nvme_get_features_sel__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_features_nopsc(int fd, enum nvme_get_features_sel sel, __u32 *result)¶ Get non-operational power state feature
Parameters
int fdFile descriptor of nvme device
enum nvme_get_features_sel selSelect which type of attribute to return, see
enum nvme_get_features_sel__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_features_rrl(int fd, enum nvme_get_features_sel sel, __u32 *result)¶ Get read recovery level feature
Parameters
int fdFile descriptor of nvme device
enum nvme_get_features_sel selSelect which type of attribute to return, see
enum nvme_get_features_sel__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_features_plm_config(int fd, enum nvme_get_features_sel sel, __u16 nvmsetid, struct nvme_plm_config *data, __u32 *result)¶ Get predictable latency feature
Parameters
int fdFile descriptor of nvme device
enum nvme_get_features_sel selSelect which type of attribute to return, see
enum nvme_get_features_sel__u16 nvmsetidNVM set id
struct nvme_plm_config *data
__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_features_plm_window(int fd, enum nvme_get_features_sel sel, __u16 nvmsetid, __u32 *result)¶ Get window select feature
Parameters
int fdFile descriptor of nvme device
enum nvme_get_features_sel selSelect which type of attribute to return, see
enum nvme_get_features_sel__u16 nvmsetidNVM set id
__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_features_lba_sts_interval(int fd, enum nvme_get_features_sel sel, __u32 *result)¶ Get LBA status information feature
Parameters
int fdFile descriptor of nvme device
enum nvme_get_features_sel selSelect which type of attribute to return, see
enum nvme_get_features_sel__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_features_host_behavior(int fd, enum nvme_get_features_sel sel, struct nvme_feat_host_behavior *data, __u32 *result)¶ Get host behavior feature
Parameters
int fdFile descriptor of nvme device
enum nvme_get_features_sel selSelect which type of attribute to return, see
enum nvme_get_features_selstruct nvme_feat_host_behavior *dataPointer to structure nvme_feat_host_behavior
__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_features_sanitize(int fd, enum nvme_get_features_sel sel, __u32 *result)¶ Get sanitize feature
Parameters
int fdFile descriptor of nvme device
enum nvme_get_features_sel selSelect which type of attribute to return, see
enum nvme_get_features_sel__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_features_endurance_event_cfg(int fd, enum nvme_get_features_sel sel, __u16 endgid, __u32 *result)¶ Get endurance event config feature
Parameters
int fdFile descriptor of nvme device
enum nvme_get_features_sel selSelect which type of attribute to return, see
enum nvme_get_features_sel__u16 endgidEndurance Group Identifier
__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_features_sw_progress(int fd, enum nvme_get_features_sel sel, __u32 *result)¶ Get software progress feature
Parameters
int fdFile descriptor of nvme device
enum nvme_get_features_sel selSelect which type of attribute to return, see
enum nvme_get_features_sel__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_features_host_id(int fd, enum nvme_get_features_sel sel, bool exhid, __u32 len, __u8 *hostid)¶ Get host id feature
Parameters
int fdFile descriptor of nvme device
enum nvme_get_features_sel selSelect which type of attribute to return, see
enum nvme_get_features_selbool exhidEnable Extended Host Identifier
__u32 lenLength of hostid
__u8 *hostidBuffer for returned host ID
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_features_resv_mask(int fd, enum nvme_get_features_sel sel, __u32 *result)¶ Get reservation mask feature
Parameters
int fdFile descriptor of nvme device
enum nvme_get_features_sel selSelect which type of attribute to return, see
enum nvme_get_features_sel__u32 *resultThe command completion result from CQE dword0
Description
Deprecated: doesn’t support specifying a NSID. Use nvme_get_features_resv_mask2() instead.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_features_resv_mask2(int fd, enum nvme_get_features_sel sel, __u32 nsid, __u32 *result)¶ Get reservation mask feature
Parameters
int fdFile descriptor of nvme device
enum nvme_get_features_sel selSelect which type of attribute to return, see
enum nvme_get_features_sel__u32 nsidNamespace ID
__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_features_resv_persist(int fd, enum nvme_get_features_sel sel, __u32 *result)¶ Get reservation persist feature
Parameters
int fdFile descriptor of nvme device
enum nvme_get_features_sel selSelect which type of attribute to return, see
enum nvme_get_features_sel__u32 *resultThe command completion result from CQE dword0
Description
Deprecated: doesn’t support specifying a NSID. Use nvme_get_features_resv_persist2() instead.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_features_resv_persist2(int fd, enum nvme_get_features_sel sel, __u32 nsid, __u32 *result)¶ Get reservation persist feature
Parameters
int fdFile descriptor of nvme device
enum nvme_get_features_sel selSelect which type of attribute to return, see
enum nvme_get_features_sel__u32 nsidNamespace ID
__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_features_write_protect(int fd, __u32 nsid, enum nvme_get_features_sel sel, __u32 *result)¶ Get write protect feature
Parameters
int fdFile descriptor of nvme device
__u32 nsidNamespace ID
enum nvme_get_features_sel selSelect which type of attribute to return, see
enum nvme_get_features_sel__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_features_iocs_profile(int fd, enum nvme_get_features_sel sel, __u32 *result)¶ Get IOCS profile feature
Parameters
int fdFile descriptor of nvme device
enum nvme_get_features_sel selSelect which type of attribute to return, see
enum nvme_get_features_sel__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_format_nvm(struct nvme_format_nvm_args *args)¶ Format nvme namespace(s)
Parameters
struct nvme_format_nvm_args *argsstruct nvme_format_nvme_argsargument structure
Description
The Format NVM command low level formats the NVM media. This command is used by the host to change the LBA data size and/or metadata size. A low level format may destroy all data and metadata associated with all namespaces or only the specific namespace associated with the command
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_ns_mgmt(struct nvme_ns_mgmt_args *args)¶ Issue a Namespace management command
Parameters
struct nvme_ns_mgmt_args *argsstruct nvme_ns_mgmt_argsArgument structure
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_ns_mgmt_create(int fd, struct nvme_id_ns *ns, __u32 *nsid, __u32 timeout, __u8 csi, struct nvme_ns_mgmt_host_sw_specified *data)¶ Create a non attached namespace
Parameters
int fdFile descriptor of nvme device
struct nvme_id_ns *nsNamespace identification that defines ns creation parameters
__u32 *nsidOn success, set to the namespace id that was created
__u32 timeoutOverride the default timeout to this value in milliseconds; set to 0 to use the system default.
__u8 csiCommand Set Identifier
struct nvme_ns_mgmt_host_sw_specified *dataHost Software Specified Fields that defines ns creation parameters
Description
On successful creation, the namespace exists in the subsystem, but is not attached to any controller. Use the nvme_ns_attach_ctrls() to assign the namespace to one or more controllers.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_ns_mgmt_delete(int fd, __u32 nsid)¶ Delete a non attached namespace
Parameters
int fdFile descriptor of nvme device
__u32 nsidNamespace identifier to delete
Description
It is recommended that a namespace being deleted is not attached to any controller. Use the nvme_ns_detach_ctrls() first if the namespace is still attached.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_ns_attach(struct nvme_ns_attach_args *args)¶ Attach or detach namespace to controller(s)
Parameters
struct nvme_ns_attach_args *argsstruct nvme_ns_attach_argsArgument structure
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_ns_attach_ctrls(int fd, __u32 nsid, struct nvme_ctrl_list *ctrlist)¶ Attach namespace to controllers
Parameters
int fdFile descriptor of nvme device
__u32 nsidNamespace ID to attach
struct nvme_ctrl_list *ctrlistController list to modify attachment state of nsid
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_ns_detach_ctrls(int fd, __u32 nsid, struct nvme_ctrl_list *ctrlist)¶ Detach namespace from controllers
Parameters
int fdFile descriptor of nvme device
__u32 nsidNamespace ID to detach
struct nvme_ctrl_list *ctrlistController list to modify attachment state of nsid
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_fw_download(struct nvme_fw_download_args *args)¶ Download part or all of a firmware image to the controller
Parameters
struct nvme_fw_download_args *argsstruct nvme_fw_download_argsargument structure
Description
The Firmware Image Download command downloads all or a portion of an image for a future update to the controller. The Firmware Image Download command downloads a new image (in whole or in part) to the controller.
The image may be constructed of multiple pieces that are individually downloaded with separate Firmware Image Download commands. Each Firmware Image Download command includes a Dword Offset and Number of Dwords that specify a dword range.
The new firmware image is not activated as part of the Firmware Image Download command. Use the nvme_fw_commit() to activate a newly downloaded image.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_fw_commit(struct nvme_fw_commit_args *args)¶ Commit firmware using the specified action
Parameters
struct nvme_fw_commit_args *argsstruct nvme_fw_commit_argsargument structure
Description
The Firmware Commit command modifies the firmware image or Boot Partitions.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise. The command
status response may specify additional reset actions required to complete
the commit process.
-
int
nvme_security_send(struct nvme_security_send_args *args)¶ Security Send command
Parameters
struct nvme_security_send_args *argsstruct nvme_security_sendargument structure
Description
The Security Send command transfers security protocol data to the controller. The data structure transferred to the controller as part of this command contains security protocol specific commands to be performed by the controller. The data structure transferred may also contain data or parameters associated with the security protocol commands.
The security data is protocol specific and is not defined by the NVMe specification.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_security_receive(struct nvme_security_receive_args *args)¶ Security Receive command
Parameters
struct nvme_security_receive_args *argsstruct nvme_security_receiveargument structure
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_lba_status(struct nvme_get_lba_status_args *args)¶ Retrieve information on possibly unrecoverable LBAs
Parameters
struct nvme_get_lba_status_args *argsstruct nvme_get_lba_status_argsargument structure
Description
The Get LBA Status command requests information about Potentially Unrecoverable LBAs. Refer to the specification for action type descriptions.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_directive_send(struct nvme_directive_send_args *args)¶ Send directive command
Parameters
struct nvme_directive_send_args *argsstruct nvme_directive_send_argsargument structure
Description
Directives is a mechanism to enable host and NVM subsystem or controller information exchange. The Directive Send command transfers data related to a specific Directive Type from the host to the controller.
See the NVMe specification for more information.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_directive_send_id_endir(int fd, __u32 nsid, bool endir, enum nvme_directive_dtype dtype, struct nvme_id_directives *id)¶ Directive Send Enable Directive
Parameters
int fdFile descriptor of nvme device
__u32 nsidNamespace Identifier
bool endirEnable Directive
enum nvme_directive_dtype dtypeDirective Type
struct nvme_id_directives *idPointer to structure nvme_id_directives
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_directive_send_stream_release_identifier(int fd, __u32 nsid, __u16 stream_id)¶ Directive Send Stream release
Parameters
int fdFile descriptor of nvme device
__u32 nsidNamespace ID
__u16 stream_idStream identifier
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_directive_send_stream_release_resource(int fd, __u32 nsid)¶ Directive Send Stream release resources
Parameters
int fdFile descriptor of nvme device
__u32 nsidNamespace ID
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_directive_recv(struct nvme_directive_recv_args *args)¶ Receive directive specific data
Parameters
struct nvme_directive_recv_args *argsstruct nvme_directive_recv_argsargument structure
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_directive_recv_identify_parameters(int fd, __u32 nsid, struct nvme_id_directives *id)¶ Directive receive identifier parameters
Parameters
int fdFile descriptor of nvme device
__u32 nsidNamespace ID
struct nvme_id_directives *idIdentify parameters buffer
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_directive_recv_stream_parameters(int fd, __u32 nsid, struct nvme_streams_directive_params *parms)¶ Directive receive stream parameters
Parameters
int fdFile descriptor of nvme device
__u32 nsidNamespace ID
struct nvme_streams_directive_params *parmsStreams directive parameters buffer
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_directive_recv_stream_status(int fd, __u32 nsid, unsigned int nr_entries, struct nvme_streams_directive_status *id)¶ Directive receive stream status
Parameters
int fdFile descriptor of nvme device
__u32 nsidNamespace ID
unsigned int nr_entriesNumber of streams to receive
struct nvme_streams_directive_status *idStream status buffer
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_directive_recv_stream_allocate(int fd, __u32 nsid, __u16 nsr, __u32 *result)¶ Directive receive stream allocate
Parameters
int fdFile descriptor of nvme device
__u32 nsidNamespace ID
__u16 nsrNamespace Streams Requested
__u32 *resultIf successful, the CQE dword0 value
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_capacity_mgmt(struct nvme_capacity_mgmt_args *args)¶ Capacity management command
Parameters
struct nvme_capacity_mgmt_args *argsstruct nvme_capacity_mgmt_argsargument structure
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_lockdown(struct nvme_lockdown_args *args)¶ Issue lockdown command
Parameters
struct nvme_lockdown_args *argsstruct nvme_lockdown_argsargument structure
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_set_property(struct nvme_set_property_args *args)¶ Set controller property
Parameters
struct nvme_set_property_args *argsstruct nvme_set_property_argsargument structure
Description
This is an NVMe-over-Fabrics specific command, not applicable to PCIe. These properties align to the PCI MMIO controller registers.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_property(struct nvme_get_property_args *args)¶ Get a controller property
Parameters
struct nvme_get_property_args *argsstruct nvme_get_propert_argsargument structure
Description
This is an NVMe-over-Fabrics specific command, not applicable to PCIe. These properties align to the PCI MMIO controller registers.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_sanitize_nvm(struct nvme_sanitize_nvm_args *args)¶ Start a sanitize operation
Parameters
struct nvme_sanitize_nvm_args *argsstruct nvme_sanitize_nvm_argsargument structure
Description
A sanitize operation alters all user data in the NVM subsystem such that recovery of any previous user data from any cache, the non-volatile media, or any Controller Memory Buffer is not possible.
The Sanitize command starts a sanitize operation or to recover from a previously failed sanitize operation. The sanitize operation types that may be supported are Block Erase, Crypto Erase, and Overwrite. All sanitize operations are processed in the background, i.e., completion of the sanitize command does not indicate completion of the sanitize operation.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_dev_self_test(struct nvme_dev_self_test_args *args)¶ Start or abort a self test
Parameters
struct nvme_dev_self_test_args *argsstruct nvme_dev_self_testargument structure
Description
The Device Self-test command starts a device self-test operation or abort a device self-test operation. A device self-test operation is a diagnostic testing sequence that tests the integrity and functionality of the controller and may include testing of the media associated with namespaces. The controller may return a response to this command immediately while running the self-test in the background.
Set the ‘nsid’ field to 0 to not include namespaces in the test. Set to 0xffffffff to test all namespaces. All other values tests a specific namespace, if present.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_virtual_mgmt(struct nvme_virtual_mgmt_args *args)¶ Virtualization resource management
Parameters
struct nvme_virtual_mgmt_args *argsstruct nvme_virtual_mgmt_argsargument structure
Description
The Virtualization Management command is supported by primary controllers that support the Virtualization Enhancements capability. This command is used for several functions:
Modifying Flexible Resource allocation for the primary controller
Assigning Flexible Resources for secondary controllers
Setting the Online and Offline state for secondary controllers
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_flush(int fd, __u32 nsid)¶ Send an nvme flush command
Parameters
int fdFile descriptor of nvme device
__u32 nsidNamespace identifier
Description
The Flush command requests that the contents of volatile write cache be made non-volatile.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_io(struct nvme_io_args *args, __u8 opcode)¶ Submit an nvme user I/O command
Parameters
struct nvme_io_args *argsstruct nvme_io_argsargument structure__u8 opcodeOpcode to execute
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_read(struct nvme_io_args *args)¶ Submit an nvme user read command
Parameters
struct nvme_io_args *argsstruct nvme_io_argsargument structure
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_write(struct nvme_io_args *args)¶ Submit an nvme user write command
Parameters
struct nvme_io_args *argsstruct nvme_io_argsargument structure
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_compare(struct nvme_io_args *args)¶ Submit an nvme user compare command
Parameters
struct nvme_io_args *argsstruct nvme_io_argsargument structure
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_write_zeros(struct nvme_io_args *args)¶ Submit an nvme write zeroes command
Parameters
struct nvme_io_args *argsstruct nvme_io_argsargument structure
Description
The Write Zeroes command sets a range of logical blocks to zero. After successful completion of this command, the value returned by subsequent reads of logical blocks in this range shall be all bytes cleared to 0h until a write occurs to this LBA range.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_write_uncorrectable(struct nvme_io_args *args)¶ Submit an nvme write uncorrectable command
Parameters
struct nvme_io_args *argsstruct nvme_io_argsargument structure
Description
The Write Uncorrectable command marks a range of logical blocks as invalid. When the specified logical block(s) are read after this operation, a failure is returned with Unrecovered Read Error status. To clear the invalid logical block status, a write operation on those logical blocks is required.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_verify(struct nvme_io_args *args)¶ Send an nvme verify command
Parameters
struct nvme_io_args *argsstruct nvme_io_argsargument structure
Description
The Verify command verifies integrity of stored information by reading data and metadata, if applicable, for the LBAs indicated without transferring any data or metadata to the host.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_dsm(struct nvme_dsm_args *args)¶ Send an nvme data set management command
Parameters
struct nvme_dsm_args *argsstruct nvme_dsm_argsargument structure
Description
The Dataset Management command is used by the host to indicate attributes for ranges of logical blocks. This includes attributes like frequency that data is read or written, access size, and other information that may be used to optimize performance and reliability, and may be used to deallocate/unmap/trim those logical blocks.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_copy(struct nvme_copy_args *args)¶ Copy command
Parameters
struct nvme_copy_args *argsstruct nvme_copy_argsargument structure
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_resv_acquire(struct nvme_resv_acquire_args *args)¶ Send an nvme reservation acquire
Parameters
struct nvme_resv_acquire_args *argsstruct nvme_resv_acquireargument structure
Description
The Reservation Acquire command acquires a reservation on a namespace, preempt a reservation held on a namespace, and abort a reservation held on a namespace.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_resv_register(struct nvme_resv_register_args *args)¶ Send an nvme reservation register
Parameters
struct nvme_resv_register_args *argsstruct nvme_resv_register_argsargument structure
Description
The Reservation Register command registers, unregisters, or replaces a reservation key.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_resv_release(struct nvme_resv_release_args *args)¶ Send an nvme reservation release
Parameters
struct nvme_resv_release_args *argsstruct nvme_resv_release_argsargument structure
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_resv_report(struct nvme_resv_report_args *args)¶ Send an nvme reservation report
Parameters
struct nvme_resv_report_args *argsstruct nvme_resv_report_args argument structure
Description
Returns a Reservation Status data structure to memory that describes the
registration and reservation status of a namespace. See the definition for
the returned structure, struct nvme_reservation_status, for more details.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_io_mgmt_recv(struct nvme_io_mgmt_recv_args *args)¶ I/O Management Receive command
Parameters
struct nvme_io_mgmt_recv_args *argsstruct nvme_io_mgmt_recv_argsargument structure
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_fdp_reclaim_unit_handle_status(int fd, __u32 nsid, __u32 data_len, void *data)¶ Get reclaim unit handle status
Parameters
int fdFile descriptor of nvme device
__u32 nsidNamespace identifier
__u32 data_lenLength of response buffer
void *dataResponse buffer
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_io_mgmt_send(struct nvme_io_mgmt_send_args *args)¶ I/O Management Send command
Parameters
struct nvme_io_mgmt_send_args *argsstruct nvme_io_mgmt_send_argsargument structure
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_fdp_reclaim_unit_handle_update(int fd, __u32 nsid, unsigned int npids, __u16 *pids)¶ Update a list of reclaim unit handles
Parameters
int fdFile descriptor of nvme device
__u32 nsidNamespace identifier
unsigned int npidsNumber of placement identifiers
__u16 *pidsList of placement identifiers
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_zns_mgmt_send(struct nvme_zns_mgmt_send_args *args)¶ ZNS management send command
Parameters
struct nvme_zns_mgmt_send_args *argsstruct nvme_zns_mgmt_send_argsargument structure
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_zns_mgmt_recv(struct nvme_zns_mgmt_recv_args *args)¶ ZNS management receive command
Parameters
struct nvme_zns_mgmt_recv_args *argsstruct nvme_zns_mgmt_recv_argsargument structure
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_zns_report_zones(int fd, __u32 nsid, __u64 slba, enum nvme_zns_report_options opts, bool extended, bool partial, __u32 data_len, void *data, __u32 timeout, __u32 *result)¶ Return the list of zones
Parameters
int fdFile descriptor of nvme device
__u32 nsidNamespace ID
__u64 slbaStarting LBA
enum nvme_zns_report_options optsReporting options
bool extendedExtended report
bool partialPartial report requested
__u32 data_lenLength of the data buffer
void *dataUserspace address of the report zones data
__u32 timeouttimeout in ms
__u32 *resultThe command completion result from CQE dword0
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_zns_append(struct nvme_zns_append_args *args)¶ Append data to a zone
Parameters
struct nvme_zns_append_args *argsstruct nvme_zns_append_argsargument structure
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_dim_send(struct nvme_dim_args *args)¶ Send a Discovery Information Management (DIM) command
Parameters
struct nvme_dim_args *argsstruct nvme_dim_argsargument structure
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
void
nvme_set_debug(bool debug)¶ Set NVMe command debugging output
Parameters
bool debugtrue to enable or false to disable
-
bool
nvme_get_debug(void)¶ Get NVMe command debugging output
Parameters
voidno arguments
Return
false if disabled or true if enabled.
fabrics.h
Fabrics-specific definitions.
-
struct
nvme_fabrics_config¶ Defines all linux nvme fabrics initiator options
Definition
struct nvme_fabrics_config {
char *host_traddr;
char *host_iface;
int queue_size;
int nr_io_queues;
int reconnect_delay;
int ctrl_loss_tmo;
int fast_io_fail_tmo;
int keep_alive_tmo;
int nr_write_queues;
int nr_poll_queues;
int tos;
int keyring;
int tls_key;
bool duplicate_connect;
bool disable_sqflow;
bool hdr_digest;
bool data_digest;
bool tls;
};
Members
host_traddrHost transport address
host_ifaceHost interface name
queue_sizeNumber of IO queue entries
nr_io_queuesNumber of controller IO queues to establish
reconnect_delayTime between two consecutive reconnect attempts.
ctrl_loss_tmoOverride the default controller reconnect attempt timeout in seconds
fast_io_fail_tmoSet the fast I/O fail timeout in seconds.
keep_alive_tmoOverride the default keep-alive-timeout to this value in seconds
nr_write_queuesNumber of queues to use for exclusively for writing
nr_poll_queuesNumber of queues to reserve for polling completions
tosType of service
keyringKeyring to store and lookup keys
tls_keyTLS PSK for the connection
duplicate_connectAllow multiple connections to the same target
disable_sqflowDisable controller sq flow control
hdr_digestGenerate/verify header digest (TCP)
data_digestGenerate/verify data digest (TCP)
tlsStart TLS on the connection (TCP)
-
const char *
nvmf_trtype_str(__u8 trtype)¶ Decode TRTYPE field
Parameters
__u8 trtypevalue to be decoded
Description
Decode the transport type field in the discovery log page entry.
Return
decoded string
-
const char *
nvmf_adrfam_str(__u8 adrfam)¶ Decode ADRFAM field
Parameters
__u8 adrfamvalue to be decoded
Description
Decode the address family field in the discovery log page entry.
Return
decoded string
-
const char *
nvmf_subtype_str(__u8 subtype)¶ Decode SUBTYPE field
Parameters
__u8 subtypevalue to be decoded
Description
Decode the subsystem type field in the discovery log page entry.
Return
decoded string
-
const char *
nvmf_treq_str(__u8 treq)¶ Decode TREQ field
Parameters
__u8 treqvalue to be decoded
Description
Decode the transport requirements field in the discovery log page entry.
Return
decoded string
-
const char *
nvmf_eflags_str(__u16 eflags)¶ Decode EFLAGS field
Parameters
__u16 eflagsvalue to be decoded
Description
Decode the EFLAGS field in the discovery log page entry.
Return
decoded string
-
const char *
nvmf_sectype_str(__u8 sectype)¶ Decode SECTYPE field
Parameters
__u8 sectypevalue to be decoded
Description
Decode the SECTYPE field in the discovery log page entry.
Return
decoded string
-
const char *
nvmf_prtype_str(__u8 prtype)¶ Decode RDMA Provider type field
Parameters
__u8 prtypevalue to be decoded
Description
Decode the RDMA Provider type field in the discovery log page entry.
Return
decoded string
-
const char *
nvmf_qptype_str(__u8 qptype)¶ Decode RDMA QP Service type field
Parameters
__u8 qptypevalue to be decoded
Description
Decode the RDMA QP Service type field in the discovery log page entry.
Return
decoded string
-
const char *
nvmf_cms_str(__u8 cms)¶ Decode RDMA connection management service field
Parameters
__u8 cmsvalue to be decoded
Description
Decode the RDMA connection management service field in the discovery log page entry.
Return
decoded string
-
void
nvmf_default_config(struct nvme_fabrics_config *cfg)¶ Default values for fabrics configuration
Parameters
struct nvme_fabrics_config *cfgconfig values to set
Description
Initializes cfg with default values.
-
void
nvmf_update_config(nvme_ctrl_t c, const struct nvme_fabrics_config *cfg)¶ Update fabrics configuration values
Parameters
nvme_ctrl_t cController to be modified
const struct nvme_fabrics_config *cfgUpdated configuration values
Description
Updates the values from c with the configuration values from cfg; all non-default values from cfg will overwrite the values in c.
-
int
nvmf_add_ctrl(nvme_host_t h, nvme_ctrl_t c, const struct nvme_fabrics_config *cfg)¶ Connect a controller and update topology
Parameters
nvme_host_t hHost to which the controller should be attached
nvme_ctrl_t cController to be connected
const struct nvme_fabrics_config *cfgDefault configuration for the controller
Description
Issues a ‘connect’ command to the NVMe-oF controller and inserts c into the topology using h as parent. c must be initialized and not connected to the topology.
Return
0 on success; on failure errno is set and -1 is returned.
-
int
nvmf_get_discovery_log(nvme_ctrl_t c, struct nvmf_discovery_log **logp, int max_retries)¶ Return the discovery log page
Parameters
nvme_ctrl_t cDiscovery controller to use
struct nvmf_discovery_log **logpPointer to the log page to be returned
int max_retriesNumber of retries in case of failure
Description
The memory allocated for the log page and returned in logp must be freed by the caller using free().
Note
Consider using nvmf_get_discovery_wargs() instead.
Return
0 on success; on failure -1 is returned and errno is set
-
struct
nvme_get_discovery_args¶ Arguments for nvmf_get_discovery_wargs()
Definition
struct nvme_get_discovery_args {
nvme_ctrl_t c;
int args_size;
int max_retries;
__u32 *result;
__u32 timeout;
__u8 lsp;
};
Members
cDiscovery controller
args_sizeLength of the structure
max_retriesNumber of retries in case of failure
resultThe command completion result from CQE dword0
timeoutTimeout in ms (default: NVME_DEFAULT_IOCTL_TIMEOUT)
lspLog specific field (See enum nvmf_log_discovery_lsp)
-
struct nvmf_discovery_log *
nvmf_get_discovery_wargs(struct nvme_get_discovery_args *args)¶ Get the discovery log page with args
Parameters
struct nvme_get_discovery_args *argsArgument structure
Description
This function is similar to nvmf_get_discovery_log(), but takes an extensible args parameter. args provides more options than nvmf_get_discovery_log().
This function performs a get discovery log page (DLP) command and returns the DLP. The memory allocated for the returned DLP must be freed by the caller using free().
Return
Pointer to the discovery log page (to be freed). NULL on failure and errno is set.
-
char *
nvmf_hostnqn_generate()¶ Generate a machine specific host nqn
Parameters
Return
An nvm namespace qualified name string based on the machine identifier, or NULL if not successful.
-
char *
nvmf_hostnqn_from_file()¶ Reads the host nvm qualified name from the config default location
Parameters
Description
Retrieve the qualified name from the config file located in $SYSCONFIDR/nvme. $SYSCONFDIR is usually /etc.
Return
The host nqn, or NULL if unsuccessful. If found, the caller is responsible to free the string.
-
char *
nvmf_hostid_from_file()¶ Reads the host identifier from the config default location
Parameters
Description
Retrieve the host idenditifer from the config file located in $SYSCONFDIR/nvme/. $SYSCONFDIR is usually /etc.
Return
- The host identifier, or NULL if unsuccessful. If found, the caller
is responsible to free the string.
-
nvme_ctrl_t
nvmf_connect_disc_entry(nvme_host_t h, struct nvmf_disc_log_entry *e, const struct nvme_fabrics_config *defcfg, bool *discover)¶ Connect controller based on the discovery log page entry
Parameters
nvme_host_t hHost to which the controller should be connected
struct nvmf_disc_log_entry *eDiscovery log page entry
const struct nvme_fabrics_config *defcfgDefault configuration to be used for the new controller
bool *discoverSet to ‘true’ if the new controller is a discovery controller
Return
Pointer to the new controller
-
bool
nvmf_is_registration_supported(nvme_ctrl_t c)¶ check whether registration can be performed.
Parameters
nvme_ctrl_t cController instance
Description
Only discovery controllers (DC) that comply with TP8010 support explicit registration with the DIM PDU. These can be identified by looking at the value of a dctype in the Identify command response. A value of 1 (DDC) or 2 (CDC) indicates that the DC supports explicit registration.
Return
true if controller supports explicit registration. false otherwise.
-
int
nvmf_register_ctrl(nvme_ctrl_t c, enum nvmf_dim_tas tas, __u32 *result)¶ Perform registration task with a DC
Parameters
nvme_ctrl_t cController instance
enum nvmf_dim_tas tasTask field of the Command Dword 10 (cdw10). Indicates whether to perform a Registration, Deregistration, or Registration-update.
__u32 *resultThe command-specific result returned by the DC upon command completion.
Description
Perform registration task with a Discovery Controller (DC). Three tasks are supported: register, deregister, and registration update.
Return
0 on success; on failure -1 is returned and errno is set
linux.h
linux-specific utility functions
-
int
nvme_fw_download_seq(int fd, __u32 size, __u32 xfer, __u32 offset, void *buf)¶ Firmware download sequence
Parameters
int fdFile descriptor of nvme device
__u32 sizeTotal size of the firmware image to transfer
__u32 xferMaximum size to send with each partial transfer
__u32 offsetStarting offset to send with this firmware download
void *bufAddress of buffer containing all or part of the firmware image.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
enum
nvme_telemetry_da¶ Telemetry Log Data Area
Constants
NVME_TELEMETRY_DA_1Data Area 1
NVME_TELEMETRY_DA_2Data Area 2
NVME_TELEMETRY_DA_3Data Area 3
NVME_TELEMETRY_DA_4Data Area 4
-
int
nvme_get_telemetry_max(int fd, enum nvme_telemetry_da *da, size_t *max_data_tx)¶ Get telemetry limits
Parameters
int fdFile descriptor of nvme device
enum nvme_telemetry_da *daOn success return max supported data area
size_t *max_data_txOn success set to max transfer chunk supported by the controller
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_telemetry_log(int fd, bool create, bool ctrl, bool rae, size_t max_data_tx, enum nvme_telemetry_da da, struct nvme_telemetry_log **log, size_t *size)¶ Get specified telemetry log
Parameters
int fdFile descriptor of nvme device
bool createGenerate new host initated telemetry capture
bool ctrlGet controller Initiated log
bool raeRetain asynchronous events
size_t max_data_txSet the max data transfer size to be used retrieving telemetry.
enum nvme_telemetry_da daLog page data area, valid values:
enum nvme_telemetry_da.struct nvme_telemetry_log **logOn success, set to the value of the allocated and retrieved log.
size_t *sizePtr to the telemetry log size, so it can be returned
Description
- The total size allocated can be calculated as:
(nvme_telemetry_log da size + 1) * NVME_LOG_TELEM_BLOCK_SIZE.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_ctrl_telemetry(int fd, bool rae, struct nvme_telemetry_log **log, enum nvme_telemetry_da da, size_t *size)¶ Get controller telemetry log
Parameters
int fdFile descriptor of nvme device
bool raeRetain asynchronous events
struct nvme_telemetry_log **logOn success, set to the value of the allocated and retrieved log.
enum nvme_telemetry_da daLog page data area, valid values:
enum nvme_telemetry_dasize_t *sizePtr to the telemetry log size, so it can be returned
Description
- The total size allocated can be calculated as:
(nvme_telemetry_log da size + 1) * NVME_LOG_TELEM_BLOCK_SIZE.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_host_telemetry(int fd, struct nvme_telemetry_log **log, enum nvme_telemetry_da da, size_t *size)¶ Get host telemetry log
Parameters
int fdFile descriptor of nvme device
struct nvme_telemetry_log **logOn success, set to the value of the allocated and retrieved log.
enum nvme_telemetry_da daLog page data area, valid values:
enum nvme_telemetry_dasize_t *sizePtr to the telemetry log size, so it can be returned
Description
- The total size allocated can be calculated as:
(nvme_telemetry_log da size + 1) * NVME_LOG_TELEM_BLOCK_SIZE.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_new_host_telemetry(int fd, struct nvme_telemetry_log **log, enum nvme_telemetry_da da, size_t *size)¶ Get new host telemetry log
Parameters
int fdFile descriptor of nvme device
struct nvme_telemetry_log **logOn success, set to the value of the allocated and retrieved log.
enum nvme_telemetry_da daLog page data area, valid values:
enum nvme_telemetry_dasize_t *sizePtr to the telemetry log size, so it can be returned
Description
- The total size allocated can be calculated as:
(nvme_telemetry_log da size + 1) * NVME_LOG_TELEM_BLOCK_SIZE.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_ana_log_len(int fd, size_t *analen)¶ Retrieve size of the current ANA log
Parameters
int fdFile descriptor of nvme device
size_t *analenPointer to where the length will be set on success
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_logical_block_size(int fd, __u32 nsid, int *blksize)¶ Retrieve block size
Parameters
int fdFile descriptor of nvme device
__u32 nsidNamespace id
int *blksizePointer to where the block size will be set on success
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_get_lba_status_log(int fd, bool rae, struct nvme_lba_status_log **log)¶ Retrieve the LBA Status log page
Parameters
int fdFile descriptor of the nvme device
bool raeRetain asynchronous events
struct nvme_lba_status_log **logOn success, set to the value of the allocated and retrieved log.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_namespace_attach_ctrls(int fd, __u32 nsid, __u16 num_ctrls, __u16 *ctrlist)¶ Attach namespace to controller(s)
Parameters
int fdFile descriptor of nvme device
__u32 nsidNamespace ID to attach
__u16 num_ctrlsNumber of controllers in ctrlist
__u16 *ctrlistList of controller IDs to perform the attach action
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_namespace_detach_ctrls(int fd, __u32 nsid, __u16 num_ctrls, __u16 *ctrlist)¶ Detach namespace from controller(s)
Parameters
int fdFile descriptor of nvme device
__u32 nsidNamespace ID to detach
__u16 num_ctrlsNumber of controllers in ctrlist
__u16 *ctrlistList of controller IDs to perform the detach action
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_open(const char *name)¶ Open an nvme controller or namespace device
Parameters
const char *nameThe basename of the device to open
Description
This will look for the handle in /dev/ and validate the name and filetype match linux conventions.
Return
A file descriptor for the device on a successful open, or -1 with errno set otherwise.
-
enum
nvme_hmac_alg¶ HMAC algorithm
Constants
NVME_HMAC_ALG_NONENo HMAC algorithm
NVME_HMAC_ALG_SHA2_256SHA2-256
NVME_HMAC_ALG_SHA2_384SHA2-384
NVME_HMAC_ALG_SHA2_512SHA2-512
-
int
nvme_gen_dhchap_key(char *hostnqn, enum nvme_hmac_alg hmac, unsigned int key_len, unsigned char *secret, unsigned char *key)¶ DH-HMAC-CHAP key generation
Parameters
char *hostnqnHost NVMe Qualified Name
enum nvme_hmac_alg hmacHMAC algorithm
unsigned int key_lenOutput key length
unsigned char *secretSecret to used for digest
unsigned char *keyGenerated DH-HMAC-CHAP key
Return
If key generation was successful the function returns 0 or -1 with errno set otherwise.
-
long
nvme_lookup_keyring(const char *keyring)¶ Lookup keyring serial number
Parameters
const char *keyringKeyring name
Description
Looks up the serial number of the keyring keyring.
Return
The key serial number of the keyring or 0 with errno set otherwise.
-
char *
nvme_describe_key_serial(long key_id)¶ Return key description
Parameters
long key_idKey serial number
Description
Fetches the description of the key or keyring identified by the serial number key_id.
Return
The description of key_id or NULL on failure. The returned string needs to be freed by the caller.
-
long
nvme_lookup_key(const char *type, const char *identity)¶ Lookup key serial number
Parameters
const char *typeKey type
const char *identityKey description
Description
Looks up the serial number of the key identity
with type type in the current session keyring.
Return
The key serial number of the key or 0 with errno set otherwise.
-
int
nvme_set_keyring(long keyring_id)¶ Link keyring for lookup
Parameters
long keyring_idKeyring id
Description
Links keyring_id into the session keyring such that its keys are available for further key lookups.
Return
0 on success, a negative number on error with errno set.
-
long
nvme_insert_tls_key(const char *keyring, const char *key_type, const char *hostnqn, const char *subsysnqn, int hmac, unsigned char *configured_key, int key_len)¶ Derive and insert TLS key
Parameters
const char *keyringKeyring to use
const char *key_typeType of the resulting key
const char *hostnqnHost NVMe Qualified Name
const char *subsysnqnSubsystem NVMe Qualified Name
int hmacHMAC algorithm
unsigned char *configured_keyConfigured key data to derive the key from
int key_lenLength of configured_key
Description
Derives a ‘retained’ TLS key as specified in NVMe TCP 1.0a and stores it as type key_type in the keyring specified by keyring.
Return
The key serial number if the key could be inserted into the keyring or 0 with errno otherwise.
mi.h - NVMe Management Interface library (libnvme-mi) definitions.
These provide an abstraction for the MI messaging between controllers and a host, typically over an MCTP-over-i2c link to a NVMe device, used as part of the out-of-band management of a system.
We have a few data structures define here to reflect the topology of a MI connection with an NVMe subsystem:
nvme_mi_ep_t: an MI endpoint - our mechanism of communication with a NVMe subsystem. For MCTP, an endpoint will be the component that holds the MCTP address (EID), and receives our request message.endpoints are defined in the NVMe-MI spec, and are specific to the MI interface.
Each endpoint will provide access to one or more of:
nvme_mi_ctrl_t: a NVMe controller, as defined by the NVMe base spec. The controllers are responsible for processing any NVMe standard commands (eg, the Admin command set). An endpoint (nvme_mi_ep_t) may provide access to multiple controllers - so each of the controller- type commands will require anvme_mi_ctrl_tto be specified, rather than an endpoint
A couple of conventions with the libnvme-mi API:
All types and functions have the nvme_mi prefix, to distinguish from the libnvme core.
We currently support either MI commands and Admin commands. The former adds a _mi prefix, the latter an _admin prefix. [This does result in the MI functions having a double _mi, like
nvme_mi_mi_subsystem_health_status_poll, which is apparently amusing for our German-speaking readers]
For return values: unless specified in the per-function documentation, all functions:
return 0 on success
return -1, with errno set, for errors communicating with the MI device, either in request or response data
return >1 on MI status errors. This value is the 8-bit MI status value, represented by
enum nvme_mi_resp_status. Note that the status values may be vendor-defined above 0xe0.
For the second case, we have a few conventions for errno values:
EPROTO: response data violated the MI protocol, and libnvme cannot validly interpret the response
EIO: Other I/O error communicating with device (eg., valid but unexpected response data)
EINVAL: invalid input arguments for a command
In line with the core NVMe API, the Admin command functions take an _args structure to provide the command-specific parameters. However, for the MI interface, the fd and timeout members of these _args structs are ignored.
References to the specifications here will either to be the NVM Express Management Interface (“NVMe-MI”) or the NVM Express Base specification (“NVMe”). At the time of writing, the versions we’re referencing here are:
NVMe-MI 1.2b
NVMe 2.0b
with a couple of accommodations for older spec types, particularly NVMe-MI 1.1, where possible.
-
NVME_MI_MSGTYPE_NVME¶
NVME_MI_MSGTYPE_NVME ()
MCTP message type for NVMe-MI messages.
Parameters
Description
This is defined by MCTP, but is referenced as part of the NVMe-MI message spec. This is the MCTP NVMe message type (0x4), with the message-integrity bit (0x80) set.
-
enum
nvme_mi_message_type¶ NVMe-MI message type field.
Constants
NVME_MI_MT_CONTROLNVME-MI Control Primitive
NVME_MI_MT_MINVMe-MI command
NVME_MI_MT_ADMINNVMe Admin command
NVME_MI_MT_PCIEPCIe command
Description
Used as byte 1 of both request and response messages (NMIMT bits of NMP byte). Not to be confused with the MCTP message type in byte 0.
-
enum
nvme_mi_ror¶ Request or response field.
Constants
NVME_MI_ROR_REQrequest message
NVME_MI_ROR_RSPresponse message
-
enum
nvme_mi_resp_status¶ values for the response status field
Constants
NVME_MI_RESP_SUCCESSsuccess
NVME_MI_RESP_MPRMore Processing Required
NVME_MI_RESP_INTERNAL_ERRInternal Error
NVME_MI_RESP_INVALID_OPCODEInvalid command opcode
NVME_MI_RESP_INVALID_PARAMInvalid command parameter
NVME_MI_RESP_INVALID_CMD_SIZEInvalid command size
NVME_MI_RESP_INVALID_INPUT_SIZEInvalid command input data size
NVME_MI_RESP_ACCESS_DENIEDAccess Denied
NVME_MI_RESP_VPD_UPDATES_EXCEEDEDMore VPD updates than allowed
NVME_MI_RESP_PCIE_INACCESSIBLEPCIe functionality currently unavailable
NVME_MI_RESP_MEB_SANITIZEDMEB has been cleared due to sanitize
NVME_MI_RESP_ENC_SERV_FAILUREEnclosure services process failed
NVME_MI_RESP_ENC_SERV_XFER_FAILURETransfer with enclosure services failed
NVME_MI_RESP_ENC_FAILUREUnreoverable enclosure failure
NVME_MI_RESP_ENC_XFER_REFUSEDEnclosure services transfer refused
NVME_MI_RESP_ENC_FUNC_UNSUPUnsupported enclosure services function
NVME_MI_RESP_ENC_SERV_UNAVAILEnclosure services unavailable
NVME_MI_RESP_ENC_DEGRADEDNoncritical failure detected by enc. services
NVME_MI_RESP_SANITIZE_IN_PROGRESSCommand prohibited during sanitize
-
struct
nvme_mi_msg_hdr¶ General MI message header.
Definition
struct nvme_mi_msg_hdr {
__u8 type;
__u8 nmp;
__u8 meb;
__u8 rsvd0;
};
Members
typeMCTP message type, will always be NVME_MI_MSGTYPE_NVME
nmpNVMe-MI message parameters (including MI message type)
mebManagement Endpoint Buffer flag; unused for libnvme-mi implementation
rsvd0currently reserved
Description
Wire format shared by both request and response messages, per NVMe-MI section 3.1. This is used for all message types, MI and Admin.
-
struct
nvme_mi_msg_resp¶ Generic response type.
Definition
struct nvme_mi_msg_resp {
struct nvme_mi_msg_hdr hdr;
__u8 status;
__u8 rsvd0[3];
};
Members
hdrthe general request/response message header
statusresponse status value (see
enum nvme_mi_resp_status)rsvd0reserved data, may be defined by specific response
Description
Every response will start with one of these; command-specific responses will define parts of the reserved data, and may add further fields.
-
enum
nvme_mi_mi_opcode¶ Operation code for supported NVMe-MI commands.
Constants
nvme_mi_mi_opcode_mi_data_readRead NVMe-MI Data Structure
nvme_mi_mi_opcode_subsys_health_status_pollSubsystem Health Status Poll
nvme_mi_mi_opcode_configuration_setMI Configuration Set
nvme_mi_mi_opcode_configuration_getMI Configuration Get
-
struct
nvme_mi_mi_req_hdr¶ MI request message header.
Definition
struct nvme_mi_mi_req_hdr {
struct nvme_mi_msg_hdr hdr;
__u8 opcode;
__u8 rsvd0[3];
__le32 cdw0, cdw1;
};
Members
hdrgeneric MI message header
opcodeopcode (OPC) for the specific MI command
rsvd0reserved bytes
cdw0Management Request Doubleword 0 - command specific usage
cdw1Management Request Doubleword 1 - command specific usage
Description
Wire format for MI request message headers, defined in section 5 of NVMe-MI.
-
struct
nvme_mi_mi_resp_hdr¶ MI response message header.
Definition
struct nvme_mi_mi_resp_hdr {
struct nvme_mi_msg_hdr hdr;
__u8 status;
__u8 nmresp[3];
};
Members
hdrgeneric MI message header
statusgeneric response status from command; non-zero on failure.
nmrespNVMe Management Response: command-type-specific response data
Description
Wire format for MI response message header, defined in section 5 of NVMe-MI.
-
enum
nvme_mi_dtyp¶ Data Structure Type field.
Constants
nvme_mi_dtyp_subsys_infoNVM Subsystem Information
nvme_mi_dtyp_port_infoPort information
nvme_mi_dtyp_ctrl_listController List
nvme_mi_dtyp_ctrl_infoController Information
nvme_mi_dtyp_opt_cmd_supportOptionally Supported Command List
nvme_mi_dtyp_meb_supportManagement Endpoint Buffer Command Support List
Description
Data Structure Type field for Read NVMe-MI Data Structure command, used to indicate the particular structure to query from the endpoint.
-
enum
nvme_mi_config_id¶ NVMe-MI Configuration identifier.
Constants
NVME_MI_CONFIG_SMBUS_FREQCurrent SMBus/I2C frequency
NVME_MI_CONFIG_HEALTH_STATUS_CHANGEHealth Status change - used to clear health status bits in CCS bits of status poll. Only for Set ops.
NVME_MI_CONFIG_MCTP_MTUMCTP maximum transmission unit size of port specified in dw 0
Description
Configuration parameters for the MI Get/Set Configuration commands.
See :c:type:`nvme_mi_mi_config_get`() and :c:type:`nvme_mi_config_set`().
-
enum
nvme_mi_config_smbus_freq¶ SMBus/I2C frequency values
Constants
NVME_MI_CONFIG_SMBUS_FREQ_100kHz100kHz
NVME_MI_CONFIG_SMBUS_FREQ_400kHz400kHz
NVME_MI_CONFIG_SMBUS_FREQ_1MHz1MHz
Description
Values used in the SMBus Frequency device configuration. See :c:type:`nvme_mi_mi_config_get_smbus_freq`() and :c:type:`nvme_mi_mi_config_set_smbus_freq`().
-
struct
nvme_mi_admin_req_hdr¶ Admin command request header.
Definition
struct nvme_mi_admin_req_hdr {
struct nvme_mi_msg_hdr hdr;
__u8 opcode;
__u8 flags;
__le16 ctrl_id;
__le32 cdw1, cdw2, cdw3, cdw4, cdw5;
__le32 doff;
__le32 dlen;
__le32 rsvd0, rsvd1;
__le32 cdw10, cdw11, cdw12, cdw13, cdw14, cdw15;
};
Members
hdrGeneric MI message header
opcodeAdmin command opcode (using enum nvme_admin_opcode)
flagsCommand Flags, indicating dlen and doff validity; Only defined in NVMe-MI version 1.1, no fields defined in 1.2 (where the dlen/doff are always considered valid).
ctrl_idController ID target of command
cdw1Submission Queue Entry doubleword 1
cdw2Submission Queue Entry doubleword 2
cdw3Submission Queue Entry doubleword 3
cdw4Submission Queue Entry doubleword 4
cdw5Submission Queue Entry doubleword 5
doffOffset of data to return from command
dlenLength of sent/returned data
rsvd0Reserved
rsvd1Reserved
cdw10Submission Queue Entry doubleword 10
cdw11Submission Queue Entry doubleword 11
cdw12Submission Queue Entry doubleword 12
cdw13Submission Queue Entry doubleword 13
cdw14Submission Queue Entry doubleword 14
cdw15Submission Queue Entry doubleword 15
Description
Wire format for Admin command message headers, defined in section 6 of NVMe-MI.
-
struct
nvme_mi_admin_resp_hdr¶ Admin command response header.
Definition
struct nvme_mi_admin_resp_hdr {
struct nvme_mi_msg_hdr hdr;
__u8 status;
__u8 rsvd0[3];
__le32 cdw0, cdw1, cdw3;
};
Members
hdrGeneric MI message header
statusGeneric response code, non-zero on failure
rsvd0Reserved
cdw0Completion Queue Entry doubleword 0
cdw1Completion Queue Entry doubleword 1
cdw3Completion Queue Entry doubleword 3
Description
This is the generic response format with the three doublewords of completion queue data, plus optional response data.
-
const char *
nvme_mi_status_to_string(int status)¶ return a string representation of the MI status.
Parameters
int statusMI response status
Description
Gives a string description of status, as per section 4.1.2 of the NVMe-MI spec. The status value should be of type NVME_STATUS_MI, and extracted from the return value using nvme_status_get_value().
Returned string is const, and should not be free()ed.
Return
A string representing the status value
-
nvme_root_t
nvme_mi_create_root(FILE *fp, int log_level)¶ Create top-level MI (root) handle.
Parameters
FILE *fpFile descriptor for logging messages
int log_levelLogging level to use
Description
Create the top-level (library) handle for creating subsequent endpoint objects. Similar to nvme_create_root(), but we provide this to allow linking without the core libnvme.
See nvme_create_root.
Return
new root object, or NULL on failure.
-
void
nvme_mi_free_root(nvme_root_t root)¶ Free root object.
Parameters
nvme_root_t rootroot to free
-
void
nvme_mi_set_probe_enabled(nvme_root_t root, bool enabled)¶ enable/disable the probe for new endpoints
Parameters
nvme_root_t rootnvme_root_tobjectbool enabledwhether to probe new endpoints
Description
Controls whether newly-created endpoints are probed for quirks on creation. Defaults to enabled, which results in some initial messaging with the endpoint to determine model-specific details.
-
type
nvme_mi_ep_t¶ MI Endpoint object.
Description
Represents our communication endpoint on the remote MI-capable device.
To be used for direct MI commands for the endpoint (through the
nvme_mi_mi_* functions(), or to communicate with individual controllers
(see nvme_mi_init_ctrl).
Endpoints are created through a transport-specific constructor; currently
only MCTP-connected endpoints are supported, through nvme_mi_open_mctp.
Subsequent operations on the endpoint (and related controllers) are
transport-independent.
-
nvme_mi_ep_t
nvme_mi_first_endpoint(nvme_root_t m)¶ Start endpoint iterator
Parameters
nvme_root_t mnvme_root_tobject
Return
- first MI endpoint object under this root, or NULL if no endpoints
are present.
Description
See: nvme_mi_next_endpoint, nvme_mi_for_each_endpoint
-
nvme_mi_ep_t
nvme_mi_next_endpoint(nvme_root_t m, nvme_mi_ep_t e)¶ Continue endpoint iterator
Parameters
nvme_root_t mnvme_root_tobjectnvme_mi_ep_t envme_mi_ep_tcurrent position of iterator
Return
- next endpoint MI endpoint object after e under this root, or NULL
if no further endpoints are present.
Description
See: nvme_mi_first_endpoint, nvme_mi_for_each_endpoint
-
nvme_mi_for_each_endpoint¶
nvme_mi_for_each_endpoint (m, e)
Iterator for NVMe-MI endpoints.
Parameters
mnvme_root_tcontaining endpointsenvme_mi_ep_tobject, set on each iteration
-
nvme_mi_for_each_endpoint_safe¶
nvme_mi_for_each_endpoint_safe (m, e, _e)
Iterator for NVMe-MI endpoints, allowing deletion during traversal
Parameters
mnvme_root_tcontaining endpointsenvme_mi_ep_tobject, set on each iteration_envme_mi_ep_tobject used as temporary storage
-
int
nvme_mi_ep_set_timeout(nvme_mi_ep_t ep, unsigned int timeout_ms)¶ set a timeout for NVMe-MI responses
Parameters
nvme_mi_ep_t epMI endpoint object
unsigned int timeout_msTimeout for MI responses, given in milliseconds
-
void
nvme_mi_ep_set_mprt_max(nvme_mi_ep_t ep, unsigned int mprt_max_ms)¶ set the maximum wait time for a More Processing Required response
Parameters
nvme_mi_ep_t epMI endpoint object
unsigned int mprt_max_msMaximum more processing required wait time
Description
NVMe-MI endpoints may respond to a request with a “More Processing Required” response; this also includes a hint on the worst-case processing time for the eventual response data, with a specification-defined maximum of 65.535 seconds.
This function provides a way to limit the maximum time we’re prepared to wait for the final response. Specify zero in mprt_max_ms for no limit. This should be larger than the command/response timeout set in :c:type:`nvme_mi_ep_set_timeout`().
-
unsigned int
nvme_mi_ep_get_timeout(nvme_mi_ep_t ep)¶ get the current timeout value for NVMe-MI responses
Parameters
nvme_mi_ep_t epMI endpoint object
Description
Returns the current timeout value, in milliseconds, for this endpoint.
-
type
nvme_mi_ctrl_t¶ NVMe-MI Controller object.
Description
Provides NVMe command functionality, through the MI interface.
-
nvme_mi_ctrl_t
nvme_mi_first_ctrl(nvme_mi_ep_t ep)¶ Start controller iterator
Parameters
nvme_mi_ep_t epnvme_mi_ep_tobject
Return
- first MI controller object under this root, or NULL if no controllers
are present.
Description
See: nvme_mi_next_ctrl, nvme_mi_for_each_ctrl
-
nvme_mi_ctrl_t
nvme_mi_next_ctrl(nvme_mi_ep_t ep, nvme_mi_ctrl_t c)¶ Continue ctrl iterator
Parameters
nvme_mi_ep_t epnvme_mi_ep_tobjectnvme_mi_ctrl_t cnvme_mi_ctrl_tcurrent position of iterator
Return
- next MI controller object after c under this endpoint, or NULL
if no further controllers are present.
Description
See: nvme_mi_first_ctrl, nvme_mi_for_each_ctrl
-
nvme_mi_for_each_ctrl¶
nvme_mi_for_each_ctrl (ep, c)
Iterator for NVMe-MI controllers.
Parameters
epnvme_mi_ep_tcontaining endpointscnvme_mi_ctrl_tobject, set on each iteration
Description
Allows iteration of the list of controllers behind an endpoint. Unless the controllers have already been created explicitly, you’ll probably want to call :c:type:`nvme_mi_scan_ep`() to scan for the controllers first.
See: :c:type:`nvme_mi_scan_ep`()
-
nvme_mi_for_each_ctrl_safe¶
nvme_mi_for_each_ctrl_safe (ep, c, _c)
Iterator for NVMe-MI controllers, allowing deletion during traversal
Parameters
epnvme_mi_ep_tcontaining controllerscnvme_mi_ctrl_tobject, set on each iteration_cnvme_mi_ctrl_tobject used as temporary storage
Description
Allows iteration of the list of controllers behind an endpoint, safe against deletion during iteration. Unless the controllers have already been created explicitly (or you’re just iterating to destroy controllers) you’ll probably want to call :c:type:`nvme_mi_scan_ep`() to scan for the controllers first.
See: :c:type:`nvme_mi_scan_ep`()
-
nvme_mi_ep_t
nvme_mi_open_mctp(nvme_root_t root, unsigned int netid, uint8_t eid)¶ Create an endpoint using a MCTP connection.
Parameters
nvme_root_t rootroot object to create under
unsigned int netidMCTP network ID on this system
uint8_t eidMCTP endpoint ID
Description
Transport-specific endpoint initialization for MI-connected endpoints. Once an endpoint is created, the rest of the API is transport-independent.
See nvme_mi_close
Return
New endpoint object for netid & eid, or NULL on failure.
-
void
nvme_mi_close(nvme_mi_ep_t ep)¶ Close an endpoint connection and release resources, including controller objects.
Parameters
nvme_mi_ep_t epEndpoint object to close
-
nvme_root_t
nvme_mi_scan_mctp(void)¶ look for MCTP-connected NVMe-MI endpoints.
Parameters
voidno arguments
Description
This function queries the system MCTP daemon (“mctpd”) over D-Bus, to find MCTP endpoints that report support for NVMe-MI over MCTP.
This requires libvnme-mi to be compiled with D-Bus support; if not, this will return NULL.
Return
- A nvme_root_t populated with a set of MCTP-connected endpoints,
or NULL on failure
-
int
nvme_mi_scan_ep(nvme_mi_ep_t ep, bool force_rescan)¶ query an endpoint for its NVMe controllers.
Parameters
nvme_mi_ep_t epEndpoint to scan
bool force_rescanclose existing controllers and rescan
Description
This function queries an MI endpoint for the controllers available, by performing an MI Read MI Data Structure command (requesting the controller list). The controllers are stored in the endpoint’s internal list, and can be iterated with nvme_mi_for_each_ctrl.
This will only scan the endpoint once, unless force_rescan is set. If so, all existing controller objects will be freed - the caller must not hold a reference to those across this call.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
nvme_mi_ctrl_t
nvme_mi_init_ctrl(nvme_mi_ep_t ep, __u16 ctrl_id)¶ initialise a NVMe controller.
Parameters
nvme_mi_ep_t epEndpoint to create under
__u16 ctrl_idID of controller to initialize.
Description
Create a connection to a controller behind the endpoint specified in ep.
Controller IDs may be queried from the endpoint through
nvme_mi_mi_read_mi_data_ctrl_list.
Return
New controller object, or NULL on failure.
-
void
nvme_mi_close_ctrl(nvme_mi_ctrl_t ctrl)¶ free a controller
Parameters
nvme_mi_ctrl_t ctrlcontroller to free
-
__u16
nvme_mi_ctrl_id(nvme_mi_ctrl_t ctrl)¶ get the ID of a controller
Parameters
nvme_mi_ctrl_t ctrlcontroller to query
Description
Retrieve the ID of the controller, as defined by hardware, and available in the Identify (Controller List) data. This is the value passed to nvme_mi_init_ctrl, but may have been created internally via nvme_mi_scan_ep.
Return
the (locally-stored) ID of this controller.
-
char *
nvme_mi_endpoint_desc(nvme_mi_ep_t ep)¶ Get a string describing a MI endpoint.
Parameters
nvme_mi_ep_t ependpoint to describe
Description
Generates a human-readable string describing the endpoint, with possibly transport-specific data. The string is allocated during the call, and the caller is responsible for free()-ing the string.
Return
- a newly-allocated string containing the endpoint description, or
NULL on failure.
-
int
nvme_mi_mi_read_mi_data_subsys(nvme_mi_ep_t ep, struct nvme_mi_read_nvm_ss_info *s)¶ Perform a Read MI Data Structure command, retrieving subsystem data.
Parameters
nvme_mi_ep_t ependpoint for MI communication
struct nvme_mi_read_nvm_ss_info *ssubsystem information to populate
Description
Retrieves the Subsystem information - number of external ports and
NVMe version information. See struct nvme_mi_read_nvm_ss_info.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise..
-
int
nvme_mi_mi_read_mi_data_port(nvme_mi_ep_t ep, __u8 portid, struct nvme_mi_read_port_info *p)¶ Perform a Read MI Data Structure command, retrieving port data.
Parameters
nvme_mi_ep_t ependpoint for MI communication
__u8 portidid of port data to retrieve
struct nvme_mi_read_port_info *pport information to populate
Description
Retrieves the Port information, for the specified port ID. The subsystem
data (from nvme_mi_mi_read_mi_data_subsys) nmp field contains the allowed
range of port IDs.
See struct nvme_mi_read_port_info.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise..
-
int
nvme_mi_mi_read_mi_data_ctrl_list(nvme_mi_ep_t ep, __u8 start_ctrlid, struct nvme_ctrl_list *list)¶ Perform a Read MI Data Structure command, retrieving the list of attached controllers.
Parameters
nvme_mi_ep_t ependpoint for MI communication
__u8 start_ctrlidstarting controller ID
struct nvme_ctrl_list *listcontroller list to populate
Description
Retrieves the list of attached controllers, with IDs greater than or equal to start_ctrlid.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise..
-
int
nvme_mi_mi_read_mi_data_ctrl(nvme_mi_ep_t ep, __u16 ctrl_id, struct nvme_mi_read_ctrl_info *ctrl)¶ Perform a Read MI Data Structure command, retrieving controller information
Parameters
nvme_mi_ep_t ependpoint for MI communication
__u16 ctrl_idID of controller to query
struct nvme_mi_read_ctrl_info *ctrlcontroller data to populate
Description
Retrieves the Controller Information Data Structure for the attached controller with ID ctrlid.
See struct nvme_mi_read_ctrl_info.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise..
-
int
nvme_mi_mi_subsystem_health_status_poll(nvme_mi_ep_t ep, bool clear, struct nvme_mi_nvm_ss_health_status *nshds)¶ Read the Subsystem Health Data Structure from the NVM subsystem
Parameters
nvme_mi_ep_t ependpoint for MI communication
bool clearflag to clear the Composite Controller Status state
struct nvme_mi_nvm_ss_health_status *nshdssubsystem health status data to populate
Description
Retrieves the Subsystem Health Data Structure into nshds. If clear is set, requests that the Composite Controller Status bits are cleared after the read. See NVMe-MI section 5.6 for details on the CCS bits.
See struct nvme_mi_nvm_ss_health_status.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise..
-
int
nvme_mi_mi_config_get(nvme_mi_ep_t ep, __u32 dw0, __u32 dw1, __u32 *nmresp)¶ query a configuration parameter
Parameters
nvme_mi_ep_t ependpoint for MI communication
__u32 dw0management doubleword 0, containing configuration identifier, plus config-specific fields
__u32 dw1management doubleword 0, config-specific.
__u32 *nmrespset to queried configuration data in NMRESP field of response.
Description
Performs a MI Configuration Get command, with the configuration identifier as the LSB of dw0. Other dw0 and dw1 data is configuration-identifier specific.
On a successful Configuration Get, the nmresp pointer will be populated with the bytes from the 3-byte NMRESP field, converted to native endian.
See enum nvme_mi_config_id for identifiers.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise..
-
int
nvme_mi_mi_config_set(nvme_mi_ep_t ep, __u32 dw0, __u32 dw1)¶ set a configuration parameter
Parameters
nvme_mi_ep_t ependpoint for MI communication
__u32 dw0management doubleword 0, containing configuration identifier, plus config-specific fields
__u32 dw1management doubleword 0, config-specific.
Description
Performs a MI Configuration Set command, with the command as the LSB of dw0. Other dw0 and dw1 data is configuration-identifier specific.
See enum nvme_mi_config_id for identifiers.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise..
-
int
nvme_mi_mi_config_get_smbus_freq(nvme_mi_ep_t ep, __u8 port, enum nvme_mi_config_smbus_freq *freq)¶ get configuration: SMBus port frequency
Parameters
nvme_mi_ep_t ependpoint for MI communication
__u8 portport ID to query
enum nvme_mi_config_smbus_freq *freqoutput value for current frequency configuration
Description
Performs a MI Configuration Get, to query the current SMBus frequency of the port specified in port. On success, populates freq with the port frequency
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise..
-
int
nvme_mi_mi_config_set_smbus_freq(nvme_mi_ep_t ep, __u8 port, enum nvme_mi_config_smbus_freq freq)¶ set configuration: SMBus port frequency
Parameters
nvme_mi_ep_t ependpoint for MI communication
__u8 portport ID to set
enum nvme_mi_config_smbus_freq freqnew frequency configuration
Description
Performs a MI Configuration Set, to update the current SMBus frequency of the port specified in port.
See struct nvme_mi_read_port_info for the maximum supported SMBus frequency
for the port.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise..
-
int
nvme_mi_mi_config_set_health_status_change(nvme_mi_ep_t ep, __u32 mask)¶ clear CCS bits in health status
Parameters
nvme_mi_ep_t ependpoint for MI communication
__u32 maskbitmask to clear
Description
Performs a MI Configuration Set, to update the current health status poll values of the Composite Controller Status bits. Bits set in mask will be cleared from future health status poll data, and may be re-triggered by a future health change event.
See nvme_mi_mi_subsystem_health_status_poll`(), :c:type:`enum nvme_mi_ccs for
values in mask.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise..
-
int
nvme_mi_mi_config_get_mctp_mtu(nvme_mi_ep_t ep, __u8 port, __u16 *mtu)¶ get configuration: MCTP MTU
Parameters
nvme_mi_ep_t ependpoint for MI communication
__u8 portport ID to query
__u16 *mtuoutput value for current MCTP MTU configuration
Description
Performs a MI Configuration Get, to query the current MCTP Maximum Transmission Unit size (MTU) of the port specified in port. On success, populates mtu with the MTU.
The default reset value is 64, corresponding to the MCTP baseline MTU.
Some controllers may also use this as the maximum receive unit size, and may not accept MCTP messages larger than the configured MTU.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise..
-
int
nvme_mi_mi_config_set_mctp_mtu(nvme_mi_ep_t ep, __u8 port, __u16 mtu)¶ set configuration: MCTP MTU
Parameters
nvme_mi_ep_t ependpoint for MI communication
__u8 portport ID to set
__u16 mtunew MTU configuration
Description
Performs a MI Configuration Set, to update the current MCTP MTU value for the port specified in port.
Some controllers may also use this as the maximum receive unit size, and may not accept MCTP messages larger than the configured MTU. When setting this value, you will likely need to change the MTU of the local MCTP interface(s) to match.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise..
-
int
nvme_mi_admin_xfer(nvme_mi_ctrl_t ctrl, struct nvme_mi_admin_req_hdr *admin_req, size_t req_data_size, struct nvme_mi_admin_resp_hdr *admin_resp, off_t resp_data_offset, size_t *resp_data_size)¶ Raw admin transfer interface.
Parameters
nvme_mi_ctrl_t ctrlcontroller to send the admin command to
struct nvme_mi_admin_req_hdr *admin_reqrequest data
size_t req_data_sizesize of request data payload
struct nvme_mi_admin_resp_hdr *admin_respbuffer for response data
off_t resp_data_offsetoffset into request data to retrieve from controller
size_t *resp_data_sizesize of response data buffer, updated to received size
Description
Performs an arbitrary NVMe Admin command, using the provided request data, in admin_req. The size of the request data payload is specified in req_data_size - this does not include the standard header length (so a header-only request would have a size of 0).
On success, response data is stored in admin_resp, which has an optional appended payload buffer of resp_data_size bytes. The actual payload transferred will be stored in resp_data_size. These sizes do not include the Admin request header, so 0 represents no payload.
As with all Admin commands, we can request partial data from the Admin Response payload, offset by resp_data_offset.
See: struct nvme_mi_admin_req_hdr and struct nvme_mi_admin_resp_hdr.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise..
-
int
nvme_mi_admin_admin_passthru(nvme_mi_ctrl_t ctrl, __u8 opcode, __u8 flags, __u16 rsvd, __u32 nsid, __u32 cdw2, __u32 cdw3, __u32 cdw10, __u32 cdw11, __u32 cdw12, __u32 cdw13, __u32 cdw14, __u32 cdw15, __u32 data_len, void *data, __u32 metadata_len, void *metadata, __u32 timeout_ms, __u32 *result)¶ Submit an nvme admin passthrough command
Parameters
nvme_mi_ctrl_t ctrlController to send command to
__u8 opcodeThe nvme admin command to send
__u8 flagsNVMe command flags (not used)
__u16 rsvdReserved for future use
__u32 nsidNamespace identifier
__u32 cdw2Command dword 2
__u32 cdw3Command dword 3
__u32 cdw10Command dword 10
__u32 cdw11Command dword 11
__u32 cdw12Command dword 12
__u32 cdw13Command dword 13
__u32 cdw14Command dword 14
__u32 cdw15Command dword 15
__u32 data_lenLength of the data transferred in this command in bytes
void *dataPointer to user address of the data buffer
__u32 metadata_lenLength of metadata transferred in this command(not used)
void *metadataPointer to user address of the metadata buffer(not used)
__u32 timeout_msHow long to wait for the command to complete
__u32 *resultOptional field to return the result from the CQE dword 0
Description
Send a customized NVMe Admin command request message and get the corresponding response message.
This interface supports no data, host to controller and controller to host but it doesn’t support bidirectional data transfer. Also this interface only supports data transfer size range [0, 4096] (bytes) so the & data_len parameter must be less than 4097.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_identify_partial(nvme_mi_ctrl_t ctrl, struct nvme_identify_args *args, off_t offset, size_t size)¶ Perform an Admin identify command, and retrieve partial response data.
Parameters
nvme_mi_ctrl_t ctrlController to process identify command
struct nvme_identify_args *argsIdentify command arguments
off_t offsetoffset of identify data to retrieve from response
size_t sizesize of identify data to return
Description
Perform an Identify command, using the Identify command parameters in args. The offset and size arguments allow the caller to retrieve part of the identify response. See NVMe-MI section 6.2 for the semantics (and some handy diagrams) of the offset & size parameters.
Will return an error if the length of the response data (from the controller) did not match size.
Unless you’re performing a vendor-unique identify command, You’ll probably want to use one of the identify helpers (nvme_mi_admin_identify, nvme_mi_admin_identify_cns_nsid, or nvme_mi_admin_identify_<type>) instead of this. If the type of your identify command is standardized but not yet supported by libnvme-mi, please contact the maintainers.
See: struct nvme_identify_args
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_identify(nvme_mi_ctrl_t ctrl, struct nvme_identify_args *args)¶ Perform an Admin identify command.
Parameters
nvme_mi_ctrl_t ctrlController to process identify command
struct nvme_identify_args *argsIdentify command arguments
Description
Perform an Identify command, using the Identify command parameters in args. Stores the identify data in ->data, and (if set) the result from cdw0 into args->result.
Will return an error if the length of the response data (from the
controller) is not a full NVME_IDENTIFY_DATA_SIZE.
See: struct nvme_identify_args
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_identify_cns_nsid(nvme_mi_ctrl_t ctrl, enum nvme_identify_cns cns, __u32 nsid, void *data)¶ Perform an Admin identify command using specific CNS/NSID parameters.
Parameters
nvme_mi_ctrl_t ctrlController to process identify command
enum nvme_identify_cns cnsController or Namespace Structure, specifying identified object
__u32 nsidnamespace ID
void *databuffer for identify data response
Description
Perform an Identify command, using the CNS specifier cns, and the namespace ID nsid if required by the CNS type.
Stores the identify data in data, which is expected to be a buffer of
NVME_IDENTIFY_DATA_SIZE bytes.
Will return an error if the length of the response data (from the
controller) is not a full NVME_IDENTIFY_DATA_SIZE.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_identify_ns(nvme_mi_ctrl_t ctrl, __u32 nsid, struct nvme_id_ns *ns)¶ Perform an Admin identify command for a namespace
Parameters
nvme_mi_ctrl_t ctrlController to process identify command
__u32 nsidnamespace ID
struct nvme_id_ns *nsNamespace identification to populate
Description
Perform an Identify (namespace) command, setting the namespace id data in ns. The namespace is expected to active and allocated.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_identify_ns_descs(nvme_mi_ctrl_t ctrl, __u32 nsid, struct nvme_ns_id_desc *descs)¶ Perform an Admin identify Namespace Identification Descriptor list command for a namespace
Parameters
nvme_mi_ctrl_t ctrlController to process identify command
__u32 nsidNamespace ID
struct nvme_ns_id_desc *descsNamespace Identification Descriptor list to populate
Description
Perform an Identify namespace identification description list command, setting the namespace identification description list in descs
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_identify_allocated_ns(nvme_mi_ctrl_t ctrl, __u32 nsid, struct nvme_id_ns *ns)¶ Perform an Admin identify command for an allocated namespace
Parameters
nvme_mi_ctrl_t ctrlController to process identify command
__u32 nsidnamespace ID
struct nvme_id_ns *nsNamespace identification to populate
Description
Perform an Identify (namespace) command, setting the namespace id data in ns.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_identify_ctrl(nvme_mi_ctrl_t ctrl, struct nvme_id_ctrl *id)¶ Perform an Admin identify for a controller
Parameters
nvme_mi_ctrl_t ctrlController to process identify command
struct nvme_id_ctrl *idController identify data to populate
Description
Perform an Identify command, for the controller specified by ctrl, writing identify data to id.
Will return an error if the length of the response data (from the
controller) is not a full NVME_IDENTIFY_DATA_SIZE, so id will be
fully populated on success.
See: struct nvme_id_ctrl
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_identify_ctrl_list(nvme_mi_ctrl_t ctrl, __u16 cntid, struct nvme_ctrl_list *list)¶ Perform an Admin identify for a controller list.
Parameters
nvme_mi_ctrl_t ctrlController to process identify command
__u16 cntidController ID to specify list start
struct nvme_ctrl_list *listList data to populate
Description
Perform an Identify command, for the controller list starting with IDs greater than or equal to cntid.
Will return an error if the length of the response data (from the
controller) is not a full NVME_IDENTIFY_DATA_SIZE, so id will be
fully populated on success.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_identify_nsid_ctrl_list(nvme_mi_ctrl_t ctrl, __u32 nsid, __u16 cntid, struct nvme_ctrl_list *list)¶ Perform an Admin identify for a controller list with specific namespace ID
Parameters
nvme_mi_ctrl_t ctrlController to process identify command
__u32 nsidNamespace identifier
__u16 cntidController ID to specify list start
struct nvme_ctrl_list *listList data to populate
Description
Perform an Identify command, for the controller list for nsid, starting with IDs greater than or equal to cntid.
Will return an error if the length of the response data (from the
controller) is not a full NVME_IDENTIFY_DATA_SIZE, so id will be
fully populated on success.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_identify_allocated_ns_list(nvme_mi_ctrl_t ctrl, __u32 nsid, struct nvme_ns_list *list)¶ Perform an Admin identify for an allocated namespace list
Parameters
nvme_mi_ctrl_t ctrlController to process identify command
__u32 nsidNamespace ID to specify list start
struct nvme_ns_list *listList data to populate
Description
Perform an Identify command, for the allocated namespace list starting with
IDs greater than or equal to nsid. Specify NVME_NSID_NONE for the start
of the list.
Will return an error if the length of the response data (from the
controller) is not a full NVME_IDENTIFY_DATA_SIZE, so list will be
be fully populated on success.
See: struct nvme_ns_list
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_identify_active_ns_list(nvme_mi_ctrl_t ctrl, __u32 nsid, struct nvme_ns_list *list)¶ Perform an Admin identify for an active namespace list
Parameters
nvme_mi_ctrl_t ctrlController to process identify command
__u32 nsidNamespace ID to specify list start
struct nvme_ns_list *listList data to populate
Description
Perform an Identify command, for the active namespace list starting with
IDs greater than or equal to nsid. Specify NVME_NSID_NONE for the start
of the list.
Will return an error if the length of the response data (from the
controller) is not a full NVME_IDENTIFY_DATA_SIZE, so list will be
be fully populated on success.
See: struct nvme_ns_list
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_identify_primary_ctrl(nvme_mi_ctrl_t ctrl, __u16 cntid, struct nvme_primary_ctrl_cap *cap)¶ Perform an Admin identify for primary controller capabilities data structure.
Parameters
nvme_mi_ctrl_t ctrlController to process identify command
__u16 cntidController ID to specify
struct nvme_primary_ctrl_cap *capPrimary Controller Capabilities data structure to populate
Description
Perform an Identify command to get the Primary Controller Capabilities data for the controller specified by cntid
Will return an error if the length of the response data (from the
controller) is not a full NVME_IDENTIFY_DATA_SIZE, so cap will be
be fully populated on success.
See: struct nvme_primary_ctrl_cap
Return
0 on success, non-zero on failure
-
int
nvme_mi_admin_identify_secondary_ctrl_list(nvme_mi_ctrl_t ctrl, __u16 cntid, struct nvme_secondary_ctrl_list *list)¶ Perform an Admin identify for a secondary controller list.
Parameters
nvme_mi_ctrl_t ctrlController to process identify command
__u16 cntidController ID to specify list start
struct nvme_secondary_ctrl_list *listList data to populate
Description
Perform an Identify command, for the secondary controllers associated with the current primary controller. Only entries with IDs greater than or equal to cntid are returned.
Will return an error if the length of the response data (from the
controller) is not a full NVME_IDENTIFY_DATA_SIZE, so list will be
be fully populated on success.
See: struct nvme_secondary_ctrl_list
Return
0 on success, non-zero on failure
-
int
nvme_mi_admin_get_log_page(nvme_mi_ctrl_t ctrl, __u32 xfer_len, struct nvme_get_log_args *args)¶ Retrieve log page data from controller
Parameters
nvme_mi_ctrl_t ctrlController to query
__u32 xfer_lenThe chunk size of the read
struct nvme_get_log_args *argsGet Log Page command arguments
Description
Performs a Get Log Page Admin command as specified by args. Response data is stored in args->data, which should be a buffer of args->data_len bytes. Resulting data length is stored in args->data_len on successful command completion.
This request may be implemented as multiple log page commands, in order to fit within MI message-size limits.
See: struct nvme_get_log_args
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_get_log(nvme_mi_ctrl_t ctrl, struct nvme_get_log_args *args)¶ Retrieve log page data from controller
Parameters
nvme_mi_ctrl_t ctrlController to query
struct nvme_get_log_args *argsGet Log Page command arguments
Description
Performs a Get Log Page Admin command as specified by args. Response data is stored in args->data, which should be a buffer of args->data_len bytes. Resulting data length is stored in args->data_len on successful command completion.
This request may be implemented as multiple log page commands, in order to fit within MI message-size limits.
See: struct nvme_get_log_args
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_get_nsid_log(nvme_mi_ctrl_t ctrl, bool rae, enum nvme_cmd_get_log_lid lid, __u32 nsid, __u32 len, void *log)¶ Helper for Get Log Page functions
Parameters
nvme_mi_ctrl_t ctrlController to query
bool raeRetain Asynchronous Events
enum nvme_cmd_get_log_lid lidLog identifier
__u32 nsidNamespace ID
__u32 lenlength of log buffer
void *logpointer for resulting log data
Description
Performs a Get Log Page Admin command for a specific log ID lid and namespace ID nsid. Log data is expected to be len bytes, and is stored in log on success. The rae flag is passed as-is to the Get Log Page command, and is specific to the Log Page requested.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_get_log_simple(nvme_mi_ctrl_t ctrl, enum nvme_cmd_get_log_lid lid, __u32 len, void *log)¶ Helper for Get Log Page functions with no NSID or RAE requirements
Parameters
nvme_mi_ctrl_t ctrlController to query
enum nvme_cmd_get_log_lid lidLog identifier
__u32 lenlength of log buffer
void *logpointer for resulting log data
Description
Performs a Get Log Page Admin command for a specific log ID lid, using NVME_NSID_ALL for the namespace identifier, and rae set to false.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_get_log_supported_log_pages(nvme_mi_ctrl_t ctrl, bool rae, struct nvme_supported_log_pages *log)¶ Retrieve nmve supported log pages
Parameters
nvme_mi_ctrl_t ctrlController to query
bool raeRetain asynchronous events
struct nvme_supported_log_pages *logArray of LID supported and Effects data structures
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_get_log_error(nvme_mi_ctrl_t ctrl, unsigned int nr_entries, bool rae, struct nvme_error_log_page *err_log)¶ Retrieve nvme error log
Parameters
nvme_mi_ctrl_t ctrlController to query
unsigned int nr_entriesNumber of error log entries allocated
bool raeRetain asynchronous events
struct nvme_error_log_page *err_logArray of error logs of size ‘entries’
Description
This log page describes extended error information for a command that completed with error, or may report an error that is not specific to a particular command.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_get_log_smart(nvme_mi_ctrl_t ctrl, __u32 nsid, bool rae, struct nvme_smart_log *smart_log)¶ Retrieve nvme smart log
Parameters
nvme_mi_ctrl_t ctrlController to query
__u32 nsidOptional namespace identifier
bool raeRetain asynchronous events
struct nvme_smart_log *smart_logUser address to store the smart log
Description
This log page provides SMART and general health information. The information provided is over the life of the controller and is retained across power cycles. To request the controller log page, the namespace identifier specified is FFFFFFFFh. The controller may also support requesting the log page on a per namespace basis, as indicated by bit 0 of the LPA field in the Identify Controller data structure.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_get_log_fw_slot(nvme_mi_ctrl_t ctrl, bool rae, struct nvme_firmware_slot *fw_log)¶ Retrieves the controller firmware log
Parameters
nvme_mi_ctrl_t ctrlController to query
bool raeRetain asynchronous events
struct nvme_firmware_slot *fw_logUser address to store the log page
Description
This log page describes the firmware revision stored in each firmware slot supported. The firmware revision is indicated as an ASCII string. The log page also indicates the active slot number.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_get_log_changed_ns_list(nvme_mi_ctrl_t ctrl, bool rae, struct nvme_ns_list *ns_log)¶ Retrieve namespace changed list
Parameters
nvme_mi_ctrl_t ctrlController to query
bool raeRetain asynchronous events
struct nvme_ns_list *ns_logUser address to store the log page
Description
This log page describes namespaces attached to this controller that have changed since the last time the namespace was identified, been added, or deleted.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_get_log_cmd_effects(nvme_mi_ctrl_t ctrl, enum nvme_csi csi, struct nvme_cmd_effects_log *effects_log)¶ Retrieve nvme command effects log
Parameters
nvme_mi_ctrl_t ctrlController to query
enum nvme_csi csiCommand Set Identifier
struct nvme_cmd_effects_log *effects_logUser address to store the effects log
Description
This log page describes the commands that the controller supports and the effects of those commands on the state of the NVM subsystem.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_get_log_device_self_test(nvme_mi_ctrl_t ctrl, struct nvme_self_test_log *log)¶ Retrieve the device self test log
Parameters
nvme_mi_ctrl_t ctrlController to query
struct nvme_self_test_log *logUserspace address of the log payload
Description
The log page indicates the status of an in progress self test and the percent complete of that operation, and the results of the previous 20 self-test operations.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_get_log_create_telemetry_host(nvme_mi_ctrl_t ctrl, struct nvme_telemetry_log *log)¶ Create host telemetry log
Parameters
nvme_mi_ctrl_t ctrlController to query
struct nvme_telemetry_log *logUserspace address of the log payload
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_get_log_telemetry_host(nvme_mi_ctrl_t ctrl, __u64 offset, __u32 len, void *log)¶ Get Telemetry Host-Initiated log page
Parameters
nvme_mi_ctrl_t ctrlController to query
__u64 offsetOffset into the telemetry data
__u32 lenLength of provided user buffer to hold the log data in bytes
void *logUser address for log page data
Description
Retrieves the Telemetry Host-Initiated log page at the requested offset using the previously existing capture.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_get_log_telemetry_ctrl(nvme_mi_ctrl_t ctrl, bool rae, __u64 offset, __u32 len, void *log)¶ Get Telemetry Controller-Initiated log page
Parameters
nvme_mi_ctrl_t ctrlController to query
bool raeRetain asynchronous events
__u64 offsetOffset into the telemetry data
__u32 lenLength of provided user buffer to hold the log data in bytes
void *logUser address for log page data
Description
Retrieves the Telemetry Controller-Initiated log page at the requested offset using the previously existing capture.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_get_log_endurance_group(nvme_mi_ctrl_t ctrl, __u16 endgid, struct nvme_endurance_group_log *log)¶ Get Endurance Group log
Parameters
nvme_mi_ctrl_t ctrlController to query
__u16 endgidStarting group identifier to return in the list
struct nvme_endurance_group_log *logUser address to store the endurance log
Description
This log page indicates if an Endurance Group Event has occurred for a particular Endurance Group. If an Endurance Group Event has occurred, the details of the particular event are included in the Endurance Group Information log page for that Endurance Group. An asynchronous event is generated when an entry for an Endurance Group is newly added to this log page.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_get_log_predictable_lat_nvmset(nvme_mi_ctrl_t ctrl, __u16 nvmsetid, struct nvme_nvmset_predictable_lat_log *log)¶ Predictable Latency Per NVM Set
Parameters
nvme_mi_ctrl_t ctrlController to query
__u16 nvmsetidNVM set id
struct nvme_nvmset_predictable_lat_log *logUser address to store the predictable latency log
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_get_log_predictable_lat_event(nvme_mi_ctrl_t ctrl, bool rae, __u32 offset, __u32 len, void *log)¶ Retrieve Predictable Latency Event Aggregate Log Page
Parameters
nvme_mi_ctrl_t ctrlController to query
bool raeRetain asynchronous events
__u32 offsetOffset into the predictable latency event
__u32 lenLength of provided user buffer to hold the log data in bytes
void *logUser address for log page data
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_get_log_ana(nvme_mi_ctrl_t ctrl, enum nvme_log_ana_lsp lsp, bool rae, __u64 offset, __u32 len, void *log)¶ Retrieve Asymmetric Namespace Access log page
Parameters
nvme_mi_ctrl_t ctrlController to query
enum nvme_log_ana_lsp lspLog specific, see
enum nvme_get_log_ana_lspbool raeRetain asynchronous events
__u64 offsetOffset to the start of the log page
__u32 lenThe allocated length of the log page
void *logUser address to store the ana log
Description
This log consists of a header describing the log and descriptors containing the asymmetric namespace access information for ANA Groups that contain namespaces that are attached to the controller processing the command.
See struct nvme_ana_rsp_hdr for the definition of the returned structure.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_get_log_ana_groups(nvme_mi_ctrl_t ctrl, bool rae, __u32 len, struct nvme_ana_group_desc *log)¶ Retrieve Asymmetric Namespace Access groups only log page
Parameters
nvme_mi_ctrl_t ctrlController to query
bool raeRetain asynchronous events
__u32 lenThe allocated length of the log page
struct nvme_ana_group_desc *logUser address to store the ana group log
Description
See struct nvme_ana_group_desc for the definition of the returned structure.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_get_log_lba_status(nvme_mi_ctrl_t ctrl, bool rae, __u64 offset, __u32 len, void *log)¶ Retrieve LBA Status
Parameters
nvme_mi_ctrl_t ctrlController to query
bool raeRetain asynchronous events
__u64 offsetOffset to the start of the log page
__u32 lenThe allocated length of the log page
void *logUser address to store the log page
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_get_log_endurance_grp_evt(nvme_mi_ctrl_t ctrl, bool rae, __u32 offset, __u32 len, void *log)¶ Retrieve Rotational Media Information
Parameters
nvme_mi_ctrl_t ctrlController to query
bool raeRetain asynchronous events
__u32 offsetOffset to the start of the log page
__u32 lenThe allocated length of the log page
void *logUser address to store the log page
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_get_log_fid_supported_effects(nvme_mi_ctrl_t ctrl, bool rae, struct nvme_fid_supported_effects_log *log)¶ Retrieve Feature Identifiers Supported and Effects
Parameters
nvme_mi_ctrl_t ctrlController to query
bool raeRetain asynchronous events
struct nvme_fid_supported_effects_log *logFID Supported and Effects data structure
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_get_log_mi_cmd_supported_effects(nvme_mi_ctrl_t ctrl, bool rae, struct nvme_mi_cmd_supported_effects_log *log)¶ displays the MI Commands Supported by the controller
Parameters
nvme_mi_ctrl_t ctrlController to query
bool raeRetain asynchronous events
struct nvme_mi_cmd_supported_effects_log *logMI Command Supported and Effects data structure
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_get_log_boot_partition(nvme_mi_ctrl_t ctrl, bool rae, __u8 lsp, __u32 len, struct nvme_boot_partition *part)¶ Retrieve Boot Partition
Parameters
nvme_mi_ctrl_t ctrlController to query
bool raeRetain asynchronous events
__u8 lspThe log specified field of LID
__u32 lenThe allocated size, minimum struct nvme_boot_partition
struct nvme_boot_partition *partUser address to store the log page
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_get_log_phy_rx_eom(nvme_mi_ctrl_t ctrl, __u8 lsp, __u16 controller, __u32 len, struct nvme_phy_rx_eom_log *log)¶ Retrieve Physical Interface Receiver Eye Opening Measurement Log
Parameters
nvme_mi_ctrl_t ctrlController to query
__u8 lspLog specific, controls action and measurement quality
__u16 controllerTarget controller ID
__u32 lenThe allocated size, minimum struct nvme_phy_rx_eom_log
struct nvme_phy_rx_eom_log *logUser address to store the log page
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise
-
int
nvme_mi_admin_get_log_discovery(nvme_mi_ctrl_t ctrl, bool rae, __u32 offset, __u32 len, void *log)¶ Retrieve Discovery log page
Parameters
nvme_mi_ctrl_t ctrlController to query
bool raeRetain asynchronous events
__u32 offsetOffset of this log to retrieve
__u32 lenThe allocated size for this portion of the log
void *logUser address to store the discovery log
Description
Supported only by fabrics discovery controllers, returning discovery records.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_get_log_media_unit_stat(nvme_mi_ctrl_t ctrl, __u16 domid, struct nvme_media_unit_stat_log *mus)¶ Retrieve Media Unit Status
Parameters
nvme_mi_ctrl_t ctrlController to query
__u16 domidDomain Identifier selection, if supported
struct nvme_media_unit_stat_log *musUser address to store the Media Unit statistics log
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_get_log_support_cap_config_list(nvme_mi_ctrl_t ctrl, __u16 domid, struct nvme_supported_cap_config_list_log *cap)¶ Retrieve Supported Capacity Configuration List
Parameters
nvme_mi_ctrl_t ctrlController to query
__u16 domidDomain Identifier selection, if supported
struct nvme_supported_cap_config_list_log *capUser address to store supported capabilities config list
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_get_log_reservation(nvme_mi_ctrl_t ctrl, bool rae, struct nvme_resv_notification_log *log)¶ Retrieve Reservation Notification
Parameters
nvme_mi_ctrl_t ctrlController to query
bool raeRetain asynchronous events
struct nvme_resv_notification_log *logUser address to store the reservation log
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_get_log_sanitize(nvme_mi_ctrl_t ctrl, bool rae, struct nvme_sanitize_log_page *log)¶ Retrieve Sanitize Status
Parameters
nvme_mi_ctrl_t ctrlController to query
bool raeRetain asynchronous events
struct nvme_sanitize_log_page *logUser address to store the sanitize log
Description
The Sanitize Status log page reports sanitize operation time estimates and information about the most recent sanitize operation.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_get_log_zns_changed_zones(nvme_mi_ctrl_t ctrl, __u32 nsid, bool rae, struct nvme_zns_changed_zone_log *log)¶ Retrieve list of zones that have changed
Parameters
nvme_mi_ctrl_t ctrlController to query
__u32 nsidNamespace ID
bool raeRetain asynchronous events
struct nvme_zns_changed_zone_log *logUser address to store the changed zone log
Description
The list of zones that have changed state due to an exceptional event.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_get_log_persistent_event(nvme_mi_ctrl_t ctrl, enum nvme_pevent_log_action action, __u32 size, void *pevent_log)¶ Retrieve Persistent Event Log
Parameters
nvme_mi_ctrl_t ctrlController to query
enum nvme_pevent_log_action actionAction the controller should take during processing this command
__u32 sizeSize of pevent_log
void *pevent_logUser address to store the persistent event log
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_security_send(nvme_mi_ctrl_t ctrl, struct nvme_security_send_args *args)¶ Perform a Security Send command on a controller.
Parameters
nvme_mi_ctrl_t ctrlController to send command to
struct nvme_security_send_args *argsSecurity Send command arguments
Description
Performs a Security Send Admin command as specified by args. Response data is stored in args->data, which should be a buffer of args->data_len bytes. Resulting data length is stored in args->data_len on successful command completion.
Security Send data length should not be greater than 4096 bytes to comply with specification limits.
See: struct nvme_get_log_args
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_security_recv(nvme_mi_ctrl_t ctrl, struct nvme_security_receive_args *args)¶ Perform a Security Receive command on a controller.
Parameters
nvme_mi_ctrl_t ctrlController to send command to
struct nvme_security_receive_args *argsSecurity Receive command arguments
Description
Performs a Security Receive Admin command as specified by args. Response data is stored in args->data, which should be a buffer of args->data_len bytes. Resulting data length is stored in args->data_len on successful command completion.
Security Receive data length should not be greater than 4096 bytes to comply with specification limits.
See: struct nvme_get_log_args
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_get_features(nvme_mi_ctrl_t ctrl, struct nvme_get_features_args *args)¶ Perform a Get Feature command on a controller
Parameters
nvme_mi_ctrl_t ctrlController to send command to
struct nvme_get_features_args *argsGet Features command arguments
Description
Performs a Get Features Admin command as specified by args. Returned feature data will be stored in args->result and args->data, depending on the specification of the feature itself; most features do not return additional data. See section 5.27.1 of the NVMe spec (v2.0b) for feature-specific information.
On success, args->data_len will be updated with the actual data length received.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_get_features_data(nvme_mi_ctrl_t ctrl, enum nvme_features_id fid, __u32 nsid, __u32 data_len, void *data, __u32 *result)¶ Helper function for :c:type:`nvme_mi_admin_get_features`()
Parameters
nvme_mi_ctrl_t ctrlController to send command to
enum nvme_features_id fidFeature identifier
__u32 nsidNamespace ID, if applicable for fid
__u32 data_lenLength of feature data, if applicable for fid, in bytes
void *dataUser address of feature data, if applicable
__u32 *resultThe command completion result from CQE dword0
Description
Helper for optionally features that optionally return data, using the SEL_CURRENT selector value.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_get_features_simple(nvme_mi_ctrl_t ctrl, enum nvme_features_id fid, __u32 nsid, __u32 *result)¶ Get a simple feature value with no data
Parameters
nvme_mi_ctrl_t ctrlController to send command to
enum nvme_features_id fidFeature identifier
__u32 nsidNamespace id, if required by fid
__u32 *resultoutput feature data
-
int
nvme_mi_admin_set_features(nvme_mi_ctrl_t ctrl, struct nvme_set_features_args *args)¶ Perform a Set Features command on a controller
Parameters
nvme_mi_ctrl_t ctrlController to send command to
struct nvme_set_features_args *argsSet Features command arguments
Description
Performs a Set Features Admin command as specified by args. Result data will be stored in args->result. on the specification of the feature itself; most features do not return additional data. See section 5.27.1 of the NVMe spec (v2.0b) for feature-specific information.
On success, args->data_len will be updated with the actual data length received.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_ns_mgmt(nvme_mi_ctrl_t ctrl, struct nvme_ns_mgmt_args *args)¶ Issue a Namespace Management command
Parameters
nvme_mi_ctrl_t ctrlController to send command to
struct nvme_ns_mgmt_args *argsNamespace management command arguments
Description
Issues a Namespace Management command to ctrl, with arguments specified from args.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_ns_mgmt_create(nvme_mi_ctrl_t ctrl, struct nvme_id_ns *ns, __u8 csi, __u32 *nsid, struct nvme_ns_mgmt_host_sw_specified *data)¶ Helper for Namespace Management Create command
Parameters
nvme_mi_ctrl_t ctrlController to send command to
struct nvme_id_ns *nsNew namespace parameters
__u8 csiCommand Set Identifier for new NS
__u32 *nsidSet to new namespace ID on create
struct nvme_ns_mgmt_host_sw_specified *dataHost Software Specified Fields that defines ns creation parameters
Description
Issues a Namespace Management (Create) command to ctrl, to create a new namespace specified by ns, using command set csi. On success, the new namespace ID will be written to nsid.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_ns_mgmt_delete(nvme_mi_ctrl_t ctrl, __u32 nsid)¶ Helper for Namespace Management Delete command
Parameters
nvme_mi_ctrl_t ctrlController to send command to
__u32 nsidNamespace ID to delete
Description
Issues a Namespace Management (Delete) command to ctrl, to delete the namespace with id nsid.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_ns_attach(nvme_mi_ctrl_t ctrl, struct nvme_ns_attach_args *args)¶ Attach or detach namespace to controller(s)
Parameters
nvme_mi_ctrl_t ctrlController to send command to
struct nvme_ns_attach_args *argsNamespace Attach command arguments
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_ns_attach_ctrls(nvme_mi_ctrl_t ctrl, __u32 nsid, struct nvme_ctrl_list *ctrlist)¶ Attach namespace to controllers
Parameters
nvme_mi_ctrl_t ctrlController to send command to
__u32 nsidNamespace ID to attach
struct nvme_ctrl_list *ctrlistController list to modify attachment state of nsid
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_ns_detach_ctrls(nvme_mi_ctrl_t ctrl, __u32 nsid, struct nvme_ctrl_list *ctrlist)¶ Detach namespace from controllers
Parameters
nvme_mi_ctrl_t ctrlController to send command to
__u32 nsidNamespace ID to detach
struct nvme_ctrl_list *ctrlistController list to modify attachment state of nsid
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_fw_download(nvme_mi_ctrl_t ctrl, struct nvme_fw_download_args *args)¶ Download part or all of a firmware image to the controller
Parameters
nvme_mi_ctrl_t ctrlController to send firmware data to
struct nvme_fw_download_args *argsstruct nvme_fw_download_argsargument structure
Description
The Firmware Image Download command downloads all or a portion of an image for a future update to the controller. The Firmware Image Download command downloads a new image (in whole or in part) to the controller.
The image may be constructed of multiple pieces that are individually downloaded with separate Firmware Image Download commands. Each Firmware Image Download command includes a Dword Offset and Number of Dwords that specify a dword range.
The new firmware image is not activated as part of the Firmware Image Download command. Use the nvme_mi_admin_fw_commit() to activate a newly downloaded image.
Return
0 on success, non-zero on failure
-
int
nvme_mi_admin_fw_commit(nvme_mi_ctrl_t ctrl, struct nvme_fw_commit_args *args)¶ Commit firmware using the specified action
Parameters
nvme_mi_ctrl_t ctrlController to send firmware data to
struct nvme_fw_commit_args *argsstruct nvme_fw_download_argsargument structure
Description
The Firmware Commit command modifies the firmware image or Boot Partitions.
Return
0 on success, non-zero on failure
-
int
nvme_mi_admin_format_nvm(nvme_mi_ctrl_t ctrl, struct nvme_format_nvm_args *args)¶ Format NVMe namespace
Parameters
nvme_mi_ctrl_t ctrlController to send command to
struct nvme_format_nvm_args *argsFormat NVM command arguments
Description
Perform a low-level format to set the LBA data & metadata size. May destroy data & metadata on the specified namespaces
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
-
int
nvme_mi_admin_sanitize_nvm(nvme_mi_ctrl_t ctrl, struct nvme_sanitize_nvm_args *args)¶ Start a subsystem Sanitize operation
Parameters
nvme_mi_ctrl_t ctrlController to send command to
struct nvme_sanitize_nvm_args *argsSanitize command arguments
Description
A sanitize operation alters all user data in the NVM subsystem such that recovery of any previous user data from any cache, the non-volatile media, or any Controller Memory Buffer is not possible.
The Sanitize command starts a sanitize operation or to recover from a previously failed sanitize operation. The sanitize operation types that may be supported are Block Erase, Crypto Erase, and Overwrite. All sanitize operations are processed in the background, i.e., completion of the sanitize command does not indicate completion of the sanitize operation.
Return
The nvme command status if a response was received (see
enum nvme_status_field) or -1 with errno set otherwise.
tree.h
libnvme tree object interface
-
nvme_root_t
nvme_create_root(FILE *fp, int log_level)¶ Initialize root object
Parameters
FILE *fpFile descriptor for logging messages
int log_levelLogging level to use
Return
Initialized nvme_root_t object
-
void
nvme_root_set_application(nvme_root_t r, const char *a)¶ Specify managing application
Parameters
nvme_root_t rnvme_root_tobjectconst char *aApplication string
Description
Sets the managing application string for r.
-
const char *
nvme_root_get_application(nvme_root_t r)¶ Get managing application
Parameters
nvme_root_t rnvme_root_tobject
Description
Returns the managing application string for r or NULL if not set.
-
void
nvme_root_release_fds(nvme_root_t r)¶ Close all opened file descriptors in the tree
Parameters
nvme_root_t rnvme_root_tobject
Description
Controller and Namespace objects cache the file descriptors of opened nvme devices. This API can be used to close and clear all cached fds in the tree.
-
void
nvme_free_tree(nvme_root_t r)¶ Free root object
Parameters
nvme_root_t rnvme_root_tobject
Description
Free an nvme_root_t object and all attached objects
-
nvme_host_t
nvme_first_host(nvme_root_t r)¶ Start host iterator
Parameters
nvme_root_t rnvme_root_tobject
Return
First nvme_host_t object in an iterator
-
nvme_host_t
nvme_next_host(nvme_root_t r, nvme_host_t h)¶ Next host iterator
Parameters
nvme_root_t rnvme_root_tobjectnvme_host_t hPrevious
nvme_host_titerator
Return
Next nvme_host_t object in an iterator
-
nvme_root_t
nvme_host_get_root(nvme_host_t h)¶ Returns nvme_root_t object
Parameters
nvme_host_t hnvme_host_tobject
Return
nvme_root_t object from h
-
nvme_host_t
nvme_lookup_host(nvme_root_t r, const char *hostnqn, const char *hostid)¶ Lookup nvme_host_t object
Parameters
nvme_root_t rnvme_root_tobjectconst char *hostnqnHost NQN
const char *hostidHost ID
Description
Lookup a nvme_host_t object based on hostnqn and hostid or create one if not found.
Return
nvme_host_t object
-
const char *
nvme_host_get_dhchap_key(nvme_host_t h)¶ Return host key
Parameters
nvme_host_t hHost for which the key should be returned
Return
DH-HMAC-CHAP host key or NULL if not set
-
void
nvme_host_set_dhchap_key(nvme_host_t h, const char *key)¶ set host key
Parameters
nvme_host_t hHost for which the key should be set
const char *keyDH-HMAC-CHAP Key to set or NULL to clear existing key
-
void
nvme_host_set_pdc_enabled(nvme_host_t h, bool enabled)¶ Set Persistent Discovery Controller flag
Parameters
nvme_host_t hHost for which the falg should be set
bool enabledThe bool to set the enabled flag
Description
When nvme_host_set_pdc_enabled() is not used to set the PDC flag, nvme_host_is_pdc_enabled() will return the default value which was passed into the function and not the undefined flag value.
-
bool
nvme_host_is_pdc_enabled(nvme_host_t h, bool fallback)¶ Is Persistenct Discovery Controller enabled
Parameters
nvme_host_t hHost which to check if PDC is enabled
bool fallbackThe fallback default value of the flag when nvme_host_set_pdc_enabled has not be used to set the flag.
Return
true if PDC is enabled for h, else false
-
nvme_host_t
nvme_default_host(nvme_root_t r)¶ Initializes the default host
Parameters
nvme_root_t rnvme_root_tobject
Description
Initializes the default host object based on the values in /etc/nvme/hostnqn and /etc/nvme/hostid and attaches it to r.
Return
nvme_host_t object
-
nvme_subsystem_t
nvme_first_subsystem(nvme_host_t h)¶ Start subsystem iterator
Parameters
nvme_host_t hnvme_host_tobject
Return
first nvme_subsystem_t object in an iterator
-
nvme_subsystem_t
nvme_next_subsystem(nvme_host_t h, nvme_subsystem_t s)¶ Next subsystem iterator
Parameters
nvme_host_t hnvme_host_tobjectnvme_subsystem_t sPrevious
nvme_subsystem_titerator
Return
next nvme_subsystem_t object in an iterator
-
nvme_subsystem_t
nvme_lookup_subsystem(struct nvme_host *h, const char *name, const char *subsysnqn)¶ Lookup nvme_subsystem_t object
Parameters
struct nvme_host *hnvme_host_tobjectconst char *nameName of the subsystem (may be NULL)
const char *subsysnqnSubsystem NQN
Description
Lookup a nvme_subsystem_t object in h base on name (if present)
and subsysnqn or create one if not found.
Return
nvme_subsystem_t object
-
void
nvme_free_subsystem(struct nvme_subsystem *s)¶ Free a subsystem
Parameters
struct nvme_subsystem *ssubsystem
Description
Frees s and all related objects.
-
nvme_host_t
nvme_subsystem_get_host(nvme_subsystem_t s)¶ Returns nvme_host_t object
Parameters
nvme_subsystem_t ssubsystem
Return
nvme_host_t object from s
-
nvme_ns_t
nvme_ctrl_first_ns(nvme_ctrl_t c)¶ Start namespace iterator
Parameters
nvme_ctrl_t cController instance
Return
First nvme_ns_t object of an c iterator
-
nvme_ns_t
nvme_ctrl_next_ns(nvme_ctrl_t c, nvme_ns_t n)¶ Next namespace iterator
Parameters
nvme_ctrl_t cController instance
nvme_ns_t nPrevious nvme_ns_t iterator
Return
Next nvme_ns_t object of an c iterator
-
nvme_path_t
nvme_ctrl_first_path(nvme_ctrl_t c)¶ Start path iterator
Parameters
nvme_ctrl_t cController instance
Return
First nvme_path_t object of an c iterator
-
nvme_path_t
nvme_ctrl_next_path(nvme_ctrl_t c, nvme_path_t p)¶ Next path iterator
Parameters
nvme_ctrl_t cController instance
nvme_path_t pPrevious
nvme_path_tobject of an c iterator
Return
Next nvme_path_t object of an c iterator
-
nvme_ctrl_t
nvme_subsystem_first_ctrl(nvme_subsystem_t s)¶ First ctrl iterator
Parameters
nvme_subsystem_t snvme_subsystem_tobject
Return
First controller of an s iterator
-
nvme_ctrl_t
nvme_subsystem_next_ctrl(nvme_subsystem_t s, nvme_ctrl_t c)¶ Next ctrl iterator
Parameters
nvme_subsystem_t snvme_subsystem_tobjectnvme_ctrl_t cPrevious controller instance of an s iterator
Return
Next controller of an s iterator
-
nvme_path_t
nvme_namespace_first_path(nvme_ns_t ns)¶ Start path iterator
Parameters
nvme_ns_t nsNamespace instance
Return
First nvme_path_t object of an ns iterator
-
nvme_path_t
nvme_namespace_next_path(nvme_ns_t ns, nvme_path_t p)¶ Next path iterator
Parameters
nvme_ns_t nsNamespace instance
nvme_path_t pPrevious
nvme_path_tobject of an ns iterator
Return
Next nvme_path_t object of an ns iterator
-
nvme_ctrl_t
nvme_lookup_ctrl(nvme_subsystem_t s, const char *transport, const char *traddr, const char *host_traddr, const char *host_iface, const char *trsvcid, nvme_ctrl_t p)¶ Lookup nvme_ctrl_t object
Parameters
nvme_subsystem_t snvme_subsystem_tobjectconst char *transportTransport name
const char *traddrTransport address
const char *host_traddrHost transport address
const char *host_ifaceHost interface name
const char *trsvcidTransport service identifier
nvme_ctrl_t pPrevious controller instance
Description
Lookup a controller in s based on transport, traddr, host_traddr, host_iface, and trsvcid. transport must be specified, other fields may be required depending on the transport. A new object is created if none is found. If p is specified the lookup will start at p instead of the first controller.
Return
Controller instance
-
nvme_ctrl_t
nvme_ctrl_find(nvme_subsystem_t s, const char *transport, const char *traddr, const char *trsvcid, const char *subsysnqn, const char *host_traddr, const char *host_iface)¶ Locate an existing controller
Parameters
nvme_subsystem_t snvme_subsystem_tobjectconst char *transportTransport name
const char *traddrTransport address
const char *trsvcidTransport service identifier
const char *subsysnqnSubsystem NQN
const char *host_traddrHost transport address
const char *host_ifaceHost interface name
Description
Lookup a controller in s based on transport, traddr, trsvcid, subsysnqn, host_traddr, and host_iface. transport must be specified, other fields may be required depending on the transport. Parameters set to NULL will be ignored.
Unlike nvme_lookup_ctrl(), this function does not create a new object if an existing controller cannot be found.
Return
Controller instance on success, NULL otherwise.
-
bool
nvme_ctrl_config_match(struct nvme_ctrl *c, const char *transport, const char *traddr, const char *trsvcid, const char *subsysnqn, const char *host_traddr, const char *host_iface)¶ Check if ctrl c matches config params
Parameters
struct nvme_ctrl *cAn existing controller instance
const char *transportTransport name
const char *traddrTransport address
const char *trsvcidTransport service identifier
const char *subsysnqnSubsystem NQN
const char *host_traddrHost transport address
const char *host_ifaceHost interface name
Description
Check that controller c matches parameters: transport, traddr, trsvcid, subsysnqn, host_traddr, and host_iface. Parameters set to NULL will be ignored.
Return
true if there’s a match, false otherwise.
-
nvme_ctrl_t
nvme_create_ctrl(nvme_root_t r, const char *subsysnqn, const char *transport, const char *traddr, const char *host_traddr, const char *host_iface, const char *trsvcid)¶ Allocate an unconnected NVMe controller
Parameters
nvme_root_t rNVMe root element
const char *subsysnqnSubsystem NQN
const char *transportTransport type
const char *traddrTransport address
const char *host_traddrHost transport address
const char *host_ifaceHost interface name
const char *trsvcidTransport service ID
Description
Creates an unconnected controller to be used for nvme_add_ctrl().
Return
Controller instance
-
nvme_ns_t
nvme_subsystem_first_ns(nvme_subsystem_t s)¶ Start namespace iterator
Parameters
nvme_subsystem_t snvme_subsystem_tobject
Return
First nvme_ns_t object of an s iterator
-
nvme_ns_t
nvme_subsystem_next_ns(nvme_subsystem_t s, nvme_ns_t n)¶ Next namespace iterator
Parameters
nvme_subsystem_t snvme_subsystem_tobjectnvme_ns_t nPrevious
nvme_ns_titerator
Return
Next nvme_ns_t object of an s iterator
-
nvme_for_each_host_safe¶
nvme_for_each_host_safe (r, h, _h)
Traverse host list
Parameters
rnvme_root_tobjecthnvme_host_tobject_hTemporary
nvme_host_tobject
-
nvme_for_each_host¶
nvme_for_each_host (r, h)
Traverse host list
Parameters
rnvme_root_tobjecthnvme_host_tobject
-
nvme_for_each_subsystem_safe¶
nvme_for_each_subsystem_safe (h, s, _s)
Traverse subsystems
Parameters
hnvme_host_tobjectsnvme_subsystem_tobject_sTemporary
nvme_subsystem_tobject
-
nvme_for_each_subsystem¶
nvme_for_each_subsystem (h, s)
Traverse subsystems
Parameters
hnvme_host_tobjectsnvme_subsystem_tobject
-
nvme_subsystem_for_each_ctrl_safe¶
nvme_subsystem_for_each_ctrl_safe (s, c, _c)
Traverse controllers
Parameters
snvme_subsystem_tobjectcController instance
_cA
nvme_ctrl_t_nodeto use as temporary storage
-
nvme_subsystem_for_each_ctrl¶
nvme_subsystem_for_each_ctrl (s, c)
Traverse controllers
Parameters
snvme_subsystem_tobjectcController instance
-
nvme_ctrl_for_each_ns_safe¶
nvme_ctrl_for_each_ns_safe (c, n, _n)
Traverse namespaces
Parameters
cController instance
nnvme_ns_tobject_nA
nvme_ns_t_nodeto use as temporary storage
-
nvme_ctrl_for_each_ns¶
nvme_ctrl_for_each_ns (c, n)
Traverse namespaces
Parameters
cController instance
nnvme_ns_tobject
-
nvme_ctrl_for_each_path_safe¶
nvme_ctrl_for_each_path_safe (c, p, _p)
Traverse paths
Parameters
cController instance
pnvme_path_tobject_pA
nvme_path_t_nodeto use as temporary storage
-
nvme_ctrl_for_each_path¶
nvme_ctrl_for_each_path (c, p)
Traverse paths
Parameters
cController instance
pnvme_path_tobject
-
nvme_subsystem_for_each_ns_safe¶
nvme_subsystem_for_each_ns_safe (s, n, _n)
Traverse namespaces
Parameters
snvme_subsystem_tobjectnnvme_ns_tobject_nA
nvme_ns_t_nodeto use as temporary storage
-
nvme_subsystem_for_each_ns¶
nvme_subsystem_for_each_ns (s, n)
Traverse namespaces
Parameters
snvme_subsystem_tobjectnnvme_ns_tobject
-
nvme_namespace_for_each_path_safe¶
nvme_namespace_for_each_path_safe (n, p, _p)
Traverse paths
Parameters
nNamespace instance
pnvme_path_tobject_pA
nvme_path_t_nodeto use as temporary storage
-
nvme_namespace_for_each_path¶
nvme_namespace_for_each_path (n, p)
Traverse paths
Parameters
nNamespace instance
pnvme_path_tobject
-
int
nvme_ns_get_fd(nvme_ns_t n)¶ Get associated file descriptor
Parameters
nvme_ns_t nNamespace instance
Description
libnvme will open() the file (if not already opened) and keep an internal copy of the file descriptor. Following calls to this API retrieve the internal cached copy of the file descriptor. The file will remain opened and the fd will remain cached until the ns object is deleted or nvme_ns_release_fd() is called.
Return
File descriptor associated with n or -1
-
void
nvme_ns_release_fd(nvme_ns_t n)¶ Close fd and clear fd from ns object
Parameters
nvme_ns_t nNamespace instance
-
int
nvme_ns_get_nsid(nvme_ns_t n)¶ NSID of a namespace
Parameters
nvme_ns_t nNamespace instance
Return
NSID of n
-
int
nvme_ns_get_lba_size(nvme_ns_t n)¶ LBA size of a namespace
Parameters
nvme_ns_t nNamespace instance
Return
LBA size of n
-
int
nvme_ns_get_meta_size(nvme_ns_t n)¶ Metadata size of a namespace
Parameters
nvme_ns_t nNamespace instance
Return
Metadata size of n
-
uint64_t
nvme_ns_get_lba_count(nvme_ns_t n)¶ LBA count of a namespace
Parameters
nvme_ns_t nNamespace instance
Return
LBA count of n
-
uint64_t
nvme_ns_get_lba_util(nvme_ns_t n)¶ LBA utilization of a namespace
Parameters
nvme_ns_t nNamespace instance
Return
LBA utilization of n
Parameters
nvme_ns_t nNamespace instance
Return
The namespace’s command set identifier in use
-
const uint8_t *
nvme_ns_get_eui64(nvme_ns_t n)¶ 64-bit eui of a namespace
Parameters
nvme_ns_t nNamespace instance
Return
A pointer to the 64-bit eui
-
const uint8_t *
nvme_ns_get_nguid(nvme_ns_t n)¶ 128-bit nguid of a namespace
Parameters
nvme_ns_t nNamespace instance
Return
A pointer to the 128-bit nguid
-
void
nvme_ns_get_uuid(nvme_ns_t n, unsigned char out[NVME_UUID_LEN])¶ UUID of a namespace
Parameters
nvme_ns_t nNamespace instance
unsigned char out[NVME_UUID_LEN]buffer for the UUID
Description
Copies the namespace’s uuid into out
-
const char *
nvme_ns_get_sysfs_dir(nvme_ns_t n)¶ sysfs directory of a namespace
Parameters
nvme_ns_t nNamespace instance
Return
sysfs directory name of n
-
const char *
nvme_ns_get_name(nvme_ns_t n)¶ sysfs name of a namespace
Parameters
nvme_ns_t nNamespace instance
Return
sysfs name of n
-
const char *
nvme_ns_get_generic_name(nvme_ns_t n)¶ Returns name of generic namespace chardev.
Parameters
nvme_ns_t nNamespace instance
Return
Name of generic namespace chardev
-
const char *
nvme_ns_get_firmware(nvme_ns_t n)¶ Firmware string of a namespace
Parameters
nvme_ns_t nNamespace instance
Return
Firmware string of n
-
const char *
nvme_ns_get_serial(nvme_ns_t n)¶ Serial number of a namespace
Parameters
nvme_ns_t nNamespace instance
Return
Serial number string of n
-
const char *
nvme_ns_get_model(nvme_ns_t n)¶ Model of a namespace
Parameters
nvme_ns_t nNamespace instance
Return
Model string of n
-
nvme_subsystem_t
nvme_ns_get_subsystem(nvme_ns_t n)¶ nvme_subsystem_tof a namespace
Parameters
nvme_ns_t nNamespace instance
Return
nvme_subsystem_t object of n
-
nvme_ctrl_t
nvme_ns_get_ctrl(nvme_ns_t n)¶ nvme_ctrl_tof a namespace
Parameters
nvme_ns_t nNamespace instance
Description
nvme_ctrl_t object may be NULL for a multipathed namespace
Return
nvme_ctrl_t object of n if present
-
void
nvme_free_ns(struct nvme_ns *n)¶ Free a namespace object
Parameters
struct nvme_ns *nNamespace instance
-
int
nvme_ns_read(nvme_ns_t n, void *buf, off_t offset, size_t count)¶ Read from a namespace
Parameters
nvme_ns_t nNamespace instance
void *bufBuffer into which the data will be transferred
off_t offsetLBA offset of n
size_t countNumber of sectors in buf
Return
Number of sectors read or -1 on error.
-
int
nvme_ns_write(nvme_ns_t n, void *buf, off_t offset, size_t count)¶ Write to a namespace
Parameters
nvme_ns_t nNamespace instance
void *bufBuffer with data to be written
off_t offsetLBA offset of n
size_t countNumber of sectors in buf
Return
Number of sectors written or -1 on error
-
int
nvme_ns_verify(nvme_ns_t n, off_t offset, size_t count)¶ Verify data on a namespace
Parameters
nvme_ns_t nNamespace instance
off_t offsetLBA offset of n
size_t countNumber of sectors to be verified
Return
Number of sectors verified
-
int
nvme_ns_compare(nvme_ns_t n, void *buf, off_t offset, size_t count)¶ Compare data on a namespace
Parameters
nvme_ns_t nNamespace instance
void *bufBuffer with data to be compared
off_t offsetLBA offset of n
size_t countNumber of sectors in buf
Return
Number of sectors compared
-
int
nvme_ns_write_zeros(nvme_ns_t n, off_t offset, size_t count)¶ Write zeros to a namespace
Parameters
nvme_ns_t nNamespace instance
off_t offsetLBA offset in n
size_t countNumber of sectors to be written
Return
Number of sectors written
-
int
nvme_ns_write_uncorrectable(nvme_ns_t n, off_t offset, size_t count)¶ Issus a ‘write uncorrectable’ command
Parameters
nvme_ns_t nNamespace instance
off_t offsetLBA offset in n
size_t countNumber of sectors to be written
Return
Number of sectors written
-
int
nvme_ns_flush(nvme_ns_t n)¶ Flush data to a namespace
Parameters
nvme_ns_t nNamespace instance
Return
0 on success, -1 on error.
-
int
nvme_ns_identify(nvme_ns_t n, struct nvme_id_ns *ns)¶ Issue an ‘identify namespace’ command
Parameters
nvme_ns_t nNamespace instance
struct nvme_id_ns *nsnvme_id_nsbuffer
Description
Writes the data returned by the ‘identify namespace’ command into ns.
Return
0 on success, -1 on error.
-
int
nvme_ns_identify_descs(nvme_ns_t n, struct nvme_ns_id_desc *descs)¶ Issue an ‘identify descriptors’ command
Parameters
nvme_ns_t nNamespace instance
struct nvme_ns_id_desc *descsList of identify descriptors
Description
Writes the data returned by the ‘identify descriptors’ command into descs.
Return
0 on success, -1 on error.
-
const char *
nvme_path_get_name(nvme_path_t p)¶ sysfs name of an
nvme_path_tobject
Parameters
nvme_path_t pnvme_path_tobject
Return
sysfs name of p
-
const char *
nvme_path_get_sysfs_dir(nvme_path_t p)¶ sysfs directory of an nvme_path_t object
Parameters
nvme_path_t pnvme_path_tobject
Return
sysfs directory of p
-
const char *
nvme_path_get_ana_state(nvme_path_t p)¶ ANA state of an nvme_path_t object
Parameters
nvme_path_t pnvme_path_tobject
Return
ANA (Asynchronous Namespace Access) state of p
-
nvme_ctrl_t
nvme_path_get_ctrl(nvme_path_t p)¶ Parent controller of an nvme_path_t object
Parameters
nvme_path_t pnvme_path_tobject
Return
Parent controller if present
-
nvme_ns_t
nvme_path_get_ns(nvme_path_t p)¶ Parent namespace of an nvme_path_t object
Parameters
nvme_path_t pnvme_path_tobject
Return
Parent namespace if present
-
int
nvme_ctrl_get_fd(nvme_ctrl_t c)¶ Get associated file descriptor
Parameters
nvme_ctrl_t cController instance
Description
libnvme will open() the file (if not already opened) and keep an internal copy of the file descriptor. Following calls to this API retrieve the internal cached copy of the file descriptor. The file will remain opened and the fd will remain cached until the controller object is deleted or nvme_ctrl_release_fd() is called.
Return
File descriptor associated with c or -1
-
void
nvme_ctrl_release_fd(nvme_ctrl_t c)¶ Close fd and clear fd from controller object
Parameters
nvme_ctrl_t cController instance
-
const char *
nvme_ctrl_get_name(nvme_ctrl_t c)¶ sysfs name of a controller
Parameters
nvme_ctrl_t cController instance
Return
sysfs name of c
-
const char *
nvme_ctrl_get_sysfs_dir(nvme_ctrl_t c)¶ sysfs directory of a controller
Parameters
nvme_ctrl_t cController instance
Return
sysfs directory name of c
-
const char *
nvme_ctrl_get_address(nvme_ctrl_t c)¶ Address string of a controller
Parameters
nvme_ctrl_t cController instance
Return
NVMe-over-Fabrics address string of c or empty string of no address is present.
-
char *
nvme_ctrl_get_src_addr(nvme_ctrl_t c, char *src_addr, size_t src_addr_len)¶ Extract src_addr from the c->address string
Parameters
nvme_ctrl_t cController instance
char *src_addrWhere to copy the src_addr. Size must be at least INET6_ADDRSTRLEN.
size_t src_addr_lenLength of the buffer src_addr.
Return
Pointer to src_addr on success. NULL on failure to extract the src_addr.
-
const char *
nvme_ctrl_get_phy_slot(nvme_ctrl_t c)¶ PCI physical slot number of a controller
Parameters
nvme_ctrl_t cController instance
Return
PCI physical slot number of c or empty string if slot number is not present.
-
const char *
nvme_ctrl_get_firmware(nvme_ctrl_t c)¶ Firmware string of a controller
Parameters
nvme_ctrl_t cController instance
Return
Firmware string of c
-
const char *
nvme_ctrl_get_model(nvme_ctrl_t c)¶ Model of a controller
Parameters
nvme_ctrl_t cController instance
Return
Model string of c
-
const char *
nvme_ctrl_get_state(nvme_ctrl_t c)¶ Running state of a controller
Parameters
nvme_ctrl_t cController instance
Return
String indicating the running state of c
-
const char *
nvme_ctrl_get_numa_node(nvme_ctrl_t c)¶ NUMA node of a controller
Parameters
nvme_ctrl_t cController instance
Return
String indicating the NUMA node
-
const char *
nvme_ctrl_get_queue_count(nvme_ctrl_t c)¶ Queue count of a controller
Parameters
nvme_ctrl_t cController instance
Return
Queue count of c
-
const char *
nvme_ctrl_get_serial(nvme_ctrl_t c)¶ Serial number of a controller
Parameters
nvme_ctrl_t cController instance
Return
Serial number string of c
-
const char *
nvme_ctrl_get_sqsize(nvme_ctrl_t c)¶ SQ size of a controller
Parameters
nvme_ctrl_t cController instance
Return
SQ size (as string) of c
-
const char *
nvme_ctrl_get_transport(nvme_ctrl_t c)¶ Transport type of a controller
Parameters
nvme_ctrl_t cController instance
Return
Transport type of c
-
const char *
nvme_ctrl_get_subsysnqn(nvme_ctrl_t c)¶ Subsystem NQN of a controller
Parameters
nvme_ctrl_t cController instance
Return
Subsystem NQN of c
-
nvme_subsystem_t
nvme_ctrl_get_subsystem(nvme_ctrl_t c)¶ Parent subsystem of a controller
Parameters
nvme_ctrl_t cController instance
Return
Parent nvme_subsystem_t object
-
const char *
nvme_ctrl_get_traddr(nvme_ctrl_t c)¶ Transport address of a controller
Parameters
nvme_ctrl_t cController instance
Return
Transport address of c
-
const char *
nvme_ctrl_get_trsvcid(nvme_ctrl_t c)¶ Transport service identifier of a controller
Parameters
nvme_ctrl_t cController instance
Return
Transport service identifier of c (if present)
-
const char *
nvme_ctrl_get_host_traddr(nvme_ctrl_t c)¶ Host transport address of a controller
Parameters
nvme_ctrl_t cController instance
Return
Host transport address of c (if present)
-
const char *
nvme_ctrl_get_host_iface(nvme_ctrl_t c)¶ Host interface name of a controller
Parameters
nvme_ctrl_t cController instance
Return
Host interface name of c (if present)
-
const char *
nvme_ctrl_get_dhchap_host_key(nvme_ctrl_t c)¶ Return host key
Parameters
nvme_ctrl_t cController to be checked
Return
DH-HMAC-CHAP host key or NULL if not set
-
void
nvme_ctrl_set_dhchap_host_key(nvme_ctrl_t c, const char *key)¶ Set host key
Parameters
nvme_ctrl_t cHost for which the key should be set
const char *keyDH-HMAC-CHAP Key to set or NULL to clear existing key
-
const char *
nvme_ctrl_get_dhchap_key(nvme_ctrl_t c)¶ Return controller key
Parameters
nvme_ctrl_t cController for which the key should be set
Return
DH-HMAC-CHAP controller key or NULL if not set
-
void
nvme_ctrl_set_dhchap_key(nvme_ctrl_t c, const char *key)¶ Set controller key
Parameters
nvme_ctrl_t cController for which the key should be set
const char *keyDH-HMAC-CHAP Key to set or NULL to clear existing key
-
struct nvme_fabrics_config *
nvme_ctrl_get_config(nvme_ctrl_t c)¶ Fabrics configuration of a controller
Parameters
nvme_ctrl_t cController instance
Return
Fabrics configuration of c
-
void
nvme_ctrl_set_discovered(nvme_ctrl_t c, bool discovered)¶ Set the ‘discovered’ flag
Parameters
nvme_ctrl_t cnvme_ctrl_t object
bool discoveredValue of the ‘discovered’ flag
Description
Set the ‘discovered’ flag of c to discovered
-
bool
nvme_ctrl_is_discovered(nvme_ctrl_t c)¶ Returns the value of the ‘discovered’ flag
Parameters
nvme_ctrl_t cController instance
Return
Value of the ‘discovered’ flag of c
-
void
nvme_ctrl_set_persistent(nvme_ctrl_t c, bool persistent)¶ Set the ‘persistent’ flag
Parameters
nvme_ctrl_t cController instance
bool persistentvalue of the ‘persistent’ flag
Description
Set the ‘persistent’ flag of c to persistent
-
bool
nvme_ctrl_is_persistent(nvme_ctrl_t c)¶ Returns the value of the ‘persistent’ flag
Parameters
nvme_ctrl_t cController instance
Return
Value of the ‘persistent’ flag of c
-
void
nvme_ctrl_set_discovery_ctrl(nvme_ctrl_t c, bool discovery)¶ Set the ‘discovery_ctrl’ flag
Parameters
nvme_ctrl_t cController to be modified
bool discoveryvalue of the discovery_ctrl flag
Description
Sets the ‘discovery_ctrl’ flag in c to specify whether c connects to a discovery subsystem.
-
bool
nvme_ctrl_is_discovery_ctrl(nvme_ctrl_t c)¶ Check the ‘discovery_ctrl’ flag
Parameters
nvme_ctrl_t cController to be checked
Description
Returns the value of the ‘discovery_ctrl’ flag which specifies whether c connects to a discovery subsystem.
Return
Value of the ‘discover_ctrl’ flag
-
void
nvme_ctrl_set_unique_discovery_ctrl(nvme_ctrl_t c, bool unique)¶ Set the ‘unique_discovery_ctrl’ flag
Parameters
nvme_ctrl_t cController to be modified
bool uniquevalue of the unique_disc_ctrl flag
Description
Sets the ‘unique_discovery_ctrl’ flag in c to specify wheter c is a unique discovery controller
-
bool
nvme_ctrl_is_unique_discovery_ctrl(nvme_ctrl_t c)¶ Check the ‘unique_discovery_ctrl’ flag
Parameters
nvme_ctrl_t cController to be checked
Return
Value of the ‘unique_discovery_ctrl’ flag
-
int
nvme_ctrl_identify(nvme_ctrl_t c, struct nvme_id_ctrl *id)¶ Issues an ‘identify controller’ command
Parameters
nvme_ctrl_t cController instance
struct nvme_id_ctrl *idIdentify controller data structure
Description
Issues an ‘identify controller’ command to c and copies the data into id.
Return
0 on success or -1 on failure.
-
int
nvme_disconnect_ctrl(nvme_ctrl_t c)¶ Disconnect a controller
Parameters
nvme_ctrl_t cController instance
Description
Issues a ‘disconnect’ fabrics command to c
Return
0 on success, -1 on failure.
-
nvme_ctrl_t
nvme_scan_ctrl(nvme_root_t r, const char *name)¶ Scan on a controller
Parameters
nvme_root_t rnvme_root_t object
const char *nameName of the controller
Description
Scans a controller with sysfs name name and add it to r.
Return
nvme_ctrl_t object
-
void
nvme_rescan_ctrl(nvme_ctrl_t c)¶ Rescan an existing controller
Parameters
nvme_ctrl_t cController instance
-
int
nvme_init_ctrl(nvme_host_t h, nvme_ctrl_t c, int instance)¶ Initialize nvme_ctrl_t object for an existing controller.
Parameters
nvme_host_t hnvme_host_t object
nvme_ctrl_t cnvme_ctrl_t object
int instanceInstance number (e.g. 1 for nvme1)
Return
The ioctl() return code. Typically 0 on success.
-
void
nvme_free_ctrl(struct nvme_ctrl *c)¶ Free controller
Parameters
struct nvme_ctrl *cController instance
-
void
nvme_unlink_ctrl(struct nvme_ctrl *c)¶ Unlink controller
Parameters
struct nvme_ctrl *cController instance
-
const char *
nvme_subsystem_get_nqn(nvme_subsystem_t s)¶ Retrieve NQN from subsystem
Parameters
nvme_subsystem_t snvme_subsystem_t object
Return
NQN of subsystem
-
const char *
nvme_subsystem_get_sysfs_dir(nvme_subsystem_t s)¶ sysfs directory of an nvme_subsystem_t object
Parameters
nvme_subsystem_t snvme_subsystem_t object
Return
sysfs directory name of s
-
const char *
nvme_subsystem_get_name(nvme_subsystem_t s)¶ sysfs name of an nvme_subsystem_t object
Parameters
nvme_subsystem_t snvme_subsystem_t object
Return
sysfs name of s
-
const char *
nvme_subsystem_get_type(nvme_subsystem_t s)¶ Returns the type of a subsystem
Parameters
nvme_subsystem_t snvme_subsystem_t object
Description
Returns the subsystem type of s.
Return
‘nvm’ or ‘discovery’
-
const char *
nvme_subsystem_get_application(nvme_subsystem_t s)¶ Return the application string
Parameters
nvme_subsystem_t snvme_subsystem_t object
Return
Managing application string or NULL if not set.
-
void
nvme_subsystem_set_application(nvme_subsystem_t s, const char *a)¶ Set the application string
Parameters
nvme_subsystem_t snvme_subsystem_t object
const char *aapplication string
Description
Sets the managing application string for s.
-
const char *
nvme_subsystem_get_iopolicy(nvme_subsystem_t s)¶ Return the IO policy of subsytem
Parameters
nvme_subsystem_t snvme_subsystem_t object
Return
IO policy used by current subsystem
-
int
nvme_scan_topology(nvme_root_t r, nvme_scan_filter_t f, void *f_args)¶ Scan NVMe topology and apply filter
Parameters
nvme_root_t rnvme_root_t object
nvme_scan_filter_t ffilter to apply
void *f_argsuser-specified argument to f
Description
Scans the NVMe topology and filters out the resulting elements by applying f.
Return
Number of elements scanned
-
const char *
nvme_host_get_hostnqn(nvme_host_t h)¶ Host NQN of an nvme_host_t object
Parameters
nvme_host_t hnvme_host_t object
Return
Host NQN of h
-
const char *
nvme_host_get_hostid(nvme_host_t h)¶ Host ID of an nvme_host_t object
Parameters
nvme_host_t hnvme_host_t object
Return
Host ID of h
-
void
nvme_host_release_fds(struct nvme_host *h)¶ Close all opened file descriptors under host
Parameters
struct nvme_host *hnvme_host_t object
Description
Controller and Namespace objects cache the file descriptors of opened nvme devices. This API can be used to close and clear all cached fds under this host.
-
void
nvme_free_host(nvme_host_t h)¶ Free nvme_host_t object
Parameters
nvme_host_t hnvme_host_t object
-
nvme_root_t
nvme_scan(const char *config_file)¶ Scan NVMe topology
Parameters
const char *config_fileConfiguration file
Return
nvme_root_t object of found elements
-
int
nvme_read_config(nvme_root_t r, const char *config_file)¶ Read NVMe JSON configuration file
Parameters
nvme_root_t rnvme_root_t object
const char *config_fileJSON configuration file
Description
Read in the contents of config_file and merge them with the elements in r.
Return
0 on success, -1 on failure with errno set.
-
void
nvme_refresh_topology(nvme_root_t r)¶ Refresh nvme_root_t object contents
Parameters
nvme_root_t rnvme_root_t object
Description
Removes all elements in r and rescans the existing topology.
-
int
nvme_update_config(nvme_root_t r)¶ Update JSON configuration
Parameters
nvme_root_t rnvme_root_t object
Description
Updates the JSON configuration file with the contents of r.
Return
0 on success, -1 on failure.
-
int
nvme_dump_config(nvme_root_t r)¶ Print the JSON configuration
Parameters
nvme_root_t rnvme_root_t object
Description
Prints the current contents of the JSON configuration file to stdout.
Return
0 on success, -1 on failure.
-
int
nvme_dump_tree(nvme_root_t r)¶ Dump internal object tree
Parameters
nvme_root_t rnvme_root_t object
Description
Prints the internal object tree in JSON format to stdout.
Return
0 on success, -1 on failure.
-
char *
nvme_get_attr(const char *d, const char *attr)¶ Read sysfs attribute
Parameters
const char *dsysfs directory
const char *attrsysfs attribute name
Return
- String with the contents of attr or
NULLin case of an empty value or in case of an error (indicated by non-zero errno code).
-
char *
nvme_get_subsys_attr(nvme_subsystem_t s, const char *attr)¶ Read subsystem sysfs attribute
Parameters
nvme_subsystem_t snvme_subsystem_t object
const char *attrsysfs attribute name
Return
- String with the contents of attr or
NULLin case of an empty value or in case of an error (indicated by non-zero errno code).
-
char *
nvme_get_ctrl_attr(nvme_ctrl_t c, const char *attr)¶ Read controller sysfs attribute
Parameters
nvme_ctrl_t cController instance
const char *attrsysfs attribute name
Return
- String with the contents of attr or
NULLin case of an empty value or in case of an error (indicated by non-zero errno code).
-
char *
nvme_get_ns_attr(nvme_ns_t n, const char *attr)¶ Read namespace sysfs attribute
Parameters
nvme_ns_t nnvme_ns_t object
const char *attrsysfs attribute name
Return
- String with the contents of attr or
NULLin case of an empty value or in case of an error (indicated by non-zero errno code).
-
nvme_ns_t
nvme_subsystem_lookup_namespace(struct nvme_subsystem *s, __u32 nsid)¶ lookup namespace by NSID
Parameters
struct nvme_subsystem *snvme_subsystem_t object
__u32 nsidNamespace id
Return
nvme_ns_t of the namespace with id nsid in subsystem s
-
void
nvme_subsystem_release_fds(struct nvme_subsystem *s)¶ Close all opened fds under subsystem
Parameters
struct nvme_subsystem *snvme_subsystem_t object
Description
Controller and Namespace objects cache the file descriptors of opened nvme devices. This API can be used to close and clear all cached fds under this subsystem.
-
char *
nvme_get_path_attr(nvme_path_t p, const char *attr)¶ Read path sysfs attribute
Parameters
nvme_path_t pnvme_path_t object
const char *attrsysfs attribute name
Return
- String with the contents of attr or
NULLin case of an empty value or in case of an error (indicated by non-zero errno code).
-
nvme_ns_t
nvme_scan_namespace(const char *name)¶ scan namespace based on sysfs name
Parameters
const char *namesysfs name of the namespace to scan
Return
nvme_ns_t object or NULL if not found.
-
const char *
nvme_host_get_hostsymname(nvme_host_t h)¶ Get the host’s symbolic name
Parameters
nvme_host_t hHost for which the symbolic name should be returned.
Return
The symbolic name or NULL if a symbolic name hasn’t been configure.
-
void
nvme_host_set_hostsymname(nvme_host_t h, const char *hostsymname)¶ Set the host’s symbolic name
Parameters
nvme_host_t hHost for which the symbolic name should be set.
const char *hostsymnameSymbolic name
filters.h
libnvme directory filter
-
int
nvme_namespace_filter(const struct dirent *d)¶ Filter for namespaces
Parameters
const struct dirent *ddirent to check
Return
1 if d matches, 0 otherwise
-
int
nvme_paths_filter(const struct dirent *d)¶ Filter for paths
Parameters
const struct dirent *ddirent to check
Return
1 if d matches, 0 otherwise
-
int
nvme_ctrls_filter(const struct dirent *d)¶ Filter for controllers
Parameters
const struct dirent *ddirent to check
Return
1 if d matches, 0 otherwise
-
int
nvme_subsys_filter(const struct dirent *d)¶ Filter for subsystems
Parameters
const struct dirent *ddirent to check
Return
1 if d matches, 0 otherwise
-
int
nvme_scan_subsystems(struct dirent ***subsys)¶ Scan for subsystems
Parameters
struct dirent ***subsysPointer to array of dirents
Return
number of entries in subsys
-
int
nvme_scan_subsystem_namespaces(nvme_subsystem_t s, struct dirent ***ns)¶ Scan for namespaces in a subsystem
Parameters
nvme_subsystem_t sSubsystem to scan
struct dirent ***nsPointer to array of dirents
Return
number of entries in ns
-
int
nvme_scan_ctrls(struct dirent ***ctrls)¶ Scan for controllers
Parameters
struct dirent ***ctrlsPointer to array of dirents
Return
number of entries in ctrls
-
int
nvme_scan_ctrl_namespace_paths(nvme_ctrl_t c, struct dirent ***paths)¶ Scan for namespace paths in a controller
Parameters
nvme_ctrl_t cController to scan
struct dirent ***pathsPointer to array of dirents
Return
number of entries in paths
-
int
nvme_scan_ctrl_namespaces(nvme_ctrl_t c, struct dirent ***ns)¶ Scan for namespaces in a controller
Parameters
nvme_ctrl_t cController to scan
struct dirent ***nsPointer to array of dirents
Return
number of entries in ns
util.h
libnvme utility functions
-
enum
nvme_connect_err¶ nvme connect error codes
Constants
ENVME_CONNECT_RESOLVEfailed to resolve host
ENVME_CONNECT_ADDRFAMunrecognized address family
ENVME_CONNECT_TRADDRfailed to get traddr
ENVME_CONNECT_TARGneed a transport (-t) argument
ENVME_CONNECT_AARGneed a address (-a) argument
ENVME_CONNECT_OPENfailed to open nvme-fabrics device
ENVME_CONNECT_WRITEfailed to write to nvme-fabrics device
ENVME_CONNECT_READfailed to read from nvme-fabrics device
ENVME_CONNECT_PARSEfailed to parse ctrl info
ENVME_CONNECT_INVAL_TRinvalid transport type
ENVME_CONNECT_LOOKUP_SUBSYS_NAMEfailed to lookup subsystem name
ENVME_CONNECT_LOOKUP_SUBSYSfailed to lookup subsystem
ENVME_CONNECT_ALREADYthe connect attempt failed, already connected
ENVME_CONNECT_INVALinvalid arguments/configuration
ENVME_CONNECT_ADDRINUSEhostnqn already in use
ENVME_CONNECT_NODEVinvalid interface
ENVME_CONNECT_OPNOTSUPPnot supported
ENVME_CONNECT_CONNREFUSEDconnection refused
ENVME_CONNECT_ADDRNOTAVAILcannot assign requested address
ENVME_CONNECT_IGNOREDconnect attempt is ignored due to configuration
-
__u8
nvme_status_to_errno(int status, bool fabrics)¶ Converts nvme return status to errno
Parameters
int statusReturn status from an nvme passthrough command
bool fabricsSet to true if
statusis to a fabrics target.
Return
An errno representing the nvme status if it is an nvme status field, or unchanged status is < 0 since errno is already set.
-
const char *
nvme_status_to_string(int status, bool fabrics)¶ Returns string describing nvme return status.
Parameters
int statusReturn status from an nvme passthrough command
bool fabricsSet to true if
statusis to a fabrics target.
Return
String representation of the nvme status if it is an nvme status field, or a standard errno string if status is < 0.
-
const char *
nvme_errno_to_string(int err)¶ Returns string describing nvme connect failures
Parameters
int errReturned error code from nvme_add_ctrl()
Return
String representation of the nvme connect error codes
-
void
nvme_init_ctrl_list(struct nvme_ctrl_list *cntlist, __u16 num_ctrls, __u16 *ctrlist)¶ Initialize an nvme_ctrl_list structure from an array.
Parameters
struct nvme_ctrl_list *cntlistThe controller list structure to initialize
__u16 num_ctrlsThe number of controllers in the array,
ctrlist.__u16 *ctrlistAn array of controller identifiers in CPU native endian.
Description
This is intended to be used with any command that takes a controller list argument. See nvme_ns_attach_ctrls() and nvme_ns_detach().
-
void
nvme_init_dsm_range(struct nvme_dsm_range *dsm, __u32 *ctx_attrs, __u32 *llbas, __u64 *slbas, __u16 nr_ranges)¶ Constructs a data set range structure
Parameters
struct nvme_dsm_range *dsmDSM range array
__u32 *ctx_attrsArray of context attributes
__u32 *llbasArray of length in logical blocks
__u64 *slbasArray of starting logical blocks
__u16 nr_rangesThe size of the dsm arrays
Description
Each array must be the same size of size ‘nr_ranges’. This is intended to be used with constructing a payload for nvme_dsm().
Return
The nvme command status if a response was received or -errno otherwise.
-
void
nvme_init_copy_range(struct nvme_copy_range *copy, __u16 *nlbs, __u64 *slbas, __u32 *eilbrts, __u32 *elbatms, __u32 *elbats, __u16 nr)¶ Constructs a copy range structure
Parameters
struct nvme_copy_range *copyCopy range array
__u16 *nlbsNumber of logical blocks
__u64 *slbasStarting LBA
__u32 *eilbrtsExpected initial logical block reference tag
__u32 *elbatmsExpected logical block application tag mask
__u32 *elbatsExpected logical block application tag
__u16 nrNumber of descriptors to construct
-
void
nvme_init_copy_range_f1(struct nvme_copy_range_f1 *copy, __u16 *nlbs, __u64 *slbas, __u64 *eilbrts, __u32 *elbatms, __u32 *elbats, __u16 nr)¶ Constructs a copy range f1 structure
Parameters
struct nvme_copy_range_f1 *copyCopy range array
__u16 *nlbsNumber of logical blocks
__u64 *slbasStarting LBA
__u64 *eilbrtsExpected initial logical block reference tag
__u32 *elbatmsExpected logical block application tag mask
__u32 *elbatsExpected logical block application tag
__u16 nrNumber of descriptors to construct
-
int
nvme_get_feature_length(int fid, __u32 cdw11, __u32 *len)¶ Retreive the command payload length for a specific feature identifier
Parameters
int fidFeature identifier, see
enum nvme_features_id.__u32 cdw11The cdw11 value may affect the transfer (only known fid is
NVME_FEAT_FID_HOST_ID)__u32 *lenOn success, set to this features payload length in bytes.
Return
0 on success, -1 with errno set to EINVAL if the function did not
recognize fid.
-
int
nvme_get_feature_length2(int fid, __u32 cdw11, enum nvme_data_tfr dir, __u32 *len)¶ Retreive the command payload length for a specific feature identifier
Parameters
int fidFeature identifier, see
enum nvme_features_id.__u32 cdw11The cdw11 value may affect the transfer (only known fid is
NVME_FEAT_FID_HOST_ID)enum nvme_data_tfr dirData transfer direction: false - host to controller, true - controller to host may affect the transfer (only known fid is
NVME_FEAT_FID_HOST_MEM_BUF).__u32 *lenOn success, set to this features payload length in bytes.
Return
0 on success, -1 with errno set to EINVAL if the function did not
recognize fid.
-
int
nvme_get_directive_receive_length(enum nvme_directive_dtype dtype, enum nvme_directive_receive_doper doper, __u32 *len)¶ Get directive receive length
Parameters
enum nvme_directive_dtype dtypeDirective type, see
enum nvme_directive_dtypeenum nvme_directive_receive_doper doperDirective receive operation, see
enum nvme_directive_receive_doper__u32 *lenOn success, set to this directives payload length in bytes.
Return
0 on success, -1 with errno set to EINVAL if the function did not
recognize dtype or doper.
-
size_t
get_entity_name(char *buffer, size_t bufsz)¶ Get Entity Name (ENAME).
Parameters
char *bufferThe buffer where the ENAME will be saved as an ASCII string.
size_t bufszThe size of buffer.
Description
Per TP8010, ENAME is defined as the name associated with the host (i.e. hostname).
Return
Number of characters copied to buffer.
-
size_t
get_entity_version(char *buffer, size_t bufsz)¶ Get Entity Version (EVER).
Parameters
char *bufferThe buffer where the EVER will be saved as an ASCII string.
size_t bufszThe size of buffer.
Description
EVER is defined as the operating system name and version as an ASCII string. This function reads different files from the file system and builds a string as follows: [os type] [os release] [distro release]
E.g. “Linux 5.17.0-rc1 SLES 15.4”
Return
Number of characters copied to buffer.
-
char *
kv_strip(char *kv)¶ Strip blanks from key value string
Parameters
char *kvThe key-value string to strip
Description
Strip leading/trailing blanks as well as trailing comments from the Key=Value string pointed to by kv.
Return
A pointer to the stripped string. Note that the original string, kv, gets modified.
-
char *
kv_keymatch(const char *kv, const char *key)¶ Look for key in key value string
Parameters
const char *kvThe key=value string to search for the presence of key
const char *keyThe key to look for
Description
Look for key in the Key=Value pair pointed to by k and return a pointer to the Value if key is found.
Check if kv starts with key. If it does then make sure that we have a whole-word match on the key, and if we do, return a pointer to the first character of value (i.e. skip leading spaces, tabs, and equal sign)
Return
A pointer to the first character of “value” if a match is found. NULL otherwise.
-
char *
startswith(const char *s, const char *prefix)¶ Checks that a string starts with a given prefix.
Parameters
const char *sThe string to check
const char *prefixA string that s could be starting with
Return
If s starts with prefix, then return a pointer within s at the first character after the matched prefix. NULL otherwise.
-
round_up¶
round_up (val, mult)
Round a value val to the next multiple specified by mult.
Parameters
valValue to round
multMultiple to round to.
Description
usage: int x = round_up(13, sizeof(__u32)); // 13 -> 16
-
__u16
nvmf_exat_len(size_t val_len)¶ Return length rounded up by 4
Parameters
size_t val_lenValue length
Description
Return the size in bytes, rounded to a multiple of 4 (e.g., size of __u32), of the buffer needed to hold the exat value of size val_len.
Return
Length rounded up by 4
-
__u16
nvmf_exat_size(size_t val_len)¶ Return min aligned size to hold value
Parameters
size_t val_lenThis is the length of the data to be copied to the “exatval” field of a “struct nvmf_ext_attr”.
Description
Return the size of the “struct nvmf_ext_attr” needed to hold a value of size val_len.
Return
The size in bytes, rounded to a multiple of 4 (i.e. size of __u32), of the “struct nvmf_ext_attr” required to hold a string of length val_len.
-
struct nvmf_ext_attr *
nvmf_exat_ptr_next(struct nvmf_ext_attr *p)¶ Increment p to the next element in the array.
Parameters
struct nvmf_ext_attr *pPointer to an element of an array of “struct nvmf_ext_attr”.
Description
Extended attributes are saved to an array of “struct nvmf_ext_attr” where each element of the array is of variable size. In order to move to the next element in the array one must increment the pointer to the current element (p) by the size of the current element.
Return
Pointer to the next element in the array.
-
enum
nvme_version¶ Selector for version to be returned by nvme_get_version
Constants
NVME_VERSION_PROJECTProject release version
NVME_VERSION_GITGit reference
-
const char *
nvme_get_version(enum nvme_version type)¶ Return version libnvme string
Parameters
enum nvme_version typeSelects which version type (see struct nvme_version)
Return
Returns version string for known types or else “n/a”
-
int
nvme_uuid_to_string(unsigned char uuid[NVME_UUID_LEN], char *str)¶ Return string represenation of encoded UUID
Parameters
unsigned char uuid[NVME_UUID_LEN]Binary encoded input UUID
char *strOutput string represenation of UUID
Return
Returns error code if type conversion fails.
-
int
nvme_uuid_from_string(const char *str, unsigned char uuid[NVME_UUID_LEN])¶ Return encoded UUID represenation of string UUID
Parameters
const char *strOutput string represenation of UUID
unsigned char uuid[NVME_UUID_LEN]Binary encoded input UUID
Return
Returns error code if type conversion fails.
-
int
nvme_uuid_random(unsigned char uuid[NVME_UUID_LEN])¶ Generate random UUID
Parameters
unsigned char uuid[NVME_UUID_LEN]Generated random UUID
Description
Generate random number according https://www.rfc-editor.org/rfc/rfc4122#section-4.4
Return
Returns error code if generating of random number fails.
-
bool
nvme_ipaddrs_eq(const char *addr1, const char *addr2)¶ Check if 2 IP addresses are equal.
Parameters
const char *addr1IP address (can be IPv4 or IPv6)
const char *addr2IP address (can be IPv4 or IPv6)
Return
true if addr1 == addr2. false otherwise.
-
const char *
nvme_iface_matching_addr(const struct ifaddrs *iface_list, const char *addr)¶ Get interface matching addr
Parameters
const struct ifaddrs *iface_listInterface list returned by getifaddrs()
const char *addrAddress to match
Description
Parse the interface list pointed to by iface_list looking for the interface that has addr as one of its assigned addresses.
Return
The name of the interface that owns addr or NULL.
-
bool
nvme_iface_primary_addr_matches(const struct ifaddrs *iface_list, const char *iface, const char *addr)¶ Check that interface’s primary address matches
Parameters
const struct ifaddrs *iface_listInterface list returned by getifaddrs()
const char *ifaceInterface to match
const char *addrAddress to match
Description
Parse the interface list pointed to by iface_list and looking for interface iface. The get its primary address and check if it matches addr.
Return
true if a match is found, false otherwise.
log.h
logging functions
-
void
nvme_init_logging(nvme_root_t r, int lvl, bool log_pid, bool log_tstamp)¶ Initialize logging
Parameters
nvme_root_t rnvme_root_t context
int lvlLogging level to set
bool log_pidBoolean to enable logging of the PID
bool log_tstampBoolean to enable logging of the timestamp
Description
Sets the default logging variables for the library.
-
void
nvme_set_root(nvme_root_t r)¶ Set nvme_root_t context
Parameters
nvme_root_t rnvme_root_t context
Description
In order to be able to log from code paths where no root object is passed in via the arguments use the the default one which can be set via this call. When creating a new root object with nvme_create_root the global root object will be set as well. This means the global root object is always pointing to the latest created root object. Note the first nvme_free_tree call will reset the global root object.