Loading include/spdk/nvmf_spec.h +105 −30 Original line number Diff line number Diff line Loading @@ -81,28 +81,38 @@ enum spdk_nvmf_fabric_cmd_status_code { /** * RDMA Queue Pair service types */ enum spdk_nvmf_rdma_qp_service_types { enum spdk_nvmf_rdma_qptype { /** Reliable connected */ SPDK_NVMF_QP_TYPE_RELIABLE_CONNECTED = 0x1, SPDK_NVMF_RDMA_QPTYPE_RELIABLE_CONNECTED = 0x1, /** Reliable datagram */ SPDK_NVMF_OQ_TYPE_RELIABLE_DATAGRAM = 0x2, SPDK_NVMF_RDMA_QPTYPE_RELIABLE_DATAGRAM = 0x2, }; /** * RDMA provider types */ enum spdk_nvmf_rdma_provider_types { SPDK_NVMF_RDMA_NO_PROVIDER = 0x1, enum spdk_nvmf_rdma_prtype { /** No provider specified */ SPDK_NVMF_RDMA_PRTYPE_NONE = 0x1, /** InfiniBand */ SPDK_NVMF_RDMA_PRTYPE_IB = 0x2, /** RoCE v1 */ SPDK_NVMF_RDMA_PRTYPE_ROCE = 0x3, /** RoCE v2 */ SPDK_NVMF_RDMA_PRTYPE_ROCE2 = 0x4, /** iWARP */ SPDK_NVMF_RDMA_PRTYPE_IWARP = 0x5, }; /** * RDMA connection management service types */ enum spdk_nvmf_rdma_connection_mgmt_service { enum spdk_nvmf_rdma_cms { /** Sockets based endpoint addressing */ SPDK_NVMF_RDMA_CMS_RDMA_CM = 0x1, }; Loading @@ -110,40 +120,60 @@ enum spdk_nvmf_rdma_connection_mgmt_service { /** * NVMe over Fabrics transport types */ enum spdk_nvmf_transport_types { SPDK_NVMF_TRANS_RDMA = 0x1, SPDK_NVMF_TRANS_FC = 0x2, SPDK_NVMF_TRANS_INTRA_HOST = 0xfe, enum spdk_nvmf_trtype { /** RDMA */ SPDK_NVMF_TRTYPE_RDMA = 0x1, /** Fibre Channel */ SPDK_NVMF_TRTYPE_FC = 0x2, /** Intra-host transport (loopback) */ SPDK_NVMF_TRTYPE_INTRA_HOST = 0xfe, }; /** * Address family types */ enum spdk_nvmf_address_family_types { SPDK_NVMF_ADDR_FAMILY_IPV4 = 0x1, SPDK_NVMF_ADDR_FAMILY_IPV6 = 0x2, SPDK_NVMF_ADDR_FAMILY_IB = 0x3, SPDK_NVMF_ADDR_FAMILY_FC = 0x4, SPDK_NVMF_ADDR_FAMILY_INTRA_HOST = 0xfe, enum spdk_nvmf_adrfam { /** IPv4 (AF_INET) */ SPDK_NVMF_ADRFAM_IPV4 = 0x1, /** IPv6 (AF_INET6) */ SPDK_NVMF_ADRFAM_IPV6 = 0x2, /** InfiniBand (AF_IB) */ SPDK_NVMF_ADRFAM_IB = 0x3, /** Fibre Channel address family */ SPDK_NVMF_ADRFAM_FC = 0x4, /** Intra-host transport (loopback) */ SPDK_NVMF_ADRFAM_INTRA_HOST = 0xfe, }; /** * NVM subsystem types */ enum spdk_nvmf_subsystem_types { enum spdk_nvmf_subtype { /** Discovery type for NVM subsystem */ SPDK_NVMF_SUB_DISCOVERY = 0x1, SPDK_NVMF_SUBTYPE_DISCOVERY = 0x1, /** NVMe type for NVM subsystem */ SPDK_NVMF_SUB_NVME = 0x2, SPDK_NVMF_SUBTYPE_NVME = 0x2, }; /** * Connections shall be made over a fabric secure channel */ enum spdk_nvmf_transport_requirements { SPDK_NVMF_TREQ_NOT_SPECIFIED = 0x0, SPDK_NVMF_TREQ_REQUIRED = 0x1, SPDK_NVMF_TREQ_NOT_REQUIRED = 0x2, enum spdk_nvmf_treq_secure_channel { /** Not specified */ SPDK_NVMF_TREQ_SECURE_CHANNEL_NOT_SPECIFIED = 0x0, /** Required */ SPDK_NVMF_TREQ_SECURE_CHANNEL_REQUIRED = 0x1, /** Not required */ SPDK_NVMF_TREQ_SECURE_CHANNEL_NOT_REQUIRED = 0x2, }; struct spdk_nvmf_fabric_auth_recv_cmd { Loading Loading @@ -353,36 +383,81 @@ struct spdk_nvmf_discovery_identify_data { }; SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_discovery_identify_data) == 4096, "Incorrect size"); /** RDMA transport-specific address subtype */ struct spdk_nvmf_rdma_transport_specific_address_subtype { uint8_t rdma_qptype; /* see spdk_nvmf_rdma_qp_service_types */ uint8_t rdma_prtype; /* see spdk_nvmf_rdma_provider_types */ uint8_t rdma_cms; /* see spdk_nvmf_rdma_connection_mgmt_service */ /** RDMA QP service type (\ref spdk_nvmf_rdma_qptype) */ uint8_t rdma_qptype; /** RDMA provider type (\ref spdk_nvmf_rdma_prtype) */ uint8_t rdma_prtype; /** RDMA connection management service (\ref spdk_nvmf_rdma_cms) */ uint8_t rdma_cms; uint8_t reserved0[5]; /** RDMA partition key for AF_IB */ uint16_t rdma_pkey; uint8_t reserved2[246]; }; SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_rdma_transport_specific_address_subtype) == 256, "Incorrect size"); /** Transport-specific address subtype */ union spdk_nvmf_transport_specific_address_subtype { uint8_t raw[256]; /** RDMA */ struct spdk_nvmf_rdma_transport_specific_address_subtype rdma; }; SPDK_STATIC_ASSERT(sizeof(union spdk_nvmf_transport_specific_address_subtype) == 256, "Incorrect size"); /** * Discovery Log Page entry */ struct spdk_nvmf_discovery_log_page_entry { uint8_t trtype; /* transport type */ uint8_t adrfam; /* address family */ /** Transport type (\ref spdk_nvmf_trtype) */ uint8_t trtype; /** Address family (\ref spdk_nvmf_adrfam) */ uint8_t adrfam; /** Subsystem type (\ref spdk_nvmf_subtype) */ uint8_t subtype; uint8_t treq; /** Transport requirements */ struct { /** Secure channel requirements (\ref spdk_nvmf_treq_secure_channel) */ uint8_t secure_channel : 2; uint8_t reserved : 6; } treq; /** NVM subsystem port ID */ uint16_t portid; /** Controller ID */ uint16_t cntlid; uint8_t reserved0[24]; /** Admin max SQ size */ uint16_t asqsz; uint8_t reserved0[22]; /** Transport service identifier */ uint8_t trsvcid[32]; uint8_t reserved1[192]; /** NVM subsystem qualified name */ uint8_t subnqn[256]; /** Transport address */ uint8_t traddr[256]; /** Transport-specific address subtype */ union spdk_nvmf_transport_specific_address_subtype tsas; }; SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_discovery_log_page_entry) == 1024, "Incorrect size"); Loading lib/nvmf/conf.c +1 −1 Original line number Diff line number Diff line Loading @@ -336,7 +336,7 @@ spdk_nvmf_parse_subsystem(struct spdk_conf_section *sp) } lcore = spdk_nvmf_allocate_lcore(mask, lcore); subsystem = nvmf_create_subsystem(sp->num, nqn, SPDK_NVMF_SUB_NVME, lcore); subsystem = nvmf_create_subsystem(sp->num, nqn, SPDK_NVMF_SUBTYPE_NVME, lcore); if (subsystem == NULL) { return -1; } Loading lib/nvmf/rdma.c +5 −5 Original line number Diff line number Diff line Loading @@ -1151,15 +1151,15 @@ static void nvmf_rdma_discover(struct spdk_nvmf_listen_addr *listen_addr, struct spdk_nvmf_discovery_log_page_entry *entry) { entry->trtype = SPDK_NVMF_TRANS_RDMA; entry->adrfam = SPDK_NVMF_ADDR_FAMILY_IPV4; entry->treq = SPDK_NVMF_TREQ_NOT_SPECIFIED; entry->trtype = SPDK_NVMF_TRTYPE_RDMA; entry->adrfam = SPDK_NVMF_ADRFAM_IPV4; entry->treq.secure_channel = SPDK_NVMF_TREQ_SECURE_CHANNEL_NOT_SPECIFIED; snprintf(entry->trsvcid, sizeof(entry->trsvcid), "%s", listen_addr->trsvc); snprintf(entry->traddr, sizeof(entry->traddr), "%s", listen_addr->traddr); entry->tsas.rdma.rdma_qptype = SPDK_NVMF_QP_TYPE_RELIABLE_CONNECTED; entry->tsas.rdma.rdma_prtype = SPDK_NVMF_RDMA_NO_PROVIDER; entry->tsas.rdma.rdma_qptype = SPDK_NVMF_RDMA_QPTYPE_RELIABLE_CONNECTED; entry->tsas.rdma.rdma_prtype = SPDK_NVMF_RDMA_PRTYPE_NONE; entry->tsas.rdma.rdma_cms = SPDK_NVMF_RDMA_CMS_RDMA_CM; } Loading lib/nvmf/request.c +1 −1 Original line number Diff line number Diff line Loading @@ -649,7 +649,7 @@ spdk_nvmf_request_exec(struct spdk_nvmf_request *req) RTE_VERIFY(session != NULL); subsystem = session->subsys; RTE_VERIFY(subsystem != NULL); if (subsystem->subtype == SPDK_NVMF_SUB_DISCOVERY) { if (subsystem->subtype == SPDK_NVMF_SUBTYPE_DISCOVERY) { done = nvmf_process_discovery_cmd(req); } else { done = nvmf_process_admin_cmd(req); Loading lib/nvmf/session.c +1 −1 Original line number Diff line number Diff line Loading @@ -248,7 +248,7 @@ spdk_nvmf_session_connect(struct spdk_nvmf_conn *conn, session->subsys = subsystem; session->max_connections_allowed = g_nvmf_tgt.MaxConnectionsPerSession; if (subsystem->subtype == SPDK_NVMF_SUB_NVME) { if (subsystem->subtype == SPDK_NVMF_SUBTYPE_NVME) { nvmf_init_nvme_session_properties(session); } else { nvmf_init_discovery_session_properties(session); Loading Loading
include/spdk/nvmf_spec.h +105 −30 Original line number Diff line number Diff line Loading @@ -81,28 +81,38 @@ enum spdk_nvmf_fabric_cmd_status_code { /** * RDMA Queue Pair service types */ enum spdk_nvmf_rdma_qp_service_types { enum spdk_nvmf_rdma_qptype { /** Reliable connected */ SPDK_NVMF_QP_TYPE_RELIABLE_CONNECTED = 0x1, SPDK_NVMF_RDMA_QPTYPE_RELIABLE_CONNECTED = 0x1, /** Reliable datagram */ SPDK_NVMF_OQ_TYPE_RELIABLE_DATAGRAM = 0x2, SPDK_NVMF_RDMA_QPTYPE_RELIABLE_DATAGRAM = 0x2, }; /** * RDMA provider types */ enum spdk_nvmf_rdma_provider_types { SPDK_NVMF_RDMA_NO_PROVIDER = 0x1, enum spdk_nvmf_rdma_prtype { /** No provider specified */ SPDK_NVMF_RDMA_PRTYPE_NONE = 0x1, /** InfiniBand */ SPDK_NVMF_RDMA_PRTYPE_IB = 0x2, /** RoCE v1 */ SPDK_NVMF_RDMA_PRTYPE_ROCE = 0x3, /** RoCE v2 */ SPDK_NVMF_RDMA_PRTYPE_ROCE2 = 0x4, /** iWARP */ SPDK_NVMF_RDMA_PRTYPE_IWARP = 0x5, }; /** * RDMA connection management service types */ enum spdk_nvmf_rdma_connection_mgmt_service { enum spdk_nvmf_rdma_cms { /** Sockets based endpoint addressing */ SPDK_NVMF_RDMA_CMS_RDMA_CM = 0x1, }; Loading @@ -110,40 +120,60 @@ enum spdk_nvmf_rdma_connection_mgmt_service { /** * NVMe over Fabrics transport types */ enum spdk_nvmf_transport_types { SPDK_NVMF_TRANS_RDMA = 0x1, SPDK_NVMF_TRANS_FC = 0x2, SPDK_NVMF_TRANS_INTRA_HOST = 0xfe, enum spdk_nvmf_trtype { /** RDMA */ SPDK_NVMF_TRTYPE_RDMA = 0x1, /** Fibre Channel */ SPDK_NVMF_TRTYPE_FC = 0x2, /** Intra-host transport (loopback) */ SPDK_NVMF_TRTYPE_INTRA_HOST = 0xfe, }; /** * Address family types */ enum spdk_nvmf_address_family_types { SPDK_NVMF_ADDR_FAMILY_IPV4 = 0x1, SPDK_NVMF_ADDR_FAMILY_IPV6 = 0x2, SPDK_NVMF_ADDR_FAMILY_IB = 0x3, SPDK_NVMF_ADDR_FAMILY_FC = 0x4, SPDK_NVMF_ADDR_FAMILY_INTRA_HOST = 0xfe, enum spdk_nvmf_adrfam { /** IPv4 (AF_INET) */ SPDK_NVMF_ADRFAM_IPV4 = 0x1, /** IPv6 (AF_INET6) */ SPDK_NVMF_ADRFAM_IPV6 = 0x2, /** InfiniBand (AF_IB) */ SPDK_NVMF_ADRFAM_IB = 0x3, /** Fibre Channel address family */ SPDK_NVMF_ADRFAM_FC = 0x4, /** Intra-host transport (loopback) */ SPDK_NVMF_ADRFAM_INTRA_HOST = 0xfe, }; /** * NVM subsystem types */ enum spdk_nvmf_subsystem_types { enum spdk_nvmf_subtype { /** Discovery type for NVM subsystem */ SPDK_NVMF_SUB_DISCOVERY = 0x1, SPDK_NVMF_SUBTYPE_DISCOVERY = 0x1, /** NVMe type for NVM subsystem */ SPDK_NVMF_SUB_NVME = 0x2, SPDK_NVMF_SUBTYPE_NVME = 0x2, }; /** * Connections shall be made over a fabric secure channel */ enum spdk_nvmf_transport_requirements { SPDK_NVMF_TREQ_NOT_SPECIFIED = 0x0, SPDK_NVMF_TREQ_REQUIRED = 0x1, SPDK_NVMF_TREQ_NOT_REQUIRED = 0x2, enum spdk_nvmf_treq_secure_channel { /** Not specified */ SPDK_NVMF_TREQ_SECURE_CHANNEL_NOT_SPECIFIED = 0x0, /** Required */ SPDK_NVMF_TREQ_SECURE_CHANNEL_REQUIRED = 0x1, /** Not required */ SPDK_NVMF_TREQ_SECURE_CHANNEL_NOT_REQUIRED = 0x2, }; struct spdk_nvmf_fabric_auth_recv_cmd { Loading Loading @@ -353,36 +383,81 @@ struct spdk_nvmf_discovery_identify_data { }; SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_discovery_identify_data) == 4096, "Incorrect size"); /** RDMA transport-specific address subtype */ struct spdk_nvmf_rdma_transport_specific_address_subtype { uint8_t rdma_qptype; /* see spdk_nvmf_rdma_qp_service_types */ uint8_t rdma_prtype; /* see spdk_nvmf_rdma_provider_types */ uint8_t rdma_cms; /* see spdk_nvmf_rdma_connection_mgmt_service */ /** RDMA QP service type (\ref spdk_nvmf_rdma_qptype) */ uint8_t rdma_qptype; /** RDMA provider type (\ref spdk_nvmf_rdma_prtype) */ uint8_t rdma_prtype; /** RDMA connection management service (\ref spdk_nvmf_rdma_cms) */ uint8_t rdma_cms; uint8_t reserved0[5]; /** RDMA partition key for AF_IB */ uint16_t rdma_pkey; uint8_t reserved2[246]; }; SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_rdma_transport_specific_address_subtype) == 256, "Incorrect size"); /** Transport-specific address subtype */ union spdk_nvmf_transport_specific_address_subtype { uint8_t raw[256]; /** RDMA */ struct spdk_nvmf_rdma_transport_specific_address_subtype rdma; }; SPDK_STATIC_ASSERT(sizeof(union spdk_nvmf_transport_specific_address_subtype) == 256, "Incorrect size"); /** * Discovery Log Page entry */ struct spdk_nvmf_discovery_log_page_entry { uint8_t trtype; /* transport type */ uint8_t adrfam; /* address family */ /** Transport type (\ref spdk_nvmf_trtype) */ uint8_t trtype; /** Address family (\ref spdk_nvmf_adrfam) */ uint8_t adrfam; /** Subsystem type (\ref spdk_nvmf_subtype) */ uint8_t subtype; uint8_t treq; /** Transport requirements */ struct { /** Secure channel requirements (\ref spdk_nvmf_treq_secure_channel) */ uint8_t secure_channel : 2; uint8_t reserved : 6; } treq; /** NVM subsystem port ID */ uint16_t portid; /** Controller ID */ uint16_t cntlid; uint8_t reserved0[24]; /** Admin max SQ size */ uint16_t asqsz; uint8_t reserved0[22]; /** Transport service identifier */ uint8_t trsvcid[32]; uint8_t reserved1[192]; /** NVM subsystem qualified name */ uint8_t subnqn[256]; /** Transport address */ uint8_t traddr[256]; /** Transport-specific address subtype */ union spdk_nvmf_transport_specific_address_subtype tsas; }; SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_discovery_log_page_entry) == 1024, "Incorrect size"); Loading
lib/nvmf/conf.c +1 −1 Original line number Diff line number Diff line Loading @@ -336,7 +336,7 @@ spdk_nvmf_parse_subsystem(struct spdk_conf_section *sp) } lcore = spdk_nvmf_allocate_lcore(mask, lcore); subsystem = nvmf_create_subsystem(sp->num, nqn, SPDK_NVMF_SUB_NVME, lcore); subsystem = nvmf_create_subsystem(sp->num, nqn, SPDK_NVMF_SUBTYPE_NVME, lcore); if (subsystem == NULL) { return -1; } Loading
lib/nvmf/rdma.c +5 −5 Original line number Diff line number Diff line Loading @@ -1151,15 +1151,15 @@ static void nvmf_rdma_discover(struct spdk_nvmf_listen_addr *listen_addr, struct spdk_nvmf_discovery_log_page_entry *entry) { entry->trtype = SPDK_NVMF_TRANS_RDMA; entry->adrfam = SPDK_NVMF_ADDR_FAMILY_IPV4; entry->treq = SPDK_NVMF_TREQ_NOT_SPECIFIED; entry->trtype = SPDK_NVMF_TRTYPE_RDMA; entry->adrfam = SPDK_NVMF_ADRFAM_IPV4; entry->treq.secure_channel = SPDK_NVMF_TREQ_SECURE_CHANNEL_NOT_SPECIFIED; snprintf(entry->trsvcid, sizeof(entry->trsvcid), "%s", listen_addr->trsvc); snprintf(entry->traddr, sizeof(entry->traddr), "%s", listen_addr->traddr); entry->tsas.rdma.rdma_qptype = SPDK_NVMF_QP_TYPE_RELIABLE_CONNECTED; entry->tsas.rdma.rdma_prtype = SPDK_NVMF_RDMA_NO_PROVIDER; entry->tsas.rdma.rdma_qptype = SPDK_NVMF_RDMA_QPTYPE_RELIABLE_CONNECTED; entry->tsas.rdma.rdma_prtype = SPDK_NVMF_RDMA_PRTYPE_NONE; entry->tsas.rdma.rdma_cms = SPDK_NVMF_RDMA_CMS_RDMA_CM; } Loading
lib/nvmf/request.c +1 −1 Original line number Diff line number Diff line Loading @@ -649,7 +649,7 @@ spdk_nvmf_request_exec(struct spdk_nvmf_request *req) RTE_VERIFY(session != NULL); subsystem = session->subsys; RTE_VERIFY(subsystem != NULL); if (subsystem->subtype == SPDK_NVMF_SUB_DISCOVERY) { if (subsystem->subtype == SPDK_NVMF_SUBTYPE_DISCOVERY) { done = nvmf_process_discovery_cmd(req); } else { done = nvmf_process_admin_cmd(req); Loading
lib/nvmf/session.c +1 −1 Original line number Diff line number Diff line Loading @@ -248,7 +248,7 @@ spdk_nvmf_session_connect(struct spdk_nvmf_conn *conn, session->subsys = subsystem; session->max_connections_allowed = g_nvmf_tgt.MaxConnectionsPerSession; if (subsystem->subtype == SPDK_NVMF_SUB_NVME) { if (subsystem->subtype == SPDK_NVMF_SUBTYPE_NVME) { nvmf_init_nvme_session_properties(session); } else { nvmf_init_discovery_session_properties(session); Loading