diff --git a/lib/nvmf/fc.c b/lib/nvmf/fc.c index 64db0865f..c5f9cbd5f 100644 --- a/lib/nvmf/fc.c +++ b/lib/nvmf/fc.c @@ -847,6 +847,11 @@ void nvmf_fc_port_add(struct spdk_nvmf_fc_port *fc_port) { TAILQ_INSERT_TAIL(&g_spdk_nvmf_fc_port_list, fc_port, link); + + /* + * Let LLD add the port to its list. + */ + nvmf_fc_lld_port_add(fc_port); } struct spdk_nvmf_fc_port * @@ -2195,6 +2200,7 @@ nvmf_fc_adm_hw_port_data_init(struct spdk_nvmf_fc_port *fc_port, uint32_t i; fc_port->port_hdl = args->port_handle; + fc_port->lld_fc_port = args->lld_fc_port; fc_port->hw_port_status = SPDK_FC_PORT_OFFLINE; fc_port->fcp_rq_id = args->fcp_rq_id; fc_port->num_io_queues = args->io_queue_cnt; diff --git a/lib/nvmf/nvmf_fc.h b/lib/nvmf/nvmf_fc.h index 463ce431a..26bc1a256 100644 --- a/lib/nvmf/nvmf_fc.h +++ b/lib/nvmf/nvmf_fc.h @@ -55,6 +55,11 @@ */ typedef void *spdk_nvmf_fc_lld_hwqp_t; +/* + * FC LLD port. + */ +typedef void *spdk_nvmf_fc_lld_fc_port_t; + /* * FC HW port states. */ @@ -333,6 +338,7 @@ struct spdk_nvmf_fc_hwqp { */ struct spdk_nvmf_fc_port { uint8_t port_hdl; + spdk_nvmf_fc_lld_fc_port_t lld_fc_port; enum spdk_fc_port_state hw_port_status; uint16_t fcp_rq_id; struct spdk_nvmf_fc_hwqp ls_queue; @@ -644,6 +650,7 @@ struct spdk_nvmf_fc_dump_assoc_id_args { * Arguments for HW port init event. */ struct spdk_nvmf_fc_hw_port_init_args { + spdk_nvmf_fc_lld_fc_port_t lld_fc_port; uint32_t ls_queue_size; spdk_nvmf_fc_lld_hwqp_t ls_queue; uint32_t io_queue_size; diff --git a/test/unit/lib/nvmf/fc.c/fc_ut.c b/test/unit/lib/nvmf/fc.c/fc_ut.c index 8bca22dd0..b62a71e2e 100644 --- a/test/unit/lib/nvmf/fc.c/fc_ut.c +++ b/test/unit/lib/nvmf/fc.c/fc_ut.c @@ -142,6 +142,7 @@ DEFINE_STUB(rte_hash_lookup_data, int, (const struct rte_hash *h, const void *ke -ENOENT); DEFINE_STUB(rte_hash_add_key_data, int, (const struct rte_hash *h, const void *key, void *data), 0); DEFINE_STUB_V(rte_hash_free, (struct rte_hash *h)); +DEFINE_STUB(nvmf_fc_lld_port_add, int, (struct spdk_nvmf_fc_port *fc_port), 0); const char * spdk_nvme_transport_id_trtype_str(enum spdk_nvme_transport_type trtype)