• Home
  • Raw
  • Download

Lines Matching refs:rport

58 	struct nvme_fc_rport	*rport;  member
70 struct nvme_fc_rport *rport; member
157 struct nvme_fc_rport *rport; member
494 struct nvme_fc_rport *rport) in nvme_fc_signal_discovery_scan() argument
500 if (!(rport->remoteport.port_role & FC_PORT_ROLE_NVME_DISCOVERY)) in nvme_fc_signal_discovery_scan()
508 rport->remoteport.node_name, rport->remoteport.port_name); in nvme_fc_signal_discovery_scan()
515 struct nvme_fc_rport *rport = in nvme_fc_free_rport() local
518 localport_to_lport(rport->remoteport.localport); in nvme_fc_free_rport()
521 WARN_ON(rport->remoteport.port_state != FC_OBJSTATE_DELETED); in nvme_fc_free_rport()
522 WARN_ON(!list_empty(&rport->ctrl_list)); in nvme_fc_free_rport()
526 list_del(&rport->endp_list); in nvme_fc_free_rport()
529 WARN_ON(!list_empty(&rport->disc_list)); in nvme_fc_free_rport()
530 ida_simple_remove(&lport->endp_cnt, rport->remoteport.port_num); in nvme_fc_free_rport()
532 kfree(rport); in nvme_fc_free_rport()
538 nvme_fc_rport_put(struct nvme_fc_rport *rport) in nvme_fc_rport_put() argument
540 kref_put(&rport->ref, nvme_fc_free_rport); in nvme_fc_rport_put()
544 nvme_fc_rport_get(struct nvme_fc_rport *rport) in nvme_fc_rport_get() argument
546 return kref_get_unless_zero(&rport->ref); in nvme_fc_rport_get()
584 struct nvme_fc_rport *rport; in nvme_fc_attach_to_suspended_rport() local
590 list_for_each_entry(rport, &lport->endp_list, endp_list) { in nvme_fc_attach_to_suspended_rport()
591 if (rport->remoteport.node_name != pinfo->node_name || in nvme_fc_attach_to_suspended_rport()
592 rport->remoteport.port_name != pinfo->port_name) in nvme_fc_attach_to_suspended_rport()
595 if (!nvme_fc_rport_get(rport)) { in nvme_fc_attach_to_suspended_rport()
596 rport = ERR_PTR(-ENOLCK); in nvme_fc_attach_to_suspended_rport()
602 spin_lock_irqsave(&rport->lock, flags); in nvme_fc_attach_to_suspended_rport()
605 if (rport->remoteport.port_state != FC_OBJSTATE_DELETED) { in nvme_fc_attach_to_suspended_rport()
607 spin_unlock_irqrestore(&rport->lock, flags); in nvme_fc_attach_to_suspended_rport()
608 nvme_fc_rport_put(rport); in nvme_fc_attach_to_suspended_rport()
612 rport->remoteport.port_role = pinfo->port_role; in nvme_fc_attach_to_suspended_rport()
613 rport->remoteport.port_id = pinfo->port_id; in nvme_fc_attach_to_suspended_rport()
614 rport->remoteport.port_state = FC_OBJSTATE_ONLINE; in nvme_fc_attach_to_suspended_rport()
615 rport->dev_loss_end = 0; in nvme_fc_attach_to_suspended_rport()
621 list_for_each_entry(ctrl, &rport->ctrl_list, ctrl_list) in nvme_fc_attach_to_suspended_rport()
624 spin_unlock_irqrestore(&rport->lock, flags); in nvme_fc_attach_to_suspended_rport()
626 return rport; in nvme_fc_attach_to_suspended_rport()
629 rport = NULL; in nvme_fc_attach_to_suspended_rport()
634 return rport; in nvme_fc_attach_to_suspended_rport()
638 __nvme_fc_set_dev_loss_tmo(struct nvme_fc_rport *rport, in __nvme_fc_set_dev_loss_tmo() argument
642 rport->remoteport.dev_loss_tmo = pinfo->dev_loss_tmo; in __nvme_fc_set_dev_loss_tmo()
644 rport->remoteport.dev_loss_tmo = NVME_FC_DEFAULT_DEV_LOSS_TMO; in __nvme_fc_set_dev_loss_tmo()
758 nvme_fc_abort_lsops(struct nvme_fc_rport *rport) in nvme_fc_abort_lsops() argument
764 spin_lock_irqsave(&rport->lock, flags); in nvme_fc_abort_lsops()
766 list_for_each_entry(lsop, &rport->ls_req_list, lsreq_list) { in nvme_fc_abort_lsops()
769 spin_unlock_irqrestore(&rport->lock, flags); in nvme_fc_abort_lsops()
770 rport->lport->ops->ls_abort(&rport->lport->localport, in nvme_fc_abort_lsops()
771 &rport->remoteport, in nvme_fc_abort_lsops()
776 spin_unlock_irqrestore(&rport->lock, flags); in nvme_fc_abort_lsops()
847 struct nvme_fc_rport *rport = remoteport_to_rport(portptr); in nvme_fc_unregister_remoteport() local
854 spin_lock_irqsave(&rport->lock, flags); in nvme_fc_unregister_remoteport()
857 spin_unlock_irqrestore(&rport->lock, flags); in nvme_fc_unregister_remoteport()
862 rport->dev_loss_end = jiffies + (portptr->dev_loss_tmo * HZ); in nvme_fc_unregister_remoteport()
864 list_for_each_entry(ctrl, &rport->ctrl_list, ctrl_list) { in nvme_fc_unregister_remoteport()
875 spin_unlock_irqrestore(&rport->lock, flags); in nvme_fc_unregister_remoteport()
877 nvme_fc_abort_lsops(rport); in nvme_fc_unregister_remoteport()
879 if (atomic_read(&rport->act_ctrl_cnt) == 0) in nvme_fc_unregister_remoteport()
880 rport->lport->ops->remoteport_delete(portptr); in nvme_fc_unregister_remoteport()
887 nvme_fc_rport_put(rport); in nvme_fc_unregister_remoteport()
904 struct nvme_fc_rport *rport = remoteport_to_rport(remoteport); in nvme_fc_rescan_remoteport() local
906 nvme_fc_signal_discovery_scan(rport->lport, rport); in nvme_fc_rescan_remoteport()
914 struct nvme_fc_rport *rport = remoteport_to_rport(portptr); in nvme_fc_set_remoteport_devloss() local
917 spin_lock_irqsave(&rport->lock, flags); in nvme_fc_set_remoteport_devloss()
920 spin_unlock_irqrestore(&rport->lock, flags); in nvme_fc_set_remoteport_devloss()
925 rport->remoteport.dev_loss_tmo = dev_loss_tmo; in nvme_fc_set_remoteport_devloss()
927 spin_unlock_irqrestore(&rport->lock, flags); in nvme_fc_set_remoteport_devloss()
1032 struct nvme_fc_rport *rport = lsop->rport; in __nvme_fc_finish_ls_req() local
1036 spin_lock_irqsave(&rport->lock, flags); in __nvme_fc_finish_ls_req()
1039 spin_unlock_irqrestore(&rport->lock, flags); in __nvme_fc_finish_ls_req()
1047 spin_unlock_irqrestore(&rport->lock, flags); in __nvme_fc_finish_ls_req()
1049 fc_dma_unmap_single(rport->dev, lsreq->rqstdma, in __nvme_fc_finish_ls_req()
1053 nvme_fc_rport_put(rport); in __nvme_fc_finish_ls_req()
1057 __nvme_fc_send_ls_req(struct nvme_fc_rport *rport, in __nvme_fc_send_ls_req() argument
1065 if (rport->remoteport.port_state != FC_OBJSTATE_ONLINE) in __nvme_fc_send_ls_req()
1068 if (!nvme_fc_rport_get(rport)) in __nvme_fc_send_ls_req()
1072 lsop->rport = rport; in __nvme_fc_send_ls_req()
1077 lsreq->rqstdma = fc_dma_map_single(rport->dev, lsreq->rqstaddr, in __nvme_fc_send_ls_req()
1080 if (fc_dma_mapping_error(rport->dev, lsreq->rqstdma)) { in __nvme_fc_send_ls_req()
1086 spin_lock_irqsave(&rport->lock, flags); in __nvme_fc_send_ls_req()
1088 list_add_tail(&lsop->lsreq_list, &rport->ls_req_list); in __nvme_fc_send_ls_req()
1092 spin_unlock_irqrestore(&rport->lock, flags); in __nvme_fc_send_ls_req()
1094 ret = rport->lport->ops->ls_req(&rport->lport->localport, in __nvme_fc_send_ls_req()
1095 &rport->remoteport, lsreq); in __nvme_fc_send_ls_req()
1103 spin_lock_irqsave(&rport->lock, flags); in __nvme_fc_send_ls_req()
1106 spin_unlock_irqrestore(&rport->lock, flags); in __nvme_fc_send_ls_req()
1107 fc_dma_unmap_single(rport->dev, lsreq->rqstdma, in __nvme_fc_send_ls_req()
1111 nvme_fc_rport_put(rport); in __nvme_fc_send_ls_req()
1126 nvme_fc_send_ls_req(struct nvme_fc_rport *rport, struct nvmefc_ls_req_op *lsop) in nvme_fc_send_ls_req() argument
1132 ret = __nvme_fc_send_ls_req(rport, lsop, nvme_fc_send_ls_req_done); in nvme_fc_send_ls_req()
1159 nvme_fc_send_ls_req_async(struct nvme_fc_rport *rport, in nvme_fc_send_ls_req_async() argument
1165 return __nvme_fc_send_ls_req(rport, lsop, done); in nvme_fc_send_ls_req_async()
1225 ret = nvme_fc_send_ls_req(ctrl->rport, lsop); in nvme_fc_connect_admin_queue()
1340 ret = nvme_fc_send_ls_req(ctrl->rport, lsop); in nvme_fc_connect_queue()
1447 ret = nvme_fc_send_ls_req_async(ctrl->rport, lsop, in nvme_fc_xmt_disconnect_assoc()
1457 struct nvme_fc_rport *rport = lsop->rport; in nvme_fc_xmt_ls_rsp_done() local
1458 struct nvme_fc_lport *lport = rport->lport; in nvme_fc_xmt_ls_rsp_done()
1461 spin_lock_irqsave(&rport->lock, flags); in nvme_fc_xmt_ls_rsp_done()
1463 spin_unlock_irqrestore(&rport->lock, flags); in nvme_fc_xmt_ls_rsp_done()
1472 nvme_fc_rport_put(rport); in nvme_fc_xmt_ls_rsp_done()
1478 struct nvme_fc_rport *rport = lsop->rport; in nvme_fc_xmt_ls_rsp() local
1479 struct nvme_fc_lport *lport = rport->lport; in nvme_fc_xmt_ls_rsp()
1486 ret = lport->ops->xmt_ls_rsp(&lport->localport, &rport->remoteport, in nvme_fc_xmt_ls_rsp()
1498 nvme_fc_match_disconn_ls(struct nvme_fc_rport *rport, in nvme_fc_match_disconn_ls() argument
1508 spin_lock_irqsave(&rport->lock, flags); in nvme_fc_match_disconn_ls()
1510 list_for_each_entry(ctrl, &rport->ctrl_list, ctrl_list) { in nvme_fc_match_disconn_ls()
1526 spin_unlock_irqrestore(&rport->lock, flags); in nvme_fc_match_disconn_ls()
1530 dev_info(rport->lport->dev, in nvme_fc_match_disconn_ls()
1553 struct nvme_fc_rport *rport = lsop->rport; in nvme_fc_ls_disconnect_assoc() local
1566 ctrl = nvme_fc_match_disconn_ls(rport, lsop); in nvme_fc_ls_disconnect_assoc()
1572 dev_info(rport->lport->dev, in nvme_fc_ls_disconnect_assoc()
1659 struct nvme_fc_rport *rport = in nvme_fc_handle_ls_rqst_work() local
1668 spin_lock_irqsave(&rport->lock, flags); in nvme_fc_handle_ls_rqst_work()
1669 list_for_each_entry(lsop, &rport->ls_rcv_list, lsrcv_list) { in nvme_fc_handle_ls_rqst_work()
1674 if (rport->remoteport.port_state == FC_OBJSTATE_ONLINE) { in nvme_fc_handle_ls_rqst_work()
1675 spin_unlock_irqrestore(&rport->lock, flags); in nvme_fc_handle_ls_rqst_work()
1678 spin_unlock_irqrestore(&rport->lock, flags); in nvme_fc_handle_ls_rqst_work()
1691 spin_unlock_irqrestore(&rport->lock, flags); in nvme_fc_handle_ls_rqst_work()
1718 struct nvme_fc_rport *rport = remoteport_to_rport(portptr); in nvme_fc_rcv_ls_req() local
1719 struct nvme_fc_lport *lport = rport->lport; in nvme_fc_rcv_ls_req()
1725 nvme_fc_rport_get(rport); in nvme_fc_rcv_ls_req()
1773 lsop->rport = rport; in nvme_fc_rcv_ls_req()
1779 spin_lock_irqsave(&rport->lock, flags); in nvme_fc_rcv_ls_req()
1780 if (rport->remoteport.port_state != FC_OBJSTATE_ONLINE) { in nvme_fc_rcv_ls_req()
1781 spin_unlock_irqrestore(&rport->lock, flags); in nvme_fc_rcv_ls_req()
1785 list_add_tail(&lsop->lsrcv_list, &rport->ls_rcv_list); in nvme_fc_rcv_ls_req()
1786 spin_unlock_irqrestore(&rport->lock, flags); in nvme_fc_rcv_ls_req()
1788 schedule_work(&rport->lsrcv_work); in nvme_fc_rcv_ls_req()
1798 nvme_fc_rport_put(rport); in nvme_fc_rcv_ls_req()
1847 &ctrl->rport->remoteport, in __nvme_fc_abort_op()
2373 spin_lock_irqsave(&ctrl->rport->lock, flags); in nvme_fc_ctrl_free()
2375 spin_unlock_irqrestore(&ctrl->rport->lock, flags); in nvme_fc_ctrl_free()
2385 nvme_fc_rport_put(ctrl->rport); in nvme_fc_ctrl_free()
2657 if (ctrl->rport->remoteport.port_state != FC_OBJSTATE_ONLINE) in nvme_fc_start_fcp_op()
2724 &ctrl->rport->remoteport, in nvme_fc_start_fcp_op()
2750 if (ctrl->rport->remoteport.port_state == FC_OBJSTATE_ONLINE && in nvme_fc_start_fcp_op()
2776 if (ctrl->rport->remoteport.port_state != FC_OBJSTATE_ONLINE || in nvme_fc_queue_rq()
2977 nvme_fc_rport_active_on_lport(struct nvme_fc_rport *rport) in nvme_fc_rport_active_on_lport() argument
2979 struct nvme_fc_lport *lport = rport->lport; in nvme_fc_rport_active_on_lport()
2985 nvme_fc_rport_inactive_on_lport(struct nvme_fc_rport *rport) in nvme_fc_rport_inactive_on_lport() argument
2987 struct nvme_fc_lport *lport = rport->lport; in nvme_fc_rport_inactive_on_lport()
2998 struct nvme_fc_rport *rport = ctrl->rport; in nvme_fc_ctlr_active_on_rport() local
3004 cnt = atomic_inc_return(&rport->act_ctrl_cnt); in nvme_fc_ctlr_active_on_rport()
3006 nvme_fc_rport_active_on_lport(rport); in nvme_fc_ctlr_active_on_rport()
3014 struct nvme_fc_rport *rport = ctrl->rport; in nvme_fc_ctlr_inactive_on_rport() local
3015 struct nvme_fc_lport *lport = rport->lport; in nvme_fc_ctlr_inactive_on_rport()
3020 cnt = atomic_dec_return(&rport->act_ctrl_cnt); in nvme_fc_ctlr_inactive_on_rport()
3022 if (rport->remoteport.port_state == FC_OBJSTATE_DELETED) in nvme_fc_ctlr_inactive_on_rport()
3023 lport->ops->remoteport_delete(&rport->remoteport); in nvme_fc_ctlr_inactive_on_rport()
3024 nvme_fc_rport_inactive_on_lport(rport); in nvme_fc_ctlr_inactive_on_rport()
3045 if (ctrl->rport->remoteport.port_state != FC_OBJSTATE_ONLINE) in nvme_fc_create_association()
3055 ctrl->rport->remoteport.port_name, ctrl->ctrl.opts->subsysnqn); in nvme_fc_create_association()
3266 struct nvme_fc_rport *rport = ctrl->rport; in nvme_fc_reconnect_or_delete() local
3267 struct nvme_fc_remote_port *portptr = &rport->remoteport; in nvme_fc_reconnect_or_delete()
3278 else if (time_after_eq(jiffies, rport->dev_loss_end)) in nvme_fc_reconnect_or_delete()
3287 else if (time_after(jiffies + recon_delay, rport->dev_loss_end)) in nvme_fc_reconnect_or_delete()
3288 recon_delay = rport->dev_loss_end - jiffies; in nvme_fc_reconnect_or_delete()
3324 if (ctrl->rport->remoteport.port_state == FC_OBJSTATE_ONLINE) { in nvme_fc_reset_ctrl_work()
3389 nvme_fc_existing_controller(struct nvme_fc_rport *rport, in nvme_fc_existing_controller() argument
3396 spin_lock_irqsave(&rport->lock, flags); in nvme_fc_existing_controller()
3397 list_for_each_entry(ctrl, &rport->ctrl_list, ctrl_list) { in nvme_fc_existing_controller()
3402 spin_unlock_irqrestore(&rport->lock, flags); in nvme_fc_existing_controller()
3409 struct nvme_fc_lport *lport, struct nvme_fc_rport *rport) in nvme_fc_init_ctrl() argument
3415 if (!(rport->remoteport.port_role & in nvme_fc_init_ctrl()
3422 nvme_fc_existing_controller(rport, opts)) { in nvme_fc_init_ctrl()
3460 ctrl->rport = rport; in nvme_fc_init_ctrl()
3535 spin_lock_irqsave(&rport->lock, flags); in nvme_fc_init_ctrl()
3536 list_add_tail(&ctrl->ctrl_list, &rport->ctrl_list); in nvme_fc_init_ctrl()
3537 spin_unlock_irqrestore(&rport->lock, flags); in nvme_fc_init_ctrl()
3582 nvme_fc_rport_get(rport); in nvme_fc_init_ctrl()
3674 struct nvme_fc_rport *rport; in nvme_fc_create_ctrl() local
3697 list_for_each_entry(rport, &lport->endp_list, endp_list) { in nvme_fc_create_ctrl()
3698 if (rport->remoteport.node_name != raddr.nn || in nvme_fc_create_ctrl()
3699 rport->remoteport.port_name != raddr.pn || in nvme_fc_create_ctrl()
3700 rport->remoteport.port_state != FC_OBJSTATE_ONLINE) in nvme_fc_create_ctrl()
3704 if (!nvme_fc_rport_get(rport)) in nvme_fc_create_ctrl()
3709 ctrl = nvme_fc_init_ctrl(dev, opts, lport, rport); in nvme_fc_create_ctrl()
3711 nvme_fc_rport_put(rport); in nvme_fc_create_ctrl()
3740 struct nvme_fc_rport *rport; in nvme_fc_nvme_discovery_store() local
3746 list_for_each_entry(rport, &lport->endp_list, endp_list) { in nvme_fc_nvme_discovery_store()
3749 if (!nvme_fc_rport_get(rport)) { in nvme_fc_nvme_discovery_store()
3768 if (list_empty(&rport->disc_list)) in nvme_fc_nvme_discovery_store()
3769 list_add_tail(&rport->disc_list, in nvme_fc_nvme_discovery_store()
3776 rport = list_first_entry(&local_disc_list, in nvme_fc_nvme_discovery_store()
3778 list_del_init(&rport->disc_list); in nvme_fc_nvme_discovery_store()
3781 lport = rport->lport; in nvme_fc_nvme_discovery_store()
3783 nvme_fc_signal_discovery_scan(lport, rport); in nvme_fc_nvme_discovery_store()
3784 nvme_fc_rport_put(rport); in nvme_fc_nvme_discovery_store()
3865 nvme_fc_delete_controllers(struct nvme_fc_rport *rport) in nvme_fc_delete_controllers() argument
3869 spin_lock(&rport->lock); in nvme_fc_delete_controllers()
3870 list_for_each_entry(ctrl, &rport->ctrl_list, ctrl_list) { in nvme_fc_delete_controllers()
3876 spin_unlock(&rport->lock); in nvme_fc_delete_controllers()
3882 struct nvme_fc_rport *rport; in nvme_fc_exit_module() local
3887 list_for_each_entry(rport, &lport->endp_list, endp_list) in nvme_fc_exit_module()
3888 nvme_fc_delete_controllers(rport); in nvme_fc_exit_module()