Lines Matching refs:ctrl
30 struct nvme_fc_ctrl *ctrl; member
83 struct nvme_fc_ctrl *ctrl; member
161 struct nvme_ctrl ctrl; member
165 to_fc_ctrl(struct nvme_ctrl *ctrl) in to_fc_ctrl() argument
167 return container_of(ctrl, struct nvme_fc_ctrl, ctrl); in to_fc_ctrl()
532 nvme_fc_resume_controller(struct nvme_fc_ctrl *ctrl) in nvme_fc_resume_controller() argument
534 switch (ctrl->ctrl.state) { in nvme_fc_resume_controller()
541 dev_info(ctrl->ctrl.device, in nvme_fc_resume_controller()
543 "Attempting reconnect\n", ctrl->cnum); in nvme_fc_resume_controller()
545 queue_delayed_work(nvme_wq, &ctrl->connect_work, 0); in nvme_fc_resume_controller()
567 struct nvme_fc_ctrl *ctrl; in nvme_fc_attach_to_suspended_rport() local
603 list_for_each_entry(ctrl, &rport->ctrl_list, ctrl_list) in nvme_fc_attach_to_suspended_rport()
604 nvme_fc_resume_controller(ctrl); in nvme_fc_attach_to_suspended_rport()
759 nvme_fc_ctrl_connectivity_loss(struct nvme_fc_ctrl *ctrl) in nvme_fc_ctrl_connectivity_loss() argument
761 dev_info(ctrl->ctrl.device, in nvme_fc_ctrl_connectivity_loss()
763 "Reconnect", ctrl->cnum); in nvme_fc_ctrl_connectivity_loss()
765 switch (ctrl->ctrl.state) { in nvme_fc_ctrl_connectivity_loss()
775 if (nvme_reset_ctrl(&ctrl->ctrl)) { in nvme_fc_ctrl_connectivity_loss()
776 dev_warn(ctrl->ctrl.device, in nvme_fc_ctrl_connectivity_loss()
778 ctrl->cnum); in nvme_fc_ctrl_connectivity_loss()
779 nvme_delete_ctrl(&ctrl->ctrl); in nvme_fc_ctrl_connectivity_loss()
824 struct nvme_fc_ctrl *ctrl; in nvme_fc_unregister_remoteport() local
840 list_for_each_entry(ctrl, &rport->ctrl_list, ctrl_list) { in nvme_fc_unregister_remoteport()
843 dev_warn(ctrl->ctrl.device, in nvme_fc_unregister_remoteport()
845 ctrl->cnum); in nvme_fc_unregister_remoteport()
846 nvme_delete_ctrl(&ctrl->ctrl); in nvme_fc_unregister_remoteport()
848 nvme_fc_ctrl_connectivity_loss(ctrl); in nvme_fc_unregister_remoteport()
1179 nvme_fc_connect_admin_queue(struct nvme_fc_ctrl *ctrl, in nvme_fc_connect_admin_queue() argument
1189 ctrl->lport->ops->lsrqst_priv_sz + in nvme_fc_connect_admin_queue()
1199 (lsreq->private + ctrl->lport->ops->lsrqst_priv_sz); in nvme_fc_connect_admin_queue()
1216 uuid_copy(&assoc_rqst->assoc_cmd.hostid, &ctrl->ctrl.opts->host->id); in nvme_fc_connect_admin_queue()
1217 strncpy(assoc_rqst->assoc_cmd.hostnqn, ctrl->ctrl.opts->host->nqn, in nvme_fc_connect_admin_queue()
1219 strncpy(assoc_rqst->assoc_cmd.subnqn, ctrl->ctrl.opts->subsysnqn, in nvme_fc_connect_admin_queue()
1229 ret = nvme_fc_send_ls_req(ctrl->rport, lsop); in nvme_fc_connect_admin_queue()
1266 dev_err(ctrl->dev, in nvme_fc_connect_admin_queue()
1270 ctrl->association_id = in nvme_fc_connect_admin_queue()
1281 dev_err(ctrl->dev, in nvme_fc_connect_admin_queue()
1288 nvme_fc_connect_queue(struct nvme_fc_ctrl *ctrl, struct nvme_fc_queue *queue, in nvme_fc_connect_queue() argument
1298 ctrl->lport->ops->lsrqst_priv_sz + in nvme_fc_connect_queue()
1308 (lsreq->private + ctrl->lport->ops->lsrqst_priv_sz); in nvme_fc_connect_queue()
1320 conn_rqst->associd.association_id = cpu_to_be64(ctrl->association_id); in nvme_fc_connect_queue()
1337 ret = nvme_fc_send_ls_req(ctrl->rport, lsop); in nvme_fc_connect_queue()
1365 dev_err(ctrl->dev, in nvme_fc_connect_queue()
1378 dev_err(ctrl->dev, in nvme_fc_connect_queue()
1414 nvme_fc_xmt_disconnect_assoc(struct nvme_fc_ctrl *ctrl) in nvme_fc_xmt_disconnect_assoc() argument
1423 ctrl->lport->ops->lsrqst_priv_sz + in nvme_fc_xmt_disconnect_assoc()
1434 (lsreq->private + ctrl->lport->ops->lsrqst_priv_sz); in nvme_fc_xmt_disconnect_assoc()
1447 discon_rqst->associd.association_id = cpu_to_be64(ctrl->association_id); in nvme_fc_xmt_disconnect_assoc()
1455 discon_rqst->discon_cmd.id = cpu_to_be64(ctrl->association_id); in nvme_fc_xmt_disconnect_assoc()
1463 ret = nvme_fc_send_ls_req_async(ctrl->rport, lsop, in nvme_fc_xmt_disconnect_assoc()
1469 ctrl->association_id = 0; in nvme_fc_xmt_disconnect_assoc()
1475 static void nvme_fc_error_recovery(struct nvme_fc_ctrl *ctrl, char *errmsg);
1478 __nvme_fc_exit_request(struct nvme_fc_ctrl *ctrl, in __nvme_fc_exit_request() argument
1481 fc_dma_unmap_single(ctrl->lport->dev, op->fcp_req.rspdma, in __nvme_fc_exit_request()
1483 fc_dma_unmap_single(ctrl->lport->dev, op->fcp_req.cmddma, in __nvme_fc_exit_request()
1499 __nvme_fc_abort_op(struct nvme_fc_ctrl *ctrl, struct nvme_fc_fcp_op *op) in __nvme_fc_abort_op() argument
1504 spin_lock_irqsave(&ctrl->lock, flags); in __nvme_fc_abort_op()
1508 else if (ctrl->flags & FCCTRL_TERMIO) in __nvme_fc_abort_op()
1509 ctrl->iocnt++; in __nvme_fc_abort_op()
1510 spin_unlock_irqrestore(&ctrl->lock, flags); in __nvme_fc_abort_op()
1515 ctrl->lport->ops->fcp_abort(&ctrl->lport->localport, in __nvme_fc_abort_op()
1516 &ctrl->rport->remoteport, in __nvme_fc_abort_op()
1524 nvme_fc_abort_aen_ops(struct nvme_fc_ctrl *ctrl) in nvme_fc_abort_aen_ops() argument
1526 struct nvme_fc_fcp_op *aen_op = ctrl->aen_ops; in nvme_fc_abort_aen_ops()
1534 __nvme_fc_abort_op(ctrl, aen_op); in nvme_fc_abort_aen_ops()
1538 __nvme_fc_fcpop_chk_teardowns(struct nvme_fc_ctrl *ctrl, in __nvme_fc_fcpop_chk_teardowns() argument
1544 spin_lock_irqsave(&ctrl->lock, flags); in __nvme_fc_fcpop_chk_teardowns()
1545 if (ctrl->flags & FCCTRL_TERMIO) { in __nvme_fc_fcpop_chk_teardowns()
1546 if (!--ctrl->iocnt) in __nvme_fc_fcpop_chk_teardowns()
1547 wake_up(&ctrl->ioabort_wait); in __nvme_fc_fcpop_chk_teardowns()
1549 spin_unlock_irqrestore(&ctrl->lock, flags); in __nvme_fc_fcpop_chk_teardowns()
1559 struct nvme_fc_ctrl *ctrl = op->ctrl; in nvme_fc_fcpio_done() local
1607 fc_dma_sync_single_for_cpu(ctrl->lport->dev, op->fcp_req.rspdma, in nvme_fc_fcpio_done()
1614 dev_info(ctrl->ctrl.device, in nvme_fc_fcpio_done()
1616 ctrl->cnum, freq->status); in nvme_fc_fcpio_done()
1646 dev_info(ctrl->ctrl.device, in nvme_fc_fcpio_done()
1649 ctrl->cnum, freq->transferred_length, in nvme_fc_fcpio_done()
1668 dev_info(ctrl->ctrl.device, in nvme_fc_fcpio_done()
1672 ctrl->cnum, be16_to_cpu(op->rsp_iu.iu_len), in nvme_fc_fcpio_done()
1686 dev_info(ctrl->ctrl.device, in nvme_fc_fcpio_done()
1689 ctrl->cnum, freq->rcv_rsplen); in nvme_fc_fcpio_done()
1697 nvme_complete_async_event(&queue->ctrl->ctrl, status, &result); in nvme_fc_fcpio_done()
1698 __nvme_fc_fcpop_chk_teardowns(ctrl, op, opstate); in nvme_fc_fcpio_done()
1701 nvme_fc_ctrl_put(ctrl); in nvme_fc_fcpio_done()
1705 __nvme_fc_fcpop_chk_teardowns(ctrl, op, opstate); in nvme_fc_fcpio_done()
1710 nvme_fc_error_recovery(ctrl, "transport detected io error"); in nvme_fc_fcpio_done()
1714 __nvme_fc_init_request(struct nvme_fc_ctrl *ctrl, in __nvme_fc_init_request() argument
1729 op->ctrl = ctrl; in __nvme_fc_init_request()
1738 op->fcp_req.cmddma = fc_dma_map_single(ctrl->lport->dev, in __nvme_fc_init_request()
1740 if (fc_dma_mapping_error(ctrl->lport->dev, op->fcp_req.cmddma)) { in __nvme_fc_init_request()
1741 dev_err(ctrl->dev, in __nvme_fc_init_request()
1747 op->fcp_req.rspdma = fc_dma_map_single(ctrl->lport->dev, in __nvme_fc_init_request()
1750 if (fc_dma_mapping_error(ctrl->lport->dev, op->fcp_req.rspdma)) { in __nvme_fc_init_request()
1751 dev_err(ctrl->dev, in __nvme_fc_init_request()
1765 struct nvme_fc_ctrl *ctrl = set->driver_data; in nvme_fc_init_request() local
1767 int queue_idx = (set == &ctrl->tag_set) ? hctx_idx + 1 : 0; in nvme_fc_init_request()
1768 struct nvme_fc_queue *queue = &ctrl->queues[queue_idx]; in nvme_fc_init_request()
1771 res = __nvme_fc_init_request(ctrl, queue, &op->op, rq, queue->rqcnt++); in nvme_fc_init_request()
1776 nvme_req(rq)->ctrl = &ctrl->ctrl; in nvme_fc_init_request()
1781 nvme_fc_init_aen_ops(struct nvme_fc_ctrl *ctrl) in nvme_fc_init_aen_ops() argument
1789 aen_op = ctrl->aen_ops; in nvme_fc_init_aen_ops()
1791 private = kzalloc(ctrl->lport->ops->fcprqst_priv_sz, in nvme_fc_init_aen_ops()
1798 ret = __nvme_fc_init_request(ctrl, &ctrl->queues[0], in nvme_fc_init_aen_ops()
1818 nvme_fc_term_aen_ops(struct nvme_fc_ctrl *ctrl) in nvme_fc_term_aen_ops() argument
1823 aen_op = ctrl->aen_ops; in nvme_fc_term_aen_ops()
1828 __nvme_fc_exit_request(ctrl, aen_op); in nvme_fc_term_aen_ops()
1836 __nvme_fc_init_hctx(struct blk_mq_hw_ctx *hctx, struct nvme_fc_ctrl *ctrl, in __nvme_fc_init_hctx() argument
1839 struct nvme_fc_queue *queue = &ctrl->queues[qidx]; in __nvme_fc_init_hctx()
1849 struct nvme_fc_ctrl *ctrl = data; in nvme_fc_init_hctx() local
1851 __nvme_fc_init_hctx(hctx, ctrl, hctx_idx + 1); in nvme_fc_init_hctx()
1860 struct nvme_fc_ctrl *ctrl = data; in nvme_fc_init_admin_hctx() local
1862 __nvme_fc_init_hctx(hctx, ctrl, hctx_idx); in nvme_fc_init_admin_hctx()
1868 nvme_fc_init_queue(struct nvme_fc_ctrl *ctrl, int idx) in nvme_fc_init_queue() argument
1872 queue = &ctrl->queues[idx]; in nvme_fc_init_queue()
1874 queue->ctrl = ctrl; in nvme_fc_init_queue()
1877 queue->dev = ctrl->dev; in nvme_fc_init_queue()
1880 queue->cmnd_capsule_len = ctrl->ctrl.ioccsz * 16; in nvme_fc_init_queue()
1922 __nvme_fc_delete_hw_queue(struct nvme_fc_ctrl *ctrl, in __nvme_fc_delete_hw_queue() argument
1925 if (ctrl->lport->ops->delete_queue) in __nvme_fc_delete_hw_queue()
1926 ctrl->lport->ops->delete_queue(&ctrl->lport->localport, qidx, in __nvme_fc_delete_hw_queue()
1932 nvme_fc_free_io_queues(struct nvme_fc_ctrl *ctrl) in nvme_fc_free_io_queues() argument
1936 for (i = 1; i < ctrl->ctrl.queue_count; i++) in nvme_fc_free_io_queues()
1937 nvme_fc_free_queue(&ctrl->queues[i]); in nvme_fc_free_io_queues()
1941 __nvme_fc_create_hw_queue(struct nvme_fc_ctrl *ctrl, in __nvme_fc_create_hw_queue() argument
1947 if (ctrl->lport->ops->create_queue) in __nvme_fc_create_hw_queue()
1948 ret = ctrl->lport->ops->create_queue(&ctrl->lport->localport, in __nvme_fc_create_hw_queue()
1955 nvme_fc_delete_hw_io_queues(struct nvme_fc_ctrl *ctrl) in nvme_fc_delete_hw_io_queues() argument
1957 struct nvme_fc_queue *queue = &ctrl->queues[ctrl->ctrl.queue_count - 1]; in nvme_fc_delete_hw_io_queues()
1960 for (i = ctrl->ctrl.queue_count - 1; i >= 1; i--, queue--) in nvme_fc_delete_hw_io_queues()
1961 __nvme_fc_delete_hw_queue(ctrl, queue, i); in nvme_fc_delete_hw_io_queues()
1965 nvme_fc_create_hw_io_queues(struct nvme_fc_ctrl *ctrl, u16 qsize) in nvme_fc_create_hw_io_queues() argument
1967 struct nvme_fc_queue *queue = &ctrl->queues[1]; in nvme_fc_create_hw_io_queues()
1970 for (i = 1; i < ctrl->ctrl.queue_count; i++, queue++) { in nvme_fc_create_hw_io_queues()
1971 ret = __nvme_fc_create_hw_queue(ctrl, queue, i, qsize); in nvme_fc_create_hw_io_queues()
1980 __nvme_fc_delete_hw_queue(ctrl, &ctrl->queues[i], i); in nvme_fc_create_hw_io_queues()
1985 nvme_fc_connect_io_queues(struct nvme_fc_ctrl *ctrl, u16 qsize) in nvme_fc_connect_io_queues() argument
1989 for (i = 1; i < ctrl->ctrl.queue_count; i++) { in nvme_fc_connect_io_queues()
1990 ret = nvme_fc_connect_queue(ctrl, &ctrl->queues[i], qsize, in nvme_fc_connect_io_queues()
1994 ret = nvmf_connect_io_queue(&ctrl->ctrl, i, false); in nvme_fc_connect_io_queues()
1998 set_bit(NVME_FC_Q_LIVE, &ctrl->queues[i].flags); in nvme_fc_connect_io_queues()
2005 nvme_fc_init_io_queues(struct nvme_fc_ctrl *ctrl) in nvme_fc_init_io_queues() argument
2009 for (i = 1; i < ctrl->ctrl.queue_count; i++) in nvme_fc_init_io_queues()
2010 nvme_fc_init_queue(ctrl, i); in nvme_fc_init_io_queues()
2016 struct nvme_fc_ctrl *ctrl = in nvme_fc_ctrl_free() local
2020 if (ctrl->ctrl.tagset) { in nvme_fc_ctrl_free()
2021 blk_cleanup_queue(ctrl->ctrl.connect_q); in nvme_fc_ctrl_free()
2022 blk_mq_free_tag_set(&ctrl->tag_set); in nvme_fc_ctrl_free()
2026 spin_lock_irqsave(&ctrl->rport->lock, flags); in nvme_fc_ctrl_free()
2027 list_del(&ctrl->ctrl_list); in nvme_fc_ctrl_free()
2028 spin_unlock_irqrestore(&ctrl->rport->lock, flags); in nvme_fc_ctrl_free()
2030 blk_mq_unquiesce_queue(ctrl->ctrl.admin_q); in nvme_fc_ctrl_free()
2031 blk_cleanup_queue(ctrl->ctrl.admin_q); in nvme_fc_ctrl_free()
2032 blk_cleanup_queue(ctrl->ctrl.fabrics_q); in nvme_fc_ctrl_free()
2033 blk_mq_free_tag_set(&ctrl->admin_tag_set); in nvme_fc_ctrl_free()
2035 kfree(ctrl->queues); in nvme_fc_ctrl_free()
2037 put_device(ctrl->dev); in nvme_fc_ctrl_free()
2038 nvme_fc_rport_put(ctrl->rport); in nvme_fc_ctrl_free()
2040 ida_simple_remove(&nvme_fc_ctrl_cnt, ctrl->cnum); in nvme_fc_ctrl_free()
2041 if (ctrl->ctrl.opts) in nvme_fc_ctrl_free()
2042 nvmf_free_options(ctrl->ctrl.opts); in nvme_fc_ctrl_free()
2043 kfree(ctrl); in nvme_fc_ctrl_free()
2047 nvme_fc_ctrl_put(struct nvme_fc_ctrl *ctrl) in nvme_fc_ctrl_put() argument
2049 kref_put(&ctrl->ref, nvme_fc_ctrl_free); in nvme_fc_ctrl_put()
2053 nvme_fc_ctrl_get(struct nvme_fc_ctrl *ctrl) in nvme_fc_ctrl_get() argument
2055 return kref_get_unless_zero(&ctrl->ref); in nvme_fc_ctrl_get()
2065 struct nvme_fc_ctrl *ctrl = to_fc_ctrl(nctrl); in nvme_fc_nvme_ctrl_freed() local
2067 WARN_ON(nctrl != &ctrl->ctrl); in nvme_fc_nvme_ctrl_freed()
2069 nvme_fc_ctrl_put(ctrl); in nvme_fc_nvme_ctrl_freed()
2073 nvme_fc_error_recovery(struct nvme_fc_ctrl *ctrl, char *errmsg) in nvme_fc_error_recovery() argument
2084 if (ctrl->ctrl.state == NVME_CTRL_CONNECTING) { in nvme_fc_error_recovery()
2085 active = atomic_xchg(&ctrl->err_work_active, 1); in nvme_fc_error_recovery()
2086 if (!active && !queue_work(nvme_fc_wq, &ctrl->err_work)) { in nvme_fc_error_recovery()
2087 atomic_set(&ctrl->err_work_active, 0); in nvme_fc_error_recovery()
2094 if (ctrl->ctrl.state != NVME_CTRL_LIVE) in nvme_fc_error_recovery()
2097 dev_warn(ctrl->ctrl.device, in nvme_fc_error_recovery()
2099 ctrl->cnum, errmsg); in nvme_fc_error_recovery()
2100 dev_warn(ctrl->ctrl.device, in nvme_fc_error_recovery()
2101 "NVME-FC{%d}: resetting controller\n", ctrl->cnum); in nvme_fc_error_recovery()
2103 nvme_reset_ctrl(&ctrl->ctrl); in nvme_fc_error_recovery()
2110 struct nvme_fc_ctrl *ctrl = op->ctrl; in nvme_fc_timeout() local
2119 nvme_fc_error_recovery(ctrl, "io timeout error"); in nvme_fc_timeout()
2130 nvme_fc_map_data(struct nvme_fc_ctrl *ctrl, struct request *rq, in nvme_fc_map_data() argument
2150 freq->sg_cnt = fc_dma_map_sg(ctrl->lport->dev, freq->sg_table.sgl, in nvme_fc_map_data()
2165 nvme_fc_unmap_data(struct nvme_fc_ctrl *ctrl, struct request *rq, in nvme_fc_unmap_data() argument
2173 fc_dma_unmap_sg(ctrl->lport->dev, freq->sg_table.sgl, op->nents, in nvme_fc_unmap_data()
2207 nvme_fc_start_fcp_op(struct nvme_fc_ctrl *ctrl, struct nvme_fc_queue *queue, in nvme_fc_start_fcp_op() argument
2219 if (ctrl->rport->remoteport.port_state != FC_OBJSTATE_ONLINE) in nvme_fc_start_fcp_op()
2222 if (!nvme_fc_ctrl_get(ctrl)) in nvme_fc_start_fcp_op()
2266 ret = nvme_fc_map_data(ctrl, op->rq, op); in nvme_fc_start_fcp_op()
2269 nvme_fc_ctrl_put(ctrl); in nvme_fc_start_fcp_op()
2276 fc_dma_sync_single_for_device(ctrl->lport->dev, op->fcp_req.cmddma, in nvme_fc_start_fcp_op()
2285 ret = ctrl->lport->ops->fcp_io(&ctrl->lport->localport, in nvme_fc_start_fcp_op()
2286 &ctrl->rport->remoteport, in nvme_fc_start_fcp_op()
2303 __nvme_fc_fcpop_chk_teardowns(ctrl, op, opstate); in nvme_fc_start_fcp_op()
2306 nvme_fc_unmap_data(ctrl, op->rq, op); in nvme_fc_start_fcp_op()
2308 nvme_fc_ctrl_put(ctrl); in nvme_fc_start_fcp_op()
2310 if (ctrl->rport->remoteport.port_state == FC_OBJSTATE_ONLINE && in nvme_fc_start_fcp_op()
2326 struct nvme_fc_ctrl *ctrl = queue->ctrl; in nvme_fc_queue_rq() local
2336 if (ctrl->rport->remoteport.port_state != FC_OBJSTATE_ONLINE || in nvme_fc_queue_rq()
2337 !nvmf_check_ready(&queue->ctrl->ctrl, rq, queue_ready)) in nvme_fc_queue_rq()
2338 return nvmf_fail_nonready_command(&queue->ctrl->ctrl, rq); in nvme_fc_queue_rq()
2362 return nvme_fc_start_fcp_op(ctrl, queue, op, data_len, io_dir); in nvme_fc_queue_rq()
2368 struct nvme_fc_ctrl *ctrl = to_fc_ctrl(arg); in nvme_fc_submit_async_event() local
2374 spin_lock_irqsave(&ctrl->lock, flags); in nvme_fc_submit_async_event()
2375 if (ctrl->flags & FCCTRL_TERMIO) in nvme_fc_submit_async_event()
2377 spin_unlock_irqrestore(&ctrl->lock, flags); in nvme_fc_submit_async_event()
2382 aen_op = &ctrl->aen_ops[0]; in nvme_fc_submit_async_event()
2384 ret = nvme_fc_start_fcp_op(ctrl, aen_op->queue, aen_op, 0, in nvme_fc_submit_async_event()
2387 dev_err(ctrl->ctrl.device, in nvme_fc_submit_async_event()
2395 struct nvme_fc_ctrl *ctrl = op->ctrl; in nvme_fc_complete_rq() local
2399 nvme_fc_unmap_data(ctrl, rq, op); in nvme_fc_complete_rq()
2401 nvme_fc_ctrl_put(ctrl); in nvme_fc_complete_rq()
2421 struct nvme_fc_ctrl *ctrl = to_fc_ctrl(nctrl); in nvme_fc_terminate_exchange() local
2424 __nvme_fc_abort_op(ctrl, op); in nvme_fc_terminate_exchange()
2439 nvme_fc_create_io_queues(struct nvme_fc_ctrl *ctrl) in nvme_fc_create_io_queues() argument
2441 struct nvmf_ctrl_options *opts = ctrl->ctrl.opts; in nvme_fc_create_io_queues()
2446 ctrl->lport->ops->max_hw_queues); in nvme_fc_create_io_queues()
2447 ret = nvme_set_queue_count(&ctrl->ctrl, &nr_io_queues); in nvme_fc_create_io_queues()
2449 dev_info(ctrl->ctrl.device, in nvme_fc_create_io_queues()
2454 ctrl->ctrl.queue_count = nr_io_queues + 1; in nvme_fc_create_io_queues()
2458 nvme_fc_init_io_queues(ctrl); in nvme_fc_create_io_queues()
2460 memset(&ctrl->tag_set, 0, sizeof(ctrl->tag_set)); in nvme_fc_create_io_queues()
2461 ctrl->tag_set.ops = &nvme_fc_mq_ops; in nvme_fc_create_io_queues()
2462 ctrl->tag_set.queue_depth = ctrl->ctrl.opts->queue_size; in nvme_fc_create_io_queues()
2463 ctrl->tag_set.reserved_tags = 1; /* fabric connect */ in nvme_fc_create_io_queues()
2464 ctrl->tag_set.numa_node = ctrl->ctrl.numa_node; in nvme_fc_create_io_queues()
2465 ctrl->tag_set.flags = BLK_MQ_F_SHOULD_MERGE; in nvme_fc_create_io_queues()
2466 ctrl->tag_set.cmd_size = in nvme_fc_create_io_queues()
2468 ctrl->lport->ops->fcprqst_priv_sz); in nvme_fc_create_io_queues()
2469 ctrl->tag_set.driver_data = ctrl; in nvme_fc_create_io_queues()
2470 ctrl->tag_set.nr_hw_queues = ctrl->ctrl.queue_count - 1; in nvme_fc_create_io_queues()
2471 ctrl->tag_set.timeout = NVME_IO_TIMEOUT; in nvme_fc_create_io_queues()
2473 ret = blk_mq_alloc_tag_set(&ctrl->tag_set); in nvme_fc_create_io_queues()
2477 ctrl->ctrl.tagset = &ctrl->tag_set; in nvme_fc_create_io_queues()
2479 ctrl->ctrl.connect_q = blk_mq_init_queue(&ctrl->tag_set); in nvme_fc_create_io_queues()
2480 if (IS_ERR(ctrl->ctrl.connect_q)) { in nvme_fc_create_io_queues()
2481 ret = PTR_ERR(ctrl->ctrl.connect_q); in nvme_fc_create_io_queues()
2485 ret = nvme_fc_create_hw_io_queues(ctrl, ctrl->ctrl.sqsize + 1); in nvme_fc_create_io_queues()
2489 ret = nvme_fc_connect_io_queues(ctrl, ctrl->ctrl.sqsize + 1); in nvme_fc_create_io_queues()
2493 ctrl->ioq_live = true; in nvme_fc_create_io_queues()
2498 nvme_fc_delete_hw_io_queues(ctrl); in nvme_fc_create_io_queues()
2500 blk_cleanup_queue(ctrl->ctrl.connect_q); in nvme_fc_create_io_queues()
2502 blk_mq_free_tag_set(&ctrl->tag_set); in nvme_fc_create_io_queues()
2503 nvme_fc_free_io_queues(ctrl); in nvme_fc_create_io_queues()
2506 ctrl->ctrl.tagset = NULL; in nvme_fc_create_io_queues()
2512 nvme_fc_recreate_io_queues(struct nvme_fc_ctrl *ctrl) in nvme_fc_recreate_io_queues() argument
2514 struct nvmf_ctrl_options *opts = ctrl->ctrl.opts; in nvme_fc_recreate_io_queues()
2515 u32 prior_ioq_cnt = ctrl->ctrl.queue_count - 1; in nvme_fc_recreate_io_queues()
2520 ctrl->lport->ops->max_hw_queues); in nvme_fc_recreate_io_queues()
2521 ret = nvme_set_queue_count(&ctrl->ctrl, &nr_io_queues); in nvme_fc_recreate_io_queues()
2523 dev_info(ctrl->ctrl.device, in nvme_fc_recreate_io_queues()
2529 dev_info(ctrl->ctrl.device, in nvme_fc_recreate_io_queues()
2535 ctrl->ctrl.queue_count = nr_io_queues + 1; in nvme_fc_recreate_io_queues()
2537 if (ctrl->ctrl.queue_count == 1) in nvme_fc_recreate_io_queues()
2540 ret = nvme_fc_create_hw_io_queues(ctrl, ctrl->ctrl.sqsize + 1); in nvme_fc_recreate_io_queues()
2544 ret = nvme_fc_connect_io_queues(ctrl, ctrl->ctrl.sqsize + 1); in nvme_fc_recreate_io_queues()
2549 dev_info(ctrl->ctrl.device, in nvme_fc_recreate_io_queues()
2552 blk_mq_update_nr_hw_queues(&ctrl->tag_set, nr_io_queues); in nvme_fc_recreate_io_queues()
2557 nvme_fc_delete_hw_io_queues(ctrl); in nvme_fc_recreate_io_queues()
2559 nvme_fc_free_io_queues(ctrl); in nvme_fc_recreate_io_queues()
2583 nvme_fc_ctlr_active_on_rport(struct nvme_fc_ctrl *ctrl) in nvme_fc_ctlr_active_on_rport() argument
2585 struct nvme_fc_rport *rport = ctrl->rport; in nvme_fc_ctlr_active_on_rport()
2588 if (ctrl->assoc_active) in nvme_fc_ctlr_active_on_rport()
2591 ctrl->assoc_active = true; in nvme_fc_ctlr_active_on_rport()
2600 nvme_fc_ctlr_inactive_on_rport(struct nvme_fc_ctrl *ctrl) in nvme_fc_ctlr_inactive_on_rport() argument
2602 struct nvme_fc_rport *rport = ctrl->rport; in nvme_fc_ctlr_inactive_on_rport()
2623 nvme_fc_create_association(struct nvme_fc_ctrl *ctrl) in nvme_fc_create_association() argument
2625 struct nvmf_ctrl_options *opts = ctrl->ctrl.opts; in nvme_fc_create_association()
2629 ++ctrl->ctrl.nr_reconnects; in nvme_fc_create_association()
2631 if (ctrl->rport->remoteport.port_state != FC_OBJSTATE_ONLINE) in nvme_fc_create_association()
2634 if (nvme_fc_ctlr_active_on_rport(ctrl)) in nvme_fc_create_association()
2637 dev_info(ctrl->ctrl.device, in nvme_fc_create_association()
2640 ctrl->cnum, ctrl->lport->localport.port_name, in nvme_fc_create_association()
2641 ctrl->rport->remoteport.port_name, ctrl->ctrl.opts->subsysnqn); in nvme_fc_create_association()
2647 ret = __nvme_fc_create_hw_queue(ctrl, &ctrl->queues[0], 0, in nvme_fc_create_association()
2652 ret = nvme_fc_connect_admin_queue(ctrl, &ctrl->queues[0], in nvme_fc_create_association()
2657 ret = nvmf_connect_admin_queue(&ctrl->ctrl); in nvme_fc_create_association()
2661 set_bit(NVME_FC_Q_LIVE, &ctrl->queues[0].flags); in nvme_fc_create_association()
2670 ret = nvme_enable_ctrl(&ctrl->ctrl); in nvme_fc_create_association()
2674 ctrl->ctrl.max_hw_sectors = in nvme_fc_create_association()
2675 (ctrl->lport->ops->max_sgl_segments - 1) << (PAGE_SHIFT - 9); in nvme_fc_create_association()
2677 blk_mq_unquiesce_queue(ctrl->ctrl.admin_q); in nvme_fc_create_association()
2679 ret = nvme_init_identify(&ctrl->ctrl); in nvme_fc_create_association()
2686 if (ctrl->ctrl.icdoff) { in nvme_fc_create_association()
2687 dev_err(ctrl->ctrl.device, "icdoff %d is not supported!\n", in nvme_fc_create_association()
2688 ctrl->ctrl.icdoff); in nvme_fc_create_association()
2694 if (opts->queue_size > ctrl->ctrl.maxcmd) { in nvme_fc_create_association()
2696 dev_warn(ctrl->ctrl.device, in nvme_fc_create_association()
2699 opts->queue_size, ctrl->ctrl.maxcmd); in nvme_fc_create_association()
2700 opts->queue_size = ctrl->ctrl.maxcmd; in nvme_fc_create_association()
2703 if (opts->queue_size > ctrl->ctrl.sqsize + 1) { in nvme_fc_create_association()
2705 dev_warn(ctrl->ctrl.device, in nvme_fc_create_association()
2707 opts->queue_size, ctrl->ctrl.sqsize + 1); in nvme_fc_create_association()
2708 opts->queue_size = ctrl->ctrl.sqsize + 1; in nvme_fc_create_association()
2711 ret = nvme_fc_init_aen_ops(ctrl); in nvme_fc_create_association()
2719 if (ctrl->ctrl.queue_count > 1) { in nvme_fc_create_association()
2720 if (!ctrl->ioq_live) in nvme_fc_create_association()
2721 ret = nvme_fc_create_io_queues(ctrl); in nvme_fc_create_association()
2723 ret = nvme_fc_recreate_io_queues(ctrl); in nvme_fc_create_association()
2728 changed = nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_LIVE); in nvme_fc_create_association()
2730 ctrl->ctrl.nr_reconnects = 0; in nvme_fc_create_association()
2733 nvme_start_ctrl(&ctrl->ctrl); in nvme_fc_create_association()
2738 nvme_fc_term_aen_ops(ctrl); in nvme_fc_create_association()
2741 nvme_fc_xmt_disconnect_assoc(ctrl); in nvme_fc_create_association()
2743 __nvme_fc_delete_hw_queue(ctrl, &ctrl->queues[0], 0); in nvme_fc_create_association()
2745 nvme_fc_free_queue(&ctrl->queues[0]); in nvme_fc_create_association()
2746 ctrl->assoc_active = false; in nvme_fc_create_association()
2747 nvme_fc_ctlr_inactive_on_rport(ctrl); in nvme_fc_create_association()
2759 nvme_fc_delete_association(struct nvme_fc_ctrl *ctrl) in nvme_fc_delete_association() argument
2763 if (!ctrl->assoc_active) in nvme_fc_delete_association()
2765 ctrl->assoc_active = false; in nvme_fc_delete_association()
2767 spin_lock_irqsave(&ctrl->lock, flags); in nvme_fc_delete_association()
2768 ctrl->flags |= FCCTRL_TERMIO; in nvme_fc_delete_association()
2769 ctrl->iocnt = 0; in nvme_fc_delete_association()
2770 spin_unlock_irqrestore(&ctrl->lock, flags); in nvme_fc_delete_association()
2784 if (ctrl->ctrl.queue_count > 1) { in nvme_fc_delete_association()
2785 nvme_stop_queues(&ctrl->ctrl); in nvme_fc_delete_association()
2786 blk_mq_tagset_busy_iter(&ctrl->tag_set, in nvme_fc_delete_association()
2787 nvme_fc_terminate_exchange, &ctrl->ctrl); in nvme_fc_delete_association()
2788 blk_mq_tagset_wait_completed_request(&ctrl->tag_set); in nvme_fc_delete_association()
2808 blk_mq_quiesce_queue(ctrl->ctrl.admin_q); in nvme_fc_delete_association()
2809 blk_mq_tagset_busy_iter(&ctrl->admin_tag_set, in nvme_fc_delete_association()
2810 nvme_fc_terminate_exchange, &ctrl->ctrl); in nvme_fc_delete_association()
2811 blk_mq_tagset_wait_completed_request(&ctrl->admin_tag_set); in nvme_fc_delete_association()
2814 nvme_fc_abort_aen_ops(ctrl); in nvme_fc_delete_association()
2817 spin_lock_irq(&ctrl->lock); in nvme_fc_delete_association()
2818 wait_event_lock_irq(ctrl->ioabort_wait, ctrl->iocnt == 0, ctrl->lock); in nvme_fc_delete_association()
2819 ctrl->flags &= ~FCCTRL_TERMIO; in nvme_fc_delete_association()
2820 spin_unlock_irq(&ctrl->lock); in nvme_fc_delete_association()
2822 nvme_fc_term_aen_ops(ctrl); in nvme_fc_delete_association()
2830 if (ctrl->association_id) in nvme_fc_delete_association()
2831 nvme_fc_xmt_disconnect_assoc(ctrl); in nvme_fc_delete_association()
2833 if (ctrl->ctrl.tagset) { in nvme_fc_delete_association()
2834 nvme_fc_delete_hw_io_queues(ctrl); in nvme_fc_delete_association()
2835 nvme_fc_free_io_queues(ctrl); in nvme_fc_delete_association()
2838 __nvme_fc_delete_hw_queue(ctrl, &ctrl->queues[0], 0); in nvme_fc_delete_association()
2839 nvme_fc_free_queue(&ctrl->queues[0]); in nvme_fc_delete_association()
2842 blk_mq_unquiesce_queue(ctrl->ctrl.admin_q); in nvme_fc_delete_association()
2845 nvme_start_queues(&ctrl->ctrl); in nvme_fc_delete_association()
2847 nvme_fc_ctlr_inactive_on_rport(ctrl); in nvme_fc_delete_association()
2853 struct nvme_fc_ctrl *ctrl = to_fc_ctrl(nctrl); in nvme_fc_delete_ctrl() local
2855 cancel_work_sync(&ctrl->err_work); in nvme_fc_delete_ctrl()
2856 cancel_delayed_work_sync(&ctrl->connect_work); in nvme_fc_delete_ctrl()
2861 nvme_fc_delete_association(ctrl); in nvme_fc_delete_ctrl()
2865 nvme_fc_reconnect_or_delete(struct nvme_fc_ctrl *ctrl, int status) in nvme_fc_reconnect_or_delete() argument
2867 struct nvme_fc_rport *rport = ctrl->rport; in nvme_fc_reconnect_or_delete()
2869 unsigned long recon_delay = ctrl->ctrl.opts->reconnect_delay * HZ; in nvme_fc_reconnect_or_delete()
2872 if (ctrl->ctrl.state != NVME_CTRL_CONNECTING) in nvme_fc_reconnect_or_delete()
2876 dev_info(ctrl->ctrl.device, in nvme_fc_reconnect_or_delete()
2878 ctrl->cnum, status); in nvme_fc_reconnect_or_delete()
2882 if (recon && nvmf_should_reconnect(&ctrl->ctrl)) { in nvme_fc_reconnect_or_delete()
2884 dev_info(ctrl->ctrl.device, in nvme_fc_reconnect_or_delete()
2887 ctrl->cnum, recon_delay / HZ); in nvme_fc_reconnect_or_delete()
2891 queue_delayed_work(nvme_wq, &ctrl->connect_work, recon_delay); in nvme_fc_reconnect_or_delete()
2894 dev_warn(ctrl->ctrl.device, in nvme_fc_reconnect_or_delete()
2897 ctrl->cnum, ctrl->ctrl.nr_reconnects); in nvme_fc_reconnect_or_delete()
2899 dev_warn(ctrl->ctrl.device, in nvme_fc_reconnect_or_delete()
2902 ctrl->cnum, portptr->dev_loss_tmo); in nvme_fc_reconnect_or_delete()
2903 WARN_ON(nvme_delete_ctrl(&ctrl->ctrl)); in nvme_fc_reconnect_or_delete()
2908 __nvme_fc_terminate_io(struct nvme_fc_ctrl *ctrl) in __nvme_fc_terminate_io() argument
2910 nvme_stop_keep_alive(&ctrl->ctrl); in __nvme_fc_terminate_io()
2913 nvme_fc_delete_association(ctrl); in __nvme_fc_terminate_io()
2915 if (ctrl->ctrl.state != NVME_CTRL_CONNECTING && in __nvme_fc_terminate_io()
2916 !nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_CONNECTING)) in __nvme_fc_terminate_io()
2917 dev_err(ctrl->ctrl.device, in __nvme_fc_terminate_io()
2919 "to CONNECTING\n", ctrl->cnum); in __nvme_fc_terminate_io()
2925 struct nvme_fc_ctrl *ctrl = in nvme_fc_reset_ctrl_work() local
2926 container_of(work, struct nvme_fc_ctrl, ctrl.reset_work); in nvme_fc_reset_ctrl_work()
2929 __nvme_fc_terminate_io(ctrl); in nvme_fc_reset_ctrl_work()
2931 nvme_stop_ctrl(&ctrl->ctrl); in nvme_fc_reset_ctrl_work()
2933 if (ctrl->rport->remoteport.port_state == FC_OBJSTATE_ONLINE) in nvme_fc_reset_ctrl_work()
2934 ret = nvme_fc_create_association(ctrl); in nvme_fc_reset_ctrl_work()
2939 nvme_fc_reconnect_or_delete(ctrl, ret); in nvme_fc_reset_ctrl_work()
2941 dev_info(ctrl->ctrl.device, in nvme_fc_reset_ctrl_work()
2943 ctrl->cnum); in nvme_fc_reset_ctrl_work()
2949 struct nvme_fc_ctrl *ctrl = in nvme_fc_connect_err_work() local
2952 __nvme_fc_terminate_io(ctrl); in nvme_fc_connect_err_work()
2954 atomic_set(&ctrl->err_work_active, 0); in nvme_fc_connect_err_work()
2982 struct nvme_fc_ctrl *ctrl = in nvme_fc_connect_ctrl_work() local
2986 ret = nvme_fc_create_association(ctrl); in nvme_fc_connect_ctrl_work()
2988 nvme_fc_reconnect_or_delete(ctrl, ret); in nvme_fc_connect_ctrl_work()
2990 dev_info(ctrl->ctrl.device, in nvme_fc_connect_ctrl_work()
2992 ctrl->cnum); in nvme_fc_connect_ctrl_work()
3018 struct nvme_fc_ctrl *ctrl; in nvme_fc_existing_controller() local
3023 list_for_each_entry(ctrl, &rport->ctrl_list, ctrl_list) { in nvme_fc_existing_controller()
3024 found = nvmf_ctlr_matches_baseopts(&ctrl->ctrl, opts); in nvme_fc_existing_controller()
3037 struct nvme_fc_ctrl *ctrl; in nvme_fc_init_ctrl() local
3053 ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL); in nvme_fc_init_ctrl()
3054 if (!ctrl) { in nvme_fc_init_ctrl()
3065 ctrl->ctrl.opts = opts; in nvme_fc_init_ctrl()
3066 ctrl->ctrl.nr_reconnects = 0; in nvme_fc_init_ctrl()
3068 ctrl->ctrl.numa_node = dev_to_node(lport->dev); in nvme_fc_init_ctrl()
3070 ctrl->ctrl.numa_node = NUMA_NO_NODE; in nvme_fc_init_ctrl()
3071 INIT_LIST_HEAD(&ctrl->ctrl_list); in nvme_fc_init_ctrl()
3072 ctrl->lport = lport; in nvme_fc_init_ctrl()
3073 ctrl->rport = rport; in nvme_fc_init_ctrl()
3074 ctrl->dev = lport->dev; in nvme_fc_init_ctrl()
3075 ctrl->cnum = idx; in nvme_fc_init_ctrl()
3076 ctrl->ioq_live = false; in nvme_fc_init_ctrl()
3077 ctrl->assoc_active = false; in nvme_fc_init_ctrl()
3078 atomic_set(&ctrl->err_work_active, 0); in nvme_fc_init_ctrl()
3079 init_waitqueue_head(&ctrl->ioabort_wait); in nvme_fc_init_ctrl()
3081 get_device(ctrl->dev); in nvme_fc_init_ctrl()
3082 kref_init(&ctrl->ref); in nvme_fc_init_ctrl()
3084 INIT_WORK(&ctrl->ctrl.reset_work, nvme_fc_reset_ctrl_work); in nvme_fc_init_ctrl()
3085 INIT_DELAYED_WORK(&ctrl->connect_work, nvme_fc_connect_ctrl_work); in nvme_fc_init_ctrl()
3086 INIT_WORK(&ctrl->err_work, nvme_fc_connect_err_work); in nvme_fc_init_ctrl()
3087 spin_lock_init(&ctrl->lock); in nvme_fc_init_ctrl()
3090 ctrl->ctrl.queue_count = min_t(unsigned int, in nvme_fc_init_ctrl()
3093 ctrl->ctrl.queue_count++; /* +1 for admin queue */ in nvme_fc_init_ctrl()
3095 ctrl->ctrl.sqsize = opts->queue_size - 1; in nvme_fc_init_ctrl()
3096 ctrl->ctrl.kato = opts->kato; in nvme_fc_init_ctrl()
3097 ctrl->ctrl.cntlid = 0xffff; in nvme_fc_init_ctrl()
3100 ctrl->queues = kcalloc(ctrl->ctrl.queue_count, in nvme_fc_init_ctrl()
3102 if (!ctrl->queues) in nvme_fc_init_ctrl()
3105 nvme_fc_init_queue(ctrl, 0); in nvme_fc_init_ctrl()
3107 memset(&ctrl->admin_tag_set, 0, sizeof(ctrl->admin_tag_set)); in nvme_fc_init_ctrl()
3108 ctrl->admin_tag_set.ops = &nvme_fc_admin_mq_ops; in nvme_fc_init_ctrl()
3109 ctrl->admin_tag_set.queue_depth = NVME_AQ_MQ_TAG_DEPTH; in nvme_fc_init_ctrl()
3110 ctrl->admin_tag_set.reserved_tags = 2; /* fabric connect + Keep-Alive */ in nvme_fc_init_ctrl()
3111 ctrl->admin_tag_set.numa_node = ctrl->ctrl.numa_node; in nvme_fc_init_ctrl()
3112 ctrl->admin_tag_set.cmd_size = in nvme_fc_init_ctrl()
3114 ctrl->lport->ops->fcprqst_priv_sz); in nvme_fc_init_ctrl()
3115 ctrl->admin_tag_set.driver_data = ctrl; in nvme_fc_init_ctrl()
3116 ctrl->admin_tag_set.nr_hw_queues = 1; in nvme_fc_init_ctrl()
3117 ctrl->admin_tag_set.timeout = ADMIN_TIMEOUT; in nvme_fc_init_ctrl()
3118 ctrl->admin_tag_set.flags = BLK_MQ_F_NO_SCHED; in nvme_fc_init_ctrl()
3120 ret = blk_mq_alloc_tag_set(&ctrl->admin_tag_set); in nvme_fc_init_ctrl()
3123 ctrl->ctrl.admin_tagset = &ctrl->admin_tag_set; in nvme_fc_init_ctrl()
3125 ctrl->ctrl.fabrics_q = blk_mq_init_queue(&ctrl->admin_tag_set); in nvme_fc_init_ctrl()
3126 if (IS_ERR(ctrl->ctrl.fabrics_q)) { in nvme_fc_init_ctrl()
3127 ret = PTR_ERR(ctrl->ctrl.fabrics_q); in nvme_fc_init_ctrl()
3131 ctrl->ctrl.admin_q = blk_mq_init_queue(&ctrl->admin_tag_set); in nvme_fc_init_ctrl()
3132 if (IS_ERR(ctrl->ctrl.admin_q)) { in nvme_fc_init_ctrl()
3133 ret = PTR_ERR(ctrl->ctrl.admin_q); in nvme_fc_init_ctrl()
3144 ret = nvme_init_ctrl(&ctrl->ctrl, dev, &nvme_fc_ctrl_ops, 0); in nvme_fc_init_ctrl()
3151 list_add_tail(&ctrl->ctrl_list, &rport->ctrl_list); in nvme_fc_init_ctrl()
3154 if (!nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_RESETTING) || in nvme_fc_init_ctrl()
3155 !nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_CONNECTING)) { in nvme_fc_init_ctrl()
3156 dev_err(ctrl->ctrl.device, in nvme_fc_init_ctrl()
3157 "NVME-FC{%d}: failed to init ctrl state\n", ctrl->cnum); in nvme_fc_init_ctrl()
3161 nvme_get_ctrl(&ctrl->ctrl); in nvme_fc_init_ctrl()
3163 if (!queue_delayed_work(nvme_wq, &ctrl->connect_work, 0)) { in nvme_fc_init_ctrl()
3164 nvme_put_ctrl(&ctrl->ctrl); in nvme_fc_init_ctrl()
3165 dev_err(ctrl->ctrl.device, in nvme_fc_init_ctrl()
3167 ctrl->cnum); in nvme_fc_init_ctrl()
3171 flush_delayed_work(&ctrl->connect_work); in nvme_fc_init_ctrl()
3173 dev_info(ctrl->ctrl.device, in nvme_fc_init_ctrl()
3175 ctrl->cnum, ctrl->ctrl.opts->subsysnqn); in nvme_fc_init_ctrl()
3177 return &ctrl->ctrl; in nvme_fc_init_ctrl()
3180 nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_DELETING); in nvme_fc_init_ctrl()
3181 cancel_work_sync(&ctrl->ctrl.reset_work); in nvme_fc_init_ctrl()
3182 cancel_work_sync(&ctrl->err_work); in nvme_fc_init_ctrl()
3183 cancel_delayed_work_sync(&ctrl->connect_work); in nvme_fc_init_ctrl()
3185 ctrl->ctrl.opts = NULL; in nvme_fc_init_ctrl()
3188 nvme_uninit_ctrl(&ctrl->ctrl); in nvme_fc_init_ctrl()
3191 nvme_put_ctrl(&ctrl->ctrl); in nvme_fc_init_ctrl()
3205 blk_cleanup_queue(ctrl->ctrl.admin_q); in nvme_fc_init_ctrl()
3207 blk_cleanup_queue(ctrl->ctrl.fabrics_q); in nvme_fc_init_ctrl()
3209 blk_mq_free_tag_set(&ctrl->admin_tag_set); in nvme_fc_init_ctrl()
3211 kfree(ctrl->queues); in nvme_fc_init_ctrl()
3213 put_device(ctrl->dev); in nvme_fc_init_ctrl()
3214 ida_simple_remove(&nvme_fc_ctrl_cnt, ctrl->cnum); in nvme_fc_init_ctrl()
3216 kfree(ctrl); in nvme_fc_init_ctrl()
3293 struct nvme_ctrl *ctrl; in nvme_fc_create_ctrl() local
3325 ctrl = nvme_fc_init_ctrl(dev, opts, lport, rport); in nvme_fc_create_ctrl()
3326 if (IS_ERR(ctrl)) in nvme_fc_create_ctrl()
3328 return ctrl; in nvme_fc_create_ctrl()
3489 struct nvme_fc_ctrl *ctrl; in nvme_fc_delete_controllers() local
3492 list_for_each_entry(ctrl, &rport->ctrl_list, ctrl_list) { in nvme_fc_delete_controllers()
3493 dev_warn(ctrl->ctrl.device, in nvme_fc_delete_controllers()
3495 ctrl->cnum); in nvme_fc_delete_controllers()
3496 nvme_delete_ctrl(&ctrl->ctrl); in nvme_fc_delete_controllers()