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 supported
  • NVME_CAP_CQR_SHIFT β€” the shift amount that gets you the contiguous queues required
  • NVME_CAP_AMS_SHIFT β€” the shift amount that gets you the arbitration mechanism supported
  • NVME_CAP_TO_SHIFT β€” the shift amount that gets you the timeout
  • NVME_CAP_DSTRD_SHIFT β€” the shift amount that gets you the doorbell stride
  • NVME_CAP_NSSRC_SHIFT β€” the shift amount that gets you the NVM subsystem reset supported
  • NVME_CAP_CSS_SHIFT β€” the shift amount that gets you the command sets supported
  • NVME_CAP_BPS_SHIFT β€” the shift amount that gets you the boot partition support
  • NVME_CAP_CPS_SHIFT β€” the shift amount that gets you the controller power scope
  • NVME_CAP_MPSMIN_SHIFT β€” the shift amount that gets you the memory page size minimum
  • NVME_CAP_MPSMAX_SHIFT β€” the shift amount that gets you the memory page size maximum
  • NVME_CAP_PMRS_SHIFT β€” the shift amount that gets you the persistent memory region supported
  • NVME_CAP_CMBS_SHIFT β€” the shift amount that gets you the controller memory buffer supported
  • NVME_CAP_NSSS_SHIFT β€” the shift amount that gets you the NVM subsystem shutdown supported
  • NVME_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 supported
  • NVME_CAP_CQR_MASK β€” the mask that gets you the contiguous queues required
  • NVME_CAP_AMS_MASK β€” the mask that gets you the arbitration mechanism supported
  • NVME_CAP_TO_MASK β€” the mask that gets you the timeout
  • NVME_CAP_DSTRD_MASK β€” the mask that gets you the doorbell stride
  • NVME_CAP_NSSRC_MASK β€” the mask that gets you the NVM subsystem reset supported
  • NVME_CAP_CSS_MASK β€” the mask that gets you the command sets supported
  • NVME_CAP_BPS_MASK β€” the mask that gets you the boot partition support
  • NVME_CAP_CPS_MASK β€” the mask that gets you the controller power scope
  • NVME_CAP_MPSMIN_MASK β€” the mask that gets you the memory page size minimum
  • NVME_CAP_MPSMAX_MASK β€” the mask that gets you the memory page size maximum
  • NVME_CAP_PMRS_MASK β€” the mask that gets you the persistent memory region supported
  • NVME_CAP_CMBS_MASK β€” the mask that gets you the controller memory buffer supported
  • NVME_CAP_NSSS_MASK β€” the mask that gets you the NVM subsystem shutdown supported
  • NVME_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 controller
  • NVME_CAP_CSS_CSI β€” the controller supports one or more I/O command sets
  • NVME_CAP_CSS_ADMIN β€” no I/O command set is supported
  • NVME_CAP_CPS_NONE β€” not reported, the mystery era πŸ’€
  • NVME_CAP_CPS_CTRL β€” controller scope
  • NVME_CAP_CPS_DOMAIN β€” domain scope
  • NVME_CAP_CPS_NVMS β€” NVM subsystem scope
  • NVME_CAP_CRWMS β€” controller ready with media support
  • NVME_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