SPDKソース解析(構造体)

投稿者: | 2022年9月24日

spdk_nvmf_registers

fabricデバイス用のregister。

  • cap_register (capability?)
  • vs_register(version)
  • cc_register
/**
 * A subset of struct spdk_nvme_registers that are emulated by a fabrics device.
 */
struct spdk_nvmf_registers {
    union spdk_nvme_cap_register    cap;
    union spdk_nvme_vs_register vs;
    union spdk_nvme_cc_register cc;
    union spdk_nvme_csts_register   csts;
    union spdk_nvme_aqa_register    aqa;
    uint64_t            asq;
    uint64_t            acq;
};

spdk_nvme_vs_register

versionのための構造体。nvmf_ctrlr_createで、1.3とされる。

union spdk_nvme_vs_register {
    uint32_t    raw;
    struct {
        /** indicates the tertiary version */
        uint32_t ter        : 8;
        /** indicates the minor version */
        uint32_t mnr        : 8;
        /** indicates the major version */
        uint32_t mjr        : 16;
    } bits;
};
SPDK_STATIC_ASSERT(sizeof(union spdk_nvme_vs_register) == 4, "Incorrect size");

spdk_nvme_cc_register

};

#define SPDK_NVME_CAP_CSS_NVM (1u << SPDK_NVME_CC_CSS_NVM) /**< NVM command set supported */
#define SPDK_NVME_CAP_CSS_IOCS (1u << SPDK_NVME_CC_CSS_IOCS) /**< One or more I/O Command sets supported */
#define SPDK_NVME_CAP_CSS_NOIO (1u << SPDK_NVME_CC_CSS_NOIO) /**< No I/O, only admin */

union spdk_nvme_cc_register {
    uint32_t    raw;
    struct {
        /** enable */
        uint32_t en     : 1;

        uint32_t reserved1  : 3;

        /** i/o command set selected */
        uint32_t css        : 3;

        /** memory page size */
        uint32_t mps        : 4;

        /** arbitration mechanism selected */
        uint32_t ams        : 3;

        /** shutdown notification */
        uint32_t shn        : 2;

        /** i/o submission queue entry size */
        uint32_t iosqes     : 4;

        /** i/o completion queue entry size */

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です