From cd8e42f48c875c1e0c4dbbecf07f09014baec4f3 Mon Sep 17 00:00:00 2001 From: Naresh Gottumukkala Date: Fri, 4 Dec 2020 06:34:54 +0000 Subject: [PATCH] nvmf/fc: Merged LLD queue init api. Today we have two lowlevel LLD apis nvmf_fc_init_q and spdk_nvmf_fc_init_poller_queues for LLD queue initialisation. Since two calls are redundant, merge them to one api. Also remove dead function code nvmf_fc_hwqp_reinit_poller_queues. Signed-off-by: Naresh Gottumukkala Change-Id: Ic3df6bff7d38d7b1e946755c3224daf7f6194125 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5444 Community-CI: Broadcom CI Reviewed-by: Aleksey Marchuk Reviewed-by: Anil Veerabhadrappa Reviewed-by: Shuhei Matsumoto Tested-by: SPDK CI Jenkins --- CHANGELOG.md | 6 ++++++ lib/nvmf/fc.c | 33 +++------------------------------ lib/nvmf/nvmf_fc.h | 4 ---- 3 files changed, 9 insertions(+), 34 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac7fe9afb..449ec1cc6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ ## v21.01: (Upcoming Release) +### nvmf + +Broadcom FC LLD driver and SPDK NVMe-oF FC transport consolidated one LLD API, +`nvmf_fc_init_poller_queues` into another LLD API `nvmf_fc_init_q`. +Hence updating Broadcom FC LLD driver to the latest is required. + ### event The pci_whitelist and pci_blacklist members of struct spdk_app_opts have been diff --git a/lib/nvmf/fc.c b/lib/nvmf/fc.c index a5dd461c1..a8c43fffa 100644 --- a/lib/nvmf/fc.c +++ b/lib/nvmf/fc.c @@ -389,12 +389,6 @@ nvmf_fc_hwqp_free_fc_request(struct spdk_nvmf_fc_hwqp *hwqp, struct spdk_nvmf_fc TAILQ_INSERT_HEAD(&hwqp->free_reqs, fc_req, link); } -void -nvmf_fc_init_poller_queues(struct spdk_nvmf_fc_hwqp *hwqp) -{ - nvmf_fc_init_rqpair_buffers(hwqp); -} - struct spdk_nvmf_fc_conn * nvmf_fc_hwqp_find_fc_conn(struct spdk_nvmf_fc_hwqp *hwqp, uint64_t conn_id) { @@ -409,28 +403,6 @@ nvmf_fc_hwqp_find_fc_conn(struct spdk_nvmf_fc_hwqp *hwqp, uint64_t conn_id) return NULL; } -void -nvmf_fc_hwqp_reinit_poller_queues(struct spdk_nvmf_fc_hwqp *hwqp, void *queues_curr) -{ - struct spdk_nvmf_fc_abts_ctx *ctx; - struct spdk_nvmf_fc_poller_api_queue_sync_args *args = NULL, *tmp = NULL; - - /* Clean up any pending sync callbacks */ - TAILQ_FOREACH_SAFE(args, &hwqp->sync_cbs, link, tmp) { - TAILQ_REMOVE(&hwqp->sync_cbs, args, link); - ctx = args->cb_info.cb_data; - if (ctx) { - if (++ctx->hwqps_responded == ctx->num_hwqps) { - free(ctx->sync_poller_args); - free(ctx->abts_poller_args); - free(ctx); - } - } - } - - nvmf_fc_reinit_q(hwqp->queues, queues_curr); -} - void nvmf_fc_init_hwqp(struct spdk_nvmf_fc_port *fc_port, struct spdk_nvmf_fc_hwqp *hwqp) { @@ -439,15 +411,16 @@ nvmf_fc_init_hwqp(struct spdk_nvmf_fc_port *fc_port, struct spdk_nvmf_fc_hwqp *h /* clear counters */ memset(&hwqp->counters, 0, sizeof(struct spdk_nvmf_fc_errors)); - nvmf_fc_init_poller_queues(hwqp); if (&fc_port->ls_queue != hwqp) { nvmf_fc_create_req_mempool(hwqp); } - nvmf_fc_init_q(hwqp); TAILQ_INIT(&hwqp->connection_list); TAILQ_INIT(&hwqp->sync_cbs); TAILQ_INIT(&hwqp->ls_pending_queue); + + /* Init low level driver queues */ + nvmf_fc_init_q(hwqp); } static struct spdk_nvmf_fc_poll_group * diff --git a/lib/nvmf/nvmf_fc.h b/lib/nvmf/nvmf_fc.h index 5641e9b29..577ed5d09 100644 --- a/lib/nvmf/nvmf_fc.h +++ b/lib/nvmf/nvmf_fc.h @@ -848,13 +848,9 @@ void nvmf_fc_ls_add_conn_failure( void nvmf_fc_init_hwqp(struct spdk_nvmf_fc_port *fc_port, struct spdk_nvmf_fc_hwqp *hwqp); -void nvmf_fc_init_poller_queues(struct spdk_nvmf_fc_hwqp *hwqp); - struct spdk_nvmf_fc_conn *nvmf_fc_hwqp_find_fc_conn(struct spdk_nvmf_fc_hwqp *hwqp, uint64_t conn_id); -void nvmf_fc_hwqp_reinit_poller_queues(struct spdk_nvmf_fc_hwqp *hwqp, void *queues_curr); - struct spdk_nvmf_fc_port *nvmf_fc_port_lookup(uint8_t port_hdl); bool nvmf_fc_port_is_offline(struct spdk_nvmf_fc_port *fc_port);