nvmf/fc: Add FC LLD specific fc_port.

Add FC LLD specific port placeholder in spdk_nvmf_fc_port.
As part of SPDK_FC_HW_PORT_INIT admin API, Let the LLD know about
the new fc_port.

Signed-off-by: Naresh Gottumukkala <raju.gottumukkala@broadcom.com>
Change-Id: Ib9300176d294642a1825577a31ad999590f5f29d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5711
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Naresh Gottumukkala 2020-12-28 07:27:12 +00:00 committed by Jim Harris
parent 41f8789ce4
commit 1b011d5d44
3 changed files with 14 additions and 0 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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)