nvmf: add Doxygen comments to discovery log page

Also add the missing ASQSZ field.

Change-Id: I67e67a6b4076de226d30882aa40afd78bc8be2af
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Daniel Verkamp 2016-07-15 13:10:33 -07:00
parent 677a2dc5d7
commit 70601d5e0e
7 changed files with 120 additions and 45 deletions

View File

@ -81,28 +81,38 @@ enum spdk_nvmf_fabric_cmd_status_code {
/** /**
* RDMA Queue Pair service types * RDMA Queue Pair service types
*/ */
enum spdk_nvmf_rdma_qp_service_types { enum spdk_nvmf_rdma_qptype {
/** Reliable connected */ /** Reliable connected */
SPDK_NVMF_QP_TYPE_RELIABLE_CONNECTED = 0x1, SPDK_NVMF_RDMA_QPTYPE_RELIABLE_CONNECTED = 0x1,
/** Reliable datagram */ /** Reliable datagram */
SPDK_NVMF_OQ_TYPE_RELIABLE_DATAGRAM = 0x2, SPDK_NVMF_RDMA_QPTYPE_RELIABLE_DATAGRAM = 0x2,
}; };
/** /**
* RDMA provider types * RDMA provider types
*/ */
enum spdk_nvmf_rdma_provider_types { enum spdk_nvmf_rdma_prtype {
SPDK_NVMF_RDMA_NO_PROVIDER = 0x1, /** No provider specified */
SPDK_NVMF_RDMA_PRTYPE_NONE = 0x1,
/** InfiniBand */
SPDK_NVMF_RDMA_PRTYPE_IB = 0x2, SPDK_NVMF_RDMA_PRTYPE_IB = 0x2,
/** RoCE v1 */
SPDK_NVMF_RDMA_PRTYPE_ROCE = 0x3, SPDK_NVMF_RDMA_PRTYPE_ROCE = 0x3,
/** RoCE v2 */
SPDK_NVMF_RDMA_PRTYPE_ROCE2 = 0x4, SPDK_NVMF_RDMA_PRTYPE_ROCE2 = 0x4,
/** iWARP */
SPDK_NVMF_RDMA_PRTYPE_IWARP = 0x5, SPDK_NVMF_RDMA_PRTYPE_IWARP = 0x5,
}; };
/** /**
* RDMA connection management service types * RDMA connection management service types
*/ */
enum spdk_nvmf_rdma_connection_mgmt_service { enum spdk_nvmf_rdma_cms {
/** Sockets based endpoint addressing */ /** Sockets based endpoint addressing */
SPDK_NVMF_RDMA_CMS_RDMA_CM = 0x1, SPDK_NVMF_RDMA_CMS_RDMA_CM = 0x1,
}; };
@ -110,40 +120,60 @@ enum spdk_nvmf_rdma_connection_mgmt_service {
/** /**
* NVMe over Fabrics transport types * NVMe over Fabrics transport types
*/ */
enum spdk_nvmf_transport_types { enum spdk_nvmf_trtype {
SPDK_NVMF_TRANS_RDMA = 0x1, /** RDMA */
SPDK_NVMF_TRANS_FC = 0x2, SPDK_NVMF_TRTYPE_RDMA = 0x1,
SPDK_NVMF_TRANS_INTRA_HOST = 0xfe,
/** Fibre Channel */
SPDK_NVMF_TRTYPE_FC = 0x2,
/** Intra-host transport (loopback) */
SPDK_NVMF_TRTYPE_INTRA_HOST = 0xfe,
}; };
/** /**
* Address family types * Address family types
*/ */
enum spdk_nvmf_address_family_types { enum spdk_nvmf_adrfam {
SPDK_NVMF_ADDR_FAMILY_IPV4 = 0x1, /** IPv4 (AF_INET) */
SPDK_NVMF_ADDR_FAMILY_IPV6 = 0x2, SPDK_NVMF_ADRFAM_IPV4 = 0x1,
SPDK_NVMF_ADDR_FAMILY_IB = 0x3,
SPDK_NVMF_ADDR_FAMILY_FC = 0x4, /** IPv6 (AF_INET6) */
SPDK_NVMF_ADDR_FAMILY_INTRA_HOST = 0xfe, 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 * NVM subsystem types
*/ */
enum spdk_nvmf_subsystem_types { enum spdk_nvmf_subtype {
/** Discovery type for NVM subsystem */ /** Discovery type for NVM subsystem */
SPDK_NVMF_SUB_DISCOVERY = 0x1, SPDK_NVMF_SUBTYPE_DISCOVERY = 0x1,
/** NVMe type for NVM subsystem */ /** NVMe type for NVM subsystem */
SPDK_NVMF_SUB_NVME = 0x2, SPDK_NVMF_SUBTYPE_NVME = 0x2,
}; };
/** /**
* Connections shall be made over a fabric secure channel * Connections shall be made over a fabric secure channel
*/ */
enum spdk_nvmf_transport_requirements { enum spdk_nvmf_treq_secure_channel {
SPDK_NVMF_TREQ_NOT_SPECIFIED = 0x0, /** Not specified */
SPDK_NVMF_TREQ_REQUIRED = 0x1, SPDK_NVMF_TREQ_SECURE_CHANNEL_NOT_SPECIFIED = 0x0,
SPDK_NVMF_TREQ_NOT_REQUIRED = 0x2,
/** 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 { struct spdk_nvmf_fabric_auth_recv_cmd {
@ -353,36 +383,81 @@ struct spdk_nvmf_discovery_identify_data {
}; };
SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_discovery_identify_data) == 4096, "Incorrect size"); 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 { struct spdk_nvmf_rdma_transport_specific_address_subtype {
uint8_t rdma_qptype; /* see spdk_nvmf_rdma_qp_service_types */ /** RDMA QP service type (\ref spdk_nvmf_rdma_qptype) */
uint8_t rdma_prtype; /* see spdk_nvmf_rdma_provider_types */ uint8_t rdma_qptype;
uint8_t rdma_cms; /* see spdk_nvmf_rdma_connection_mgmt_service */
/** 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]; uint8_t reserved0[5];
/** RDMA partition key for AF_IB */
uint16_t rdma_pkey; uint16_t rdma_pkey;
uint8_t reserved2[246]; uint8_t reserved2[246];
}; };
SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_rdma_transport_specific_address_subtype) == 256, SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_rdma_transport_specific_address_subtype) == 256,
"Incorrect size"); "Incorrect size");
/** Transport-specific address subtype */
union spdk_nvmf_transport_specific_address_subtype { union spdk_nvmf_transport_specific_address_subtype {
uint8_t raw[256]; uint8_t raw[256];
/** RDMA */
struct spdk_nvmf_rdma_transport_specific_address_subtype rdma; struct spdk_nvmf_rdma_transport_specific_address_subtype rdma;
}; };
SPDK_STATIC_ASSERT(sizeof(union spdk_nvmf_transport_specific_address_subtype) == 256, SPDK_STATIC_ASSERT(sizeof(union spdk_nvmf_transport_specific_address_subtype) == 256,
"Incorrect size"); "Incorrect size");
/**
* Discovery Log Page entry
*/
struct spdk_nvmf_discovery_log_page_entry { struct spdk_nvmf_discovery_log_page_entry {
uint8_t trtype; /* transport type */ /** Transport type (\ref spdk_nvmf_trtype) */
uint8_t adrfam; /* address family */ uint8_t trtype;
/** Address family (\ref spdk_nvmf_adrfam) */
uint8_t adrfam;
/** Subsystem type (\ref spdk_nvmf_subtype) */
uint8_t 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; uint16_t portid;
/** Controller ID */
uint16_t cntlid; 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 trsvcid[32];
uint8_t reserved1[192]; uint8_t reserved1[192];
/** NVM subsystem qualified name */
uint8_t subnqn[256]; uint8_t subnqn[256];
/** Transport address */
uint8_t traddr[256]; uint8_t traddr[256];
/** Transport-specific address subtype */
union spdk_nvmf_transport_specific_address_subtype tsas; union spdk_nvmf_transport_specific_address_subtype tsas;
}; };
SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_discovery_log_page_entry) == 1024, "Incorrect size"); SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_discovery_log_page_entry) == 1024, "Incorrect size");

View File

@ -336,7 +336,7 @@ spdk_nvmf_parse_subsystem(struct spdk_conf_section *sp)
} }
lcore = spdk_nvmf_allocate_lcore(mask, lcore); 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) { if (subsystem == NULL) {
return -1; return -1;
} }

View File

@ -1151,15 +1151,15 @@ static void
nvmf_rdma_discover(struct spdk_nvmf_listen_addr *listen_addr, nvmf_rdma_discover(struct spdk_nvmf_listen_addr *listen_addr,
struct spdk_nvmf_discovery_log_page_entry *entry) struct spdk_nvmf_discovery_log_page_entry *entry)
{ {
entry->trtype = SPDK_NVMF_TRANS_RDMA; entry->trtype = SPDK_NVMF_TRTYPE_RDMA;
entry->adrfam = SPDK_NVMF_ADDR_FAMILY_IPV4; entry->adrfam = SPDK_NVMF_ADRFAM_IPV4;
entry->treq = SPDK_NVMF_TREQ_NOT_SPECIFIED; entry->treq.secure_channel = SPDK_NVMF_TREQ_SECURE_CHANNEL_NOT_SPECIFIED;
snprintf(entry->trsvcid, sizeof(entry->trsvcid), "%s", listen_addr->trsvc); snprintf(entry->trsvcid, sizeof(entry->trsvcid), "%s", listen_addr->trsvc);
snprintf(entry->traddr, sizeof(entry->traddr), "%s", listen_addr->traddr); 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_qptype = SPDK_NVMF_RDMA_QPTYPE_RELIABLE_CONNECTED;
entry->tsas.rdma.rdma_prtype = SPDK_NVMF_RDMA_NO_PROVIDER; entry->tsas.rdma.rdma_prtype = SPDK_NVMF_RDMA_PRTYPE_NONE;
entry->tsas.rdma.rdma_cms = SPDK_NVMF_RDMA_CMS_RDMA_CM; entry->tsas.rdma.rdma_cms = SPDK_NVMF_RDMA_CMS_RDMA_CM;
} }

View File

@ -649,7 +649,7 @@ spdk_nvmf_request_exec(struct spdk_nvmf_request *req)
RTE_VERIFY(session != NULL); RTE_VERIFY(session != NULL);
subsystem = session->subsys; subsystem = session->subsys;
RTE_VERIFY(subsystem != NULL); RTE_VERIFY(subsystem != NULL);
if (subsystem->subtype == SPDK_NVMF_SUB_DISCOVERY) { if (subsystem->subtype == SPDK_NVMF_SUBTYPE_DISCOVERY) {
done = nvmf_process_discovery_cmd(req); done = nvmf_process_discovery_cmd(req);
} else { } else {
done = nvmf_process_admin_cmd(req); done = nvmf_process_admin_cmd(req);

View File

@ -248,7 +248,7 @@ spdk_nvmf_session_connect(struct spdk_nvmf_conn *conn,
session->subsys = subsystem; session->subsys = subsystem;
session->max_connections_allowed = g_nvmf_tgt.MaxConnectionsPerSession; 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); nvmf_init_nvme_session_properties(session);
} else { } else {
nvmf_init_discovery_session_properties(session); nvmf_init_discovery_session_properties(session);

View File

@ -85,7 +85,7 @@ spdk_nvmf_subsystem_poller(void *arg)
} }
/* For NVMe subsystems, check the backing physical device for completions. */ /* For NVMe subsystems, check the backing physical device for completions. */
if (subsystem->subtype == SPDK_NVMF_SUB_NVME) { if (subsystem->subtype == SPDK_NVMF_SUBTYPE_NVME) {
spdk_nvme_ctrlr_process_admin_completions(subsystem->ctrlr); spdk_nvme_ctrlr_process_admin_completions(subsystem->ctrlr);
spdk_nvme_qpair_process_completions(subsystem->io_qpair, 0); spdk_nvme_qpair_process_completions(subsystem->io_qpair, 0);
} }
@ -96,7 +96,7 @@ spdk_nvmf_subsystem_poller(void *arg)
struct spdk_nvmf_subsystem * struct spdk_nvmf_subsystem *
nvmf_create_subsystem(int num, const char *name, nvmf_create_subsystem(int num, const char *name,
enum spdk_nvmf_subsystem_types sub_type, enum spdk_nvmf_subtype subtype,
uint32_t lcore) uint32_t lcore)
{ {
struct spdk_nvmf_subsystem *subsystem; struct spdk_nvmf_subsystem *subsystem;
@ -109,7 +109,7 @@ nvmf_create_subsystem(int num, const char *name,
SPDK_TRACELOG(SPDK_TRACE_NVMF, "nvmf_create_subsystem: allocated subsystem %p\n", subsystem); SPDK_TRACELOG(SPDK_TRACE_NVMF, "nvmf_create_subsystem: allocated subsystem %p\n", subsystem);
subsystem->num = num; subsystem->num = num;
subsystem->subtype = sub_type; subsystem->subtype = subtype;
snprintf(subsystem->subnqn, sizeof(subsystem->subnqn), "%s", name); snprintf(subsystem->subnqn, sizeof(subsystem->subnqn), "%s", name);
TAILQ_INIT(&subsystem->listen_addrs); TAILQ_INIT(&subsystem->listen_addrs);
TAILQ_INIT(&subsystem->hosts); TAILQ_INIT(&subsystem->hosts);
@ -220,7 +220,7 @@ spdk_add_nvmf_discovery_subsystem(void)
return -1; return -1;
} }
subsystem = nvmf_create_subsystem(0, name, SPDK_NVMF_SUB_DISCOVERY, rte_get_master_lcore()); subsystem = nvmf_create_subsystem(0, name, SPDK_NVMF_SUBTYPE_DISCOVERY, rte_get_master_lcore());
if (subsystem == NULL) { if (subsystem == NULL) {
SPDK_ERRLOG("Failed creating discovery nvmf library subsystem\n"); SPDK_ERRLOG("Failed creating discovery nvmf library subsystem\n");
free(name); free(name);
@ -241,7 +241,7 @@ spdk_format_discovery_log(struct spdk_nvmf_discovery_log_page *disc_log, uint32_
struct spdk_nvmf_discovery_log_page_entry *entry; struct spdk_nvmf_discovery_log_page_entry *entry;
TAILQ_FOREACH(subsystem, &g_subsystems, entries) { TAILQ_FOREACH(subsystem, &g_subsystems, entries) {
if (subsystem->subtype == SPDK_NVMF_SUB_DISCOVERY) { if (subsystem->subtype == SPDK_NVMF_SUBTYPE_DISCOVERY) {
continue; continue;
} }

View File

@ -62,7 +62,7 @@ struct spdk_nvmf_host {
struct spdk_nvmf_subsystem { struct spdk_nvmf_subsystem {
uint16_t num; uint16_t num;
char subnqn[MAX_NQN_SIZE]; char subnqn[MAX_NQN_SIZE];
enum spdk_nvmf_subsystem_types subtype; enum spdk_nvmf_subtype subtype;
struct nvmf_session *session; struct nvmf_session *session;
struct spdk_nvme_ctrlr *ctrlr; struct spdk_nvme_ctrlr *ctrlr;
struct spdk_nvme_qpair *io_qpair; struct spdk_nvme_qpair *io_qpair;
@ -80,7 +80,7 @@ struct spdk_nvmf_subsystem {
struct spdk_nvmf_subsystem * struct spdk_nvmf_subsystem *
nvmf_create_subsystem(int num, const char *name, nvmf_create_subsystem(int num, const char *name,
enum spdk_nvmf_subsystem_types sub_type, enum spdk_nvmf_subtype subtype,
uint32_t lcore); uint32_t lcore);
int int