Lines Matching refs:lport
140 struct nvme_fc_lport *lport; member
157 struct nvme_fc_lport *lport; member
248 struct nvme_fc_lport *lport = in nvme_fc_free_lport() local
252 WARN_ON(lport->localport.port_state != FC_OBJSTATE_DELETED); in nvme_fc_free_lport()
253 WARN_ON(!list_empty(&lport->endp_list)); in nvme_fc_free_lport()
257 list_del(&lport->port_list); in nvme_fc_free_lport()
262 ida_simple_remove(&nvme_fc_local_port_cnt, lport->localport.port_num); in nvme_fc_free_lport()
263 ida_destroy(&lport->endp_cnt); in nvme_fc_free_lport()
265 put_device(lport->dev); in nvme_fc_free_lport()
267 kfree(lport); in nvme_fc_free_lport()
271 nvme_fc_lport_put(struct nvme_fc_lport *lport) in nvme_fc_lport_put() argument
273 kref_put(&lport->ref, nvme_fc_free_lport); in nvme_fc_lport_put()
277 nvme_fc_lport_get(struct nvme_fc_lport *lport) in nvme_fc_lport_get() argument
279 return kref_get_unless_zero(&lport->ref); in nvme_fc_lport_get()
288 struct nvme_fc_lport *lport; in nvme_fc_attach_to_unreg_lport() local
293 list_for_each_entry(lport, &nvme_fc_lport_list, port_list) { in nvme_fc_attach_to_unreg_lport()
294 if (lport->localport.node_name != pinfo->node_name || in nvme_fc_attach_to_unreg_lport()
295 lport->localport.port_name != pinfo->port_name) in nvme_fc_attach_to_unreg_lport()
298 if (lport->dev != dev) { in nvme_fc_attach_to_unreg_lport()
299 lport = ERR_PTR(-EXDEV); in nvme_fc_attach_to_unreg_lport()
303 if (lport->localport.port_state != FC_OBJSTATE_DELETED) { in nvme_fc_attach_to_unreg_lport()
304 lport = ERR_PTR(-EEXIST); in nvme_fc_attach_to_unreg_lport()
308 if (!nvme_fc_lport_get(lport)) { in nvme_fc_attach_to_unreg_lport()
313 lport = NULL; in nvme_fc_attach_to_unreg_lport()
319 lport->ops = ops; in nvme_fc_attach_to_unreg_lport()
320 lport->localport.port_role = pinfo->port_role; in nvme_fc_attach_to_unreg_lport()
321 lport->localport.port_id = pinfo->port_id; in nvme_fc_attach_to_unreg_lport()
322 lport->localport.port_state = FC_OBJSTATE_ONLINE; in nvme_fc_attach_to_unreg_lport()
326 return lport; in nvme_fc_attach_to_unreg_lport()
329 lport = NULL; in nvme_fc_attach_to_unreg_lport()
334 return lport; in nvme_fc_attach_to_unreg_lport()
465 struct nvme_fc_lport *lport = localport_to_lport(portptr); in nvme_fc_unregister_localport() local
481 if (atomic_read(&lport->act_rport_cnt) == 0) in nvme_fc_unregister_localport()
482 lport->ops->localport_delete(&lport->localport); in nvme_fc_unregister_localport()
484 nvme_fc_lport_put(lport); in nvme_fc_unregister_localport()
501 nvme_fc_signal_discovery_scan(struct nvme_fc_lport *lport, in nvme_fc_signal_discovery_scan() argument
513 lport->localport.node_name, lport->localport.port_name); in nvme_fc_signal_discovery_scan()
525 struct nvme_fc_lport *lport = in nvme_fc_free_rport() local
538 ida_simple_remove(&lport->endp_cnt, rport->remoteport.port_num); in nvme_fc_free_rport()
542 nvme_fc_lport_put(lport); in nvme_fc_free_rport()
589 nvme_fc_attach_to_suspended_rport(struct nvme_fc_lport *lport, in nvme_fc_attach_to_suspended_rport() argument
598 list_for_each_entry(rport, &lport->endp_list, endp_list) { in nvme_fc_attach_to_suspended_rport()
676 struct nvme_fc_lport *lport = localport_to_lport(localport); in nvme_fc_register_remoteport() local
681 if (!nvme_fc_lport_get(lport)) { in nvme_fc_register_remoteport()
691 newrec = nvme_fc_attach_to_suspended_rport(lport, pinfo); in nvme_fc_register_remoteport()
700 nvme_fc_lport_put(lport); in nvme_fc_register_remoteport()
702 nvme_fc_signal_discovery_scan(lport, newrec); in nvme_fc_register_remoteport()
709 newrec = kmalloc((sizeof(*newrec) + lport->ops->remote_priv_sz), in nvme_fc_register_remoteport()
716 idx = ida_simple_get(&lport->endp_cnt, 0, 0, GFP_KERNEL); in nvme_fc_register_remoteport()
729 newrec->remoteport.localport = &lport->localport; in nvme_fc_register_remoteport()
731 newrec->dev = lport->dev; in nvme_fc_register_remoteport()
732 newrec->lport = lport; in nvme_fc_register_remoteport()
733 if (lport->ops->remote_priv_sz) in nvme_fc_register_remoteport()
747 list_add_tail(&newrec->endp_list, &lport->endp_list); in nvme_fc_register_remoteport()
750 nvme_fc_signal_discovery_scan(lport, newrec); in nvme_fc_register_remoteport()
758 nvme_fc_lport_put(lport); in nvme_fc_register_remoteport()
778 rport->lport->ops->ls_abort(&rport->lport->localport, in nvme_fc_abort_lsops()
888 rport->lport->ops->remoteport_delete(portptr); in nvme_fc_unregister_remoteport()
914 nvme_fc_signal_discovery_scan(rport->lport, rport); in nvme_fc_rescan_remoteport()
1102 ret = rport->lport->ops->ls_req(&rport->lport->localport, in __nvme_fc_send_ls_req()
1189 ctrl->lport->ops->lsrqst_priv_sz), GFP_KERNEL); in nvme_fc_connect_admin_queue()
1201 if (ctrl->lport->ops->lsrqst_priv_sz) in nvme_fc_connect_admin_queue()
1305 ctrl->lport->ops->lsrqst_priv_sz), GFP_KERNEL); in nvme_fc_connect_queue()
1317 if (ctrl->lport->ops->lsrqst_priv_sz) in nvme_fc_connect_queue()
1435 ctrl->lport->ops->lsrqst_priv_sz), GFP_KERNEL); in nvme_fc_xmt_disconnect_assoc()
1447 if (ctrl->lport->ops->lsrqst_priv_sz) in nvme_fc_xmt_disconnect_assoc()
1466 struct nvme_fc_lport *lport = rport->lport; in nvme_fc_xmt_ls_rsp_done() local
1473 fc_dma_sync_single_for_cpu(lport->dev, lsop->rspdma, in nvme_fc_xmt_ls_rsp_done()
1475 fc_dma_unmap_single(lport->dev, lsop->rspdma, in nvme_fc_xmt_ls_rsp_done()
1487 struct nvme_fc_lport *lport = rport->lport; in nvme_fc_xmt_ls_rsp() local
1491 fc_dma_sync_single_for_device(lport->dev, lsop->rspdma, in nvme_fc_xmt_ls_rsp()
1494 ret = lport->ops->xmt_ls_rsp(&lport->localport, &rport->remoteport, in nvme_fc_xmt_ls_rsp()
1497 dev_warn(lport->dev, in nvme_fc_xmt_ls_rsp()
1538 dev_info(rport->lport->dev, in nvme_fc_match_disconn_ls()
1580 dev_info(rport->lport->dev, in nvme_fc_ls_disconnect_assoc()
1727 struct nvme_fc_lport *lport = rport->lport; in nvme_fc_rcv_ls_req() local
1736 if (!lport->ops->xmt_ls_rsp) { in nvme_fc_rcv_ls_req()
1737 dev_info(lport->dev, in nvme_fc_rcv_ls_req()
1746 dev_info(lport->dev, in nvme_fc_rcv_ls_req()
1759 dev_info(lport->dev, in nvme_fc_rcv_ls_req()
1769 lsop->rspdma = fc_dma_map_single(lport->dev, lsop->rspbuf, in nvme_fc_rcv_ls_req()
1772 if (fc_dma_mapping_error(lport->dev, lsop->rspdma)) { in nvme_fc_rcv_ls_req()
1773 dev_info(lport->dev, in nvme_fc_rcv_ls_req()
1801 fc_dma_unmap_single(lport->dev, lsop->rspdma, in nvme_fc_rcv_ls_req()
1818 fc_dma_unmap_single(ctrl->lport->dev, op->fcp_req.rspdma, in __nvme_fc_exit_request()
1820 fc_dma_unmap_single(ctrl->lport->dev, op->fcp_req.cmddma, in __nvme_fc_exit_request()
1854 ctrl->lport->ops->fcp_abort(&ctrl->lport->localport, in __nvme_fc_abort_op()
1956 fc_dma_sync_single_for_cpu(ctrl->lport->dev, op->fcp_req.rspdma, in nvme_fc_fcpio_done()
2093 op->fcp_req.cmddma = fc_dma_map_single(ctrl->lport->dev, in __nvme_fc_init_request()
2095 if (fc_dma_mapping_error(ctrl->lport->dev, op->fcp_req.cmddma)) { in __nvme_fc_init_request()
2102 op->fcp_req.rspdma = fc_dma_map_single(ctrl->lport->dev, in __nvme_fc_init_request()
2105 if (fc_dma_mapping_error(ctrl->lport->dev, op->fcp_req.rspdma)) { in __nvme_fc_init_request()
2147 if (ctrl->lport->ops->fcprqst_priv_sz) { in nvme_fc_init_aen_ops()
2148 private = kzalloc(ctrl->lport->ops->fcprqst_priv_sz, in nvme_fc_init_aen_ops()
2281 if (ctrl->lport->ops->delete_queue) in __nvme_fc_delete_hw_queue()
2282 ctrl->lport->ops->delete_queue(&ctrl->lport->localport, qidx, in __nvme_fc_delete_hw_queue()
2303 if (ctrl->lport->ops->create_queue) in __nvme_fc_create_hw_queue()
2304 ret = ctrl->lport->ops->create_queue(&ctrl->lport->localport, in __nvme_fc_create_hw_queue()
2599 freq->sg_cnt = fc_dma_map_sg(ctrl->lport->dev, freq->sg_table.sgl, in nvme_fc_map_data()
2622 fc_dma_unmap_sg(ctrl->lport->dev, freq->sg_table.sgl, op->nents, in nvme_fc_unmap_data()
2723 fc_dma_sync_single_for_device(ctrl->lport->dev, op->fcp_req.cmddma, in nvme_fc_start_fcp_op()
2732 ret = ctrl->lport->ops->fcp_io(&ctrl->lport->localport, in nvme_fc_start_fcp_op()
2859 if (ctrl->lport->ops->map_queues) in nvme_fc_map_queues()
2860 ctrl->lport->ops->map_queues(&ctrl->lport->localport, in nvme_fc_map_queues()
2886 ctrl->lport->ops->max_hw_queues); in nvme_fc_create_io_queues()
2908 ctrl->lport->ops->fcprqst_priv_sz); in nvme_fc_create_io_queues()
2960 ctrl->lport->ops->max_hw_queues); in nvme_fc_recreate_io_queues()
3007 struct nvme_fc_lport *lport = rport->lport; in nvme_fc_rport_active_on_lport() local
3009 atomic_inc(&lport->act_rport_cnt); in nvme_fc_rport_active_on_lport()
3015 struct nvme_fc_lport *lport = rport->lport; in nvme_fc_rport_inactive_on_lport() local
3018 cnt = atomic_dec_return(&lport->act_rport_cnt); in nvme_fc_rport_inactive_on_lport()
3019 if (cnt == 0 && lport->localport.port_state == FC_OBJSTATE_DELETED) in nvme_fc_rport_inactive_on_lport()
3020 lport->ops->localport_delete(&lport->localport); in nvme_fc_rport_inactive_on_lport()
3043 struct nvme_fc_lport *lport = rport->lport; in nvme_fc_ctlr_inactive_on_rport() local
3051 lport->ops->remoteport_delete(&rport->remoteport); in nvme_fc_ctlr_inactive_on_rport()
3082 ctrl->cnum, ctrl->lport->localport.port_name, in nvme_fc_create_association()
3118 ctrl->ctrl.max_segments = ctrl->lport->ops->max_sgl_segments; in nvme_fc_create_association()
3451 struct nvme_fc_lport *lport, struct nvme_fc_rport *rport) in nvme_fc_init_ctrl() argument
3496 if (lport->dev) in nvme_fc_init_ctrl()
3497 ctrl->ctrl.numa_node = dev_to_node(lport->dev); in nvme_fc_init_ctrl()
3501 ctrl->lport = lport; in nvme_fc_init_ctrl()
3503 ctrl->dev = lport->dev; in nvme_fc_init_ctrl()
3519 lport->ops->max_hw_queues); in nvme_fc_init_ctrl()
3541 ctrl->lport->ops->fcprqst_priv_sz); in nvme_fc_init_ctrl()
3715 struct nvme_fc_lport *lport; in nvme_fc_create_ctrl() local
3733 list_for_each_entry(lport, &nvme_fc_lport_list, port_list) { in nvme_fc_create_ctrl()
3734 if (lport->localport.node_name != laddr.nn || in nvme_fc_create_ctrl()
3735 lport->localport.port_name != laddr.pn || in nvme_fc_create_ctrl()
3736 lport->localport.port_state != FC_OBJSTATE_ONLINE) in nvme_fc_create_ctrl()
3739 list_for_each_entry(rport, &lport->endp_list, endp_list) { in nvme_fc_create_ctrl()
3751 ctrl = nvme_fc_init_ctrl(dev, opts, lport, rport); in nvme_fc_create_ctrl()
3781 struct nvme_fc_lport *lport; in nvme_fc_nvme_discovery_store() local
3787 list_for_each_entry(lport, &nvme_fc_lport_list, port_list) { in nvme_fc_nvme_discovery_store()
3788 list_for_each_entry(rport, &lport->endp_list, endp_list) { in nvme_fc_nvme_discovery_store()
3789 if (!nvme_fc_lport_get(lport)) in nvme_fc_nvme_discovery_store()
3801 nvme_fc_lport_put(lport); in nvme_fc_nvme_discovery_store()
3823 lport = rport->lport; in nvme_fc_nvme_discovery_store()
3825 nvme_fc_signal_discovery_scan(lport, rport); in nvme_fc_nvme_discovery_store()
3827 nvme_fc_lport_put(lport); in nvme_fc_nvme_discovery_store()
4000 struct nvme_fc_lport *lport; in nvme_fc_cleanup_for_unload() local
4003 list_for_each_entry(lport, &nvme_fc_lport_list, port_list) { in nvme_fc_cleanup_for_unload()
4004 list_for_each_entry(rport, &lport->endp_list, endp_list) { in nvme_fc_cleanup_for_unload()