libnvme(2)
π NAME π
okay bestie, buckle up β this is all about enum nvme_cap, aka the controller capabilities register. it's the enum that tells you which bits of the CAP register hold which secrets, and what the magic values inside those bits actually mean. it's giving β¨decoder ringβ¨ but for NVMe. this page lives in section 2 of the libnvme API manual π
πΈ SYNOPSIS πΈ
enum nvme_cap {
NVME_CAP_MQES_SHIFT ,
NVME_CAP_CQR_SHIFT ,
NVME_CAP_AMS_SHIFT ,
NVME_CAP_TO_SHIFT ,
NVME_CAP_DSTRD_SHIFT ,
NVME_CAP_NSSRC_SHIFT ,
NVME_CAP_CSS_SHIFT ,
NVME_CAP_BPS_SHIFT ,
NVME_CAP_CPS_SHIFT ,
NVME_CAP_MPSMIN_SHIFT ,
NVME_CAP_MPSMAX_SHIFT ,
NVME_CAP_PMRS_SHIFT ,
NVME_CAP_CMBS_SHIFT ,
NVME_CAP_NSSS_SHIFT ,
NVME_CAP_CRMS_SHIFT ,
NVME_CAP_MQES_MASK ,
NVME_CAP_CQR_MASK ,
NVME_CAP_AMS_MASK ,
NVME_CAP_TO_MASK ,
NVME_CAP_DSTRD_MASK ,
NVME_CAP_NSSRC_MASK ,
NVME_CAP_CSS_MASK ,
NVME_CAP_BPS_MASK ,
NVME_CAP_CPS_MASK ,
NVME_CAP_MPSMIN_MASK ,
NVME_CAP_MPSMAX_MASK ,
NVME_CAP_PMRS_MASK ,
NVME_CAP_CMBS_MASK ,
NVME_CAP_NSSS_MASK ,
NVME_CAP_CRMS_MASK ,
NVME_CAP_AMS_WRR ,
NVME_CAP_AMS_VS ,
NVME_CAP_CSS_NVM ,
NVME_CAP_CSS_CSI ,
NVME_CAP_CSS_ADMIN ,
NVME_CAP_CPS_NONE ,
NVME_CAP_CPS_CTRL ,
NVME_CAP_CPS_DOMAIN ,
NVME_CAP_CPS_NVMS ,
NVME_CAP_CRWMS ,
NVME_CAP_CRIMS
};
β¨ Constants β¨
so like, these come in three flavors: shifts (how far to slide over to find your field), masks (what's left once you've slid), and actual values (what the field is tryna tell you). every single one is below, no skips, no cuts π
π Shift amounts
NVME_CAP_MQES_SHIFTβ the shift amount that gets you the maximum queue entries supportedNVME_CAP_CQR_SHIFTβ the shift amount that gets you the contiguous queues requiredNVME_CAP_AMS_SHIFTβ the shift amount that gets you the arbitration mechanism supportedNVME_CAP_TO_SHIFTβ the shift amount that gets you the timeoutNVME_CAP_DSTRD_SHIFTβ the shift amount that gets you the doorbell strideNVME_CAP_NSSRC_SHIFTβ the shift amount that gets you the NVM subsystem reset supportedNVME_CAP_CSS_SHIFTβ the shift amount that gets you the command sets supportedNVME_CAP_BPS_SHIFTβ the shift amount that gets you the boot partition supportNVME_CAP_CPS_SHIFTβ the shift amount that gets you the controller power scopeNVME_CAP_MPSMIN_SHIFTβ the shift amount that gets you the memory page size minimumNVME_CAP_MPSMAX_SHIFTβ the shift amount that gets you the memory page size maximumNVME_CAP_PMRS_SHIFTβ the shift amount that gets you the persistent memory region supportedNVME_CAP_CMBS_SHIFTβ the shift amount that gets you the controller memory buffer supportedNVME_CAP_NSSS_SHIFTβ the shift amount that gets you the NVM subsystem shutdown supportedNVME_CAP_CRMS_SHIFTβ the shift amount that gets you the controller ready modes supported
π Masks
NVME_CAP_MQES_MASKβ the mask that gets you the maximum queue entries supportedNVME_CAP_CQR_MASKβ the mask that gets you the contiguous queues requiredNVME_CAP_AMS_MASKβ the mask that gets you the arbitration mechanism supportedNVME_CAP_TO_MASKβ the mask that gets you the timeoutNVME_CAP_DSTRD_MASKβ the mask that gets you the doorbell strideNVME_CAP_NSSRC_MASKβ the mask that gets you the NVM subsystem reset supportedNVME_CAP_CSS_MASKβ the mask that gets you the command sets supportedNVME_CAP_BPS_MASKβ the mask that gets you the boot partition supportNVME_CAP_CPS_MASKβ the mask that gets you the controller power scopeNVME_CAP_MPSMIN_MASKβ the mask that gets you the memory page size minimumNVME_CAP_MPSMAX_MASKβ the mask that gets you the memory page size maximumNVME_CAP_PMRS_MASKβ the mask that gets you the persistent memory region supportedNVME_CAP_CMBS_MASKβ the mask that gets you the controller memory buffer supportedNVME_CAP_NSSS_MASKβ the mask that gets you the NVM subsystem shutdown supportedNVME_CAP_CRMS_MASKβ the mask that gets you the controller ready modes supported
π Actual values
NVME_CAP_AMS_WRRβ weighted round robin with urgent priority class πNVME_CAP_AMS_VSβ vendor specific (iykyk, it's theirs, not ours π)NVME_CAP_CSS_NVMβ NVM command set or a discovery controllerNVME_CAP_CSS_CSIβ the controller supports one or more I/O command setsNVME_CAP_CSS_ADMINβ no I/O command set is supportedNVME_CAP_CPS_NONEβ not reported, the mystery era πNVME_CAP_CPS_CTRLβ controller scopeNVME_CAP_CPS_DOMAINβ domain scopeNVME_CAP_CPS_NVMSβ NVM subsystem scopeNVME_CAP_CRWMSβ controller ready with media supportNVME_CAP_CRIMSβ controller ready independent of media support
fr fr bestie, nothing here is optional homework β shifts get you the field, masks carve it out, values tell you what it says. no cap. π«Ά
that's the whole page, bestie β no crumbs left, we ate π source/version is the libnvme API manual, page enum nvme_cap from section 2, and it's stamped July 2026. periodt. π
β¨
π¦ where this page comes from
- ubuntu stonking: libnvme-dev 1.16.2-1build1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms