Lines Matching refs:vport

65 static void lpfc_disc_flush_list(struct lpfc_vport *vport);
89 lpfc_debugfs_disc_trc(ndlp->vport, LPFC_DISC_TRC_RPORT, in lpfc_terminate_rport_io()
94 lpfc_sli_abort_iocb(ndlp->vport, in lpfc_terminate_rport_io()
108 struct lpfc_vport *vport; in lpfc_dev_loss_tmo_callbk() local
119 vport = ndlp->vport; in lpfc_dev_loss_tmo_callbk()
120 phba = vport->phba; in lpfc_dev_loss_tmo_callbk()
122 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_RPORT, in lpfc_dev_loss_tmo_callbk()
126 lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_NODE, in lpfc_dev_loss_tmo_callbk()
134 if (vport->load_flag & FC_UNLOADING) { in lpfc_dev_loss_tmo_callbk()
153 lpfc_printf_vlog(vport, KERN_ERR, LOG_NODE, in lpfc_dev_loss_tmo_callbk()
216 struct lpfc_vport *vport; in lpfc_dev_loss_tmo_handler() local
233 vport = ndlp->vport; in lpfc_dev_loss_tmo_handler()
234 phba = vport->phba; in lpfc_dev_loss_tmo_handler()
239 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_RPORT, in lpfc_dev_loss_tmo_handler()
243 lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_NODE, in lpfc_dev_loss_tmo_handler()
251 if (vport->load_flag & FC_UNLOADING) { in lpfc_dev_loss_tmo_handler()
254 lpfc_sli_abort_iocb(vport, in lpfc_dev_loss_tmo_handler()
271 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_dev_loss_tmo_handler()
300 lpfc_sli_abort_iocb(vport, &phba->sli.ring[phba->sli.fcp_ring], in lpfc_dev_loss_tmo_handler()
305 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, in lpfc_dev_loss_tmo_handler()
314 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_dev_loss_tmo_handler()
334 if (!(vport->load_flag & FC_UNLOADING) && in lpfc_dev_loss_tmo_handler()
340 lpfc_disc_state_machine(vport, ndlp, NULL, NLP_EVT_DEVICE_RM); in lpfc_dev_loss_tmo_handler()
482 shost = lpfc_shost_from_vport(fast_evt_data->vport); in lpfc_send_fastpath_evt()
633 struct lpfc_vport *vport; in lpfc_work_done() local
683 vport = phba->pport; in lpfc_work_done()
685 vport = vports[i]; in lpfc_work_done()
686 if (vport == NULL) in lpfc_work_done()
688 spin_lock_irq(&vport->work_port_lock); in lpfc_work_done()
689 work_port_events = vport->work_port_events; in lpfc_work_done()
690 vport->work_port_events &= ~work_port_events; in lpfc_work_done()
691 spin_unlock_irq(&vport->work_port_lock); in lpfc_work_done()
693 lpfc_disc_timeout_handler(vport); in lpfc_work_done()
695 lpfc_els_timeout_handler(vport); in lpfc_work_done()
703 lpfc_fdmi_timeout_handler(vport); in lpfc_work_done()
707 lpfc_delayed_disc_timeout_handler(vport); in lpfc_work_done()
823 lpfc_cleanup_rpis(struct lpfc_vport *vport, int remove) in lpfc_cleanup_rpis() argument
825 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_cleanup_rpis()
826 struct lpfc_hba *phba = vport->phba; in lpfc_cleanup_rpis()
830 list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, nlp_listp) { in lpfc_cleanup_rpis()
836 ((vport->port_type == LPFC_NPIV_PORT) && in lpfc_cleanup_rpis()
838 lpfc_unreg_rpi(vport, ndlp); in lpfc_cleanup_rpis()
844 rc = lpfc_disc_state_machine(vport, ndlp, NULL, in lpfc_cleanup_rpis()
851 lpfc_sli4_unreg_all_rpis(vport); in lpfc_cleanup_rpis()
852 lpfc_mbx_unreg_vpi(vport); in lpfc_cleanup_rpis()
854 vport->fc_flag |= FC_VPORT_NEEDS_REG_VPI; in lpfc_cleanup_rpis()
860 lpfc_port_link_failure(struct lpfc_vport *vport) in lpfc_port_link_failure() argument
862 lpfc_vport_set_state(vport, FC_VPORT_LINKDOWN); in lpfc_port_link_failure()
865 lpfc_cleanup_rcv_buffers(vport); in lpfc_port_link_failure()
868 lpfc_els_flush_rscn(vport); in lpfc_port_link_failure()
871 lpfc_els_flush_cmd(vport); in lpfc_port_link_failure()
873 lpfc_cleanup_rpis(vport, 0); in lpfc_port_link_failure()
876 lpfc_can_disctmo(vport); in lpfc_port_link_failure()
880 lpfc_linkdown_port(struct lpfc_vport *vport) in lpfc_linkdown_port() argument
882 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_linkdown_port()
886 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_linkdown_port()
888 vport->port_state, vport->fc_ns_retry, vport->fc_flag); in lpfc_linkdown_port()
890 lpfc_port_link_failure(vport); in lpfc_linkdown_port()
894 vport->fc_flag &= ~FC_DISC_DELAYED; in lpfc_linkdown_port()
896 del_timer_sync(&vport->delayed_disc_tmo); in lpfc_linkdown_port()
902 struct lpfc_vport *vport = phba->pport; in lpfc_linkdown() local
903 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_linkdown()
934 mb->vport = vport; in lpfc_linkdown()
949 mb->vport = vport; in lpfc_linkdown()
964 lpfc_linkup_cleanup_nodes(struct lpfc_vport *vport) in lpfc_linkup_cleanup_nodes() argument
968 list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) { in lpfc_linkup_cleanup_nodes()
978 lpfc_unreg_rpi(vport, ndlp); in lpfc_linkup_cleanup_nodes()
979 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); in lpfc_linkup_cleanup_nodes()
984 lpfc_unreg_rpi(vport, ndlp); in lpfc_linkup_cleanup_nodes()
990 lpfc_linkup_port(struct lpfc_vport *vport) in lpfc_linkup_port() argument
992 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_linkup_port()
993 struct lpfc_hba *phba = vport->phba; in lpfc_linkup_port()
995 if ((vport->load_flag & FC_UNLOADING) != 0) in lpfc_linkup_port()
998 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_linkup_port()
1004 (vport != phba->pport)) in lpfc_linkup_port()
1010 vport->fc_flag &= ~(FC_PT2PT | FC_PT2PT_PLOGI | FC_ABORT_DISCOVERY | in lpfc_linkup_port()
1012 vport->fc_flag |= FC_NDISC_ACTIVE; in lpfc_linkup_port()
1013 vport->fc_ns_retry = 0; in lpfc_linkup_port()
1016 if (vport->fc_flag & FC_LBIT) in lpfc_linkup_port()
1017 lpfc_linkup_cleanup_nodes(vport); in lpfc_linkup_port()
1051 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_clear_la() local
1052 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_mbx_cmpl_clear_la()
1065 lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX, in lpfc_mbx_cmpl_clear_la()
1068 mb->mbxStatus, vport->port_state); in lpfc_mbx_cmpl_clear_la()
1073 if (vport->port_type == LPFC_PHYSICAL_PORT) in lpfc_mbx_cmpl_clear_la()
1088 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_mbx_cmpl_clear_la()
1093 vport->fc_flag &= ~FC_ABORT_DISCOVERY; in lpfc_mbx_cmpl_clear_la()
1096 lpfc_can_disctmo(vport); in lpfc_mbx_cmpl_clear_la()
1115 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_local_config_link() local
1129 vport->fc_flag & FC_PUBLIC_LOOP && in lpfc_mbx_cmpl_local_config_link()
1130 !(vport->fc_flag & FC_LBIT)) { in lpfc_mbx_cmpl_local_config_link()
1135 lpfc_set_disctmo(vport); in lpfc_mbx_cmpl_local_config_link()
1142 if (vport->port_state != LPFC_FLOGI || vport->fc_flag & FC_PT2PT_PLOGI) in lpfc_mbx_cmpl_local_config_link()
1143 lpfc_initial_flogi(vport); in lpfc_mbx_cmpl_local_config_link()
1147 lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX, in lpfc_mbx_cmpl_local_config_link()
1150 pmb->u.mb.mbxStatus, vport->port_state); in lpfc_mbx_cmpl_local_config_link()
1155 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, in lpfc_mbx_cmpl_local_config_link()
1157 vport->port_state); in lpfc_mbx_cmpl_local_config_link()
1159 lpfc_issue_clear_la(phba, vport); in lpfc_mbx_cmpl_local_config_link()
1188 struct lpfc_vport *vport = mboxq->vport; in lpfc_mbx_cmpl_reg_fcfi() local
1191 lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX, in lpfc_mbx_cmpl_reg_fcfi()
1194 mboxq->u.mb.mbxStatus, vport->port_state); in lpfc_mbx_cmpl_reg_fcfi()
1214 if (vport->port_state != LPFC_FLOGI) { in lpfc_mbx_cmpl_reg_fcfi()
1217 lpfc_issue_init_vfi(vport); in lpfc_mbx_cmpl_reg_fcfi()
1484 fcf_mbxq->vport = phba->pport; in lpfc_register_fcf()
1960 int lpfc_sli4_fcf_rr_next_proc(struct lpfc_vport *vport, uint16_t fcf_index) in lpfc_sli4_fcf_rr_next_proc() argument
1962 struct lpfc_hba *phba = vport->phba; in lpfc_sli4_fcf_rr_next_proc()
2004 lpfc_can_disctmo(vport); in lpfc_sli4_fcf_rr_next_proc()
2709 struct lpfc_vport *vport = mboxq->vport; in lpfc_init_vfi_cmpl() local
2719 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_init_vfi_cmpl()
2724 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_init_vfi_cmpl()
2728 lpfc_initial_flogi(vport); in lpfc_init_vfi_cmpl()
2741 lpfc_issue_init_vfi(struct lpfc_vport *vport) in lpfc_issue_init_vfi() argument
2745 struct lpfc_hba *phba = vport->phba; in lpfc_issue_init_vfi()
2749 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_issue_init_vfi()
2754 lpfc_init_vfi(mboxq, vport); in lpfc_issue_init_vfi()
2758 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_issue_init_vfi()
2760 mempool_free(mboxq, vport->phba->mbox_mem_pool); in lpfc_issue_init_vfi()
2774 struct lpfc_vport *vport = mboxq->vport; in lpfc_init_vpi_cmpl() local
2776 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_init_vpi_cmpl()
2779 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_init_vpi_cmpl()
2784 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_init_vpi_cmpl()
2788 vport->fc_flag &= ~FC_VPORT_NEEDS_INIT_VPI; in lpfc_init_vpi_cmpl()
2792 if ((phba->pport == vport) || (vport->port_state == LPFC_FDISC)) { in lpfc_init_vpi_cmpl()
2793 ndlp = lpfc_findnode_did(vport, Fabric_DID); in lpfc_init_vpi_cmpl()
2795 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_init_vpi_cmpl()
2800 lpfc_register_new_vport(phba, vport, ndlp); in lpfc_init_vpi_cmpl()
2806 lpfc_initial_fdisc(vport); in lpfc_init_vpi_cmpl()
2808 lpfc_vport_set_state(vport, FC_VPORT_NO_FABRIC_SUPP); in lpfc_init_vpi_cmpl()
2809 lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, in lpfc_init_vpi_cmpl()
2824 lpfc_issue_init_vpi(struct lpfc_vport *vport) in lpfc_issue_init_vpi() argument
2829 if ((vport->port_type != LPFC_PHYSICAL_PORT) && (!vport->vpi)) { in lpfc_issue_init_vpi()
2830 vpi = lpfc_alloc_vpi(vport->phba); in lpfc_issue_init_vpi()
2832 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_issue_init_vpi()
2835 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_issue_init_vpi()
2838 vport->vpi = vpi; in lpfc_issue_init_vpi()
2841 mboxq = mempool_alloc(vport->phba->mbox_mem_pool, GFP_KERNEL); in lpfc_issue_init_vpi()
2843 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_issue_init_vpi()
2848 lpfc_init_vpi(vport->phba, mboxq, vport->vpi); in lpfc_issue_init_vpi()
2849 mboxq->vport = vport; in lpfc_issue_init_vpi()
2851 rc = lpfc_sli_issue_mbox(vport->phba, mboxq, MBX_NOWAIT); in lpfc_issue_init_vpi()
2853 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_issue_init_vpi()
2855 mempool_free(mboxq, vport->phba->mbox_mem_pool); in lpfc_issue_init_vpi()
2911 struct lpfc_vport *vport = mboxq->vport; in lpfc_mbx_cmpl_reg_vfi() local
2912 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_mbx_cmpl_reg_vfi()
2922 lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX, in lpfc_mbx_cmpl_reg_vfi()
2925 mboxq->u.mb.mbxStatus, vport->port_state); in lpfc_mbx_cmpl_reg_vfi()
2928 lpfc_disc_list_loopmap(vport); in lpfc_mbx_cmpl_reg_vfi()
2930 lpfc_disc_start(vport); in lpfc_mbx_cmpl_reg_vfi()
2933 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_mbx_cmpl_reg_vfi()
2941 if (vport->fc_flag & FC_VFI_REGISTERED) in lpfc_mbx_cmpl_reg_vfi()
2943 vport->fc_flag & FC_PT2PT)) in lpfc_mbx_cmpl_reg_vfi()
2948 vport->vpi_state |= LPFC_VPI_REGISTERED; in lpfc_mbx_cmpl_reg_vfi()
2949 vport->fc_flag |= FC_VFI_REGISTERED; in lpfc_mbx_cmpl_reg_vfi()
2950 vport->fc_flag &= ~FC_VPORT_NEEDS_REG_VPI; in lpfc_mbx_cmpl_reg_vfi()
2951 vport->fc_flag &= ~FC_VPORT_NEEDS_INIT_VPI; in lpfc_mbx_cmpl_reg_vfi()
2961 lpfc_printf_vlog(vport, KERN_INFO, LOG_SLI, in lpfc_mbx_cmpl_reg_vfi()
2964 vport->port_state, vport->fc_flag, vport->fc_myDID, in lpfc_mbx_cmpl_reg_vfi()
2965 vport->phba->alpa_map[0], in lpfc_mbx_cmpl_reg_vfi()
2968 if (vport->port_state == LPFC_FABRIC_CFG_LINK) { in lpfc_mbx_cmpl_reg_vfi()
2973 if ((vport->fc_flag & FC_PT2PT) || in lpfc_mbx_cmpl_reg_vfi()
2975 !(vport->fc_flag & FC_PUBLIC_LOOP))) { in lpfc_mbx_cmpl_reg_vfi()
2978 lpfc_disc_list_loopmap(vport); in lpfc_mbx_cmpl_reg_vfi()
2980 if (vport->fc_flag & FC_PT2PT) in lpfc_mbx_cmpl_reg_vfi()
2981 vport->port_state = LPFC_VPORT_READY; in lpfc_mbx_cmpl_reg_vfi()
2983 lpfc_disc_start(vport); in lpfc_mbx_cmpl_reg_vfi()
2986 lpfc_do_scr_ns_plogi(phba, vport); in lpfc_mbx_cmpl_reg_vfi()
3002 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_read_sparam() local
3008 lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX, in lpfc_mbx_cmpl_read_sparam()
3011 mb->mbxStatus, vport->port_state); in lpfc_mbx_cmpl_read_sparam()
3016 memcpy((uint8_t *) &vport->fc_sparam, (uint8_t *) mp->virt, in lpfc_mbx_cmpl_read_sparam()
3018 lpfc_update_vport_wwn(vport); in lpfc_mbx_cmpl_read_sparam()
3019 if (vport->port_type == LPFC_PHYSICAL_PORT) { in lpfc_mbx_cmpl_read_sparam()
3020 memcpy(&phba->wwnn, &vport->fc_nodename, sizeof(phba->wwnn)); in lpfc_mbx_cmpl_read_sparam()
3021 memcpy(&phba->wwpn, &vport->fc_portname, sizeof(phba->wwnn)); in lpfc_mbx_cmpl_read_sparam()
3033 lpfc_issue_clear_la(phba, vport); in lpfc_mbx_cmpl_read_sparam()
3041 struct lpfc_vport *vport = phba->pport; in lpfc_mbx_process_link_up() local
3077 shost = lpfc_shost_from_vport(vport); in lpfc_mbx_process_link_up()
3092 vport->fc_myDID = bf_get(lpfc_mbx_read_top_alpa_granted, la); in lpfc_mbx_process_link_up()
3098 if (vport->cfg_log_verbose & LOG_LINK_EVENT) { in lpfc_mbx_process_link_up()
3138 vport->fc_myDID = phba->fc_pref_DID; in lpfc_mbx_process_link_up()
3145 vport->fc_flag |= fc_flags; in lpfc_mbx_process_link_up()
3159 sparam_mbox->vport = vport; in lpfc_mbx_process_link_up()
3174 vport->port_state = LPFC_LOCAL_CFG_LINK; in lpfc_mbx_process_link_up()
3176 cfglink_mbox->vport = vport; in lpfc_mbx_process_link_up()
3184 vport->port_state = LPFC_VPORT_UNKNOWN; in lpfc_mbx_process_link_up()
3244 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_mbx_process_link_up()
3245 lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX, in lpfc_mbx_process_link_up()
3247 vport->port_state, sparam_mbox, cfglink_mbox); in lpfc_mbx_process_link_up()
3248 lpfc_issue_clear_la(phba, vport); in lpfc_mbx_process_link_up()
3287 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_read_topology() local
3288 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_mbx_cmpl_read_topology()
3299 mb->mbxStatus, vport->port_state); in lpfc_mbx_cmpl_read_topology()
3311 vport->fc_flag |= FC_BYPASSED_MODE; in lpfc_mbx_cmpl_read_topology()
3313 vport->fc_flag &= ~FC_BYPASSED_MODE; in lpfc_mbx_cmpl_read_topology()
3369 phba->pport->port_state, vport->fc_flag); in lpfc_mbx_cmpl_read_topology()
3375 phba->pport->port_state, vport->fc_flag, in lpfc_mbx_cmpl_read_topology()
3388 phba->pport->port_state, vport->fc_flag); in lpfc_mbx_cmpl_read_topology()
3397 phba->pport->port_state, vport->fc_flag); in lpfc_mbx_cmpl_read_topology()
3412 lpfc_issue_clear_la(phba, vport); in lpfc_mbx_cmpl_read_topology()
3434 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_reg_login() local
3437 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_mbx_cmpl_reg_login()
3442 lpfc_printf_vlog(vport, KERN_INFO, LOG_SLI, in lpfc_mbx_cmpl_reg_login()
3465 lpfc_disc_state_machine(vport, ndlp, pmb, in lpfc_mbx_cmpl_reg_login()
3483 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_unreg_vpi() local
3484 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_mbx_cmpl_unreg_vpi()
3489 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in lpfc_mbx_cmpl_unreg_vpi()
3495 lpfc_printf_vlog(vport, KERN_ERR, LOG_NODE, in lpfc_mbx_cmpl_unreg_vpi()
3497 vport->vpi, mb->mbxStatus); in lpfc_mbx_cmpl_unreg_vpi()
3503 vport->vpi_state &= ~LPFC_VPI_REGISTERED; in lpfc_mbx_cmpl_unreg_vpi()
3504 vport->fc_flag |= FC_VPORT_NEEDS_REG_VPI; in lpfc_mbx_cmpl_unreg_vpi()
3506 vport->unreg_vpi_cmpl = VPORT_OK; in lpfc_mbx_cmpl_unreg_vpi()
3508 lpfc_cleanup_vports_rrqs(vport, NULL); in lpfc_mbx_cmpl_unreg_vpi()
3513 if ((vport->load_flag & FC_UNLOADING) && (vport != phba->pport)) in lpfc_mbx_cmpl_unreg_vpi()
3518 lpfc_mbx_unreg_vpi(struct lpfc_vport *vport) in lpfc_mbx_unreg_vpi() argument
3520 struct lpfc_hba *phba = vport->phba; in lpfc_mbx_unreg_vpi()
3528 lpfc_unreg_vpi(phba, vport->vpi, mbox); in lpfc_mbx_unreg_vpi()
3529 mbox->vport = vport; in lpfc_mbx_unreg_vpi()
3533 lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX | LOG_VPORT, in lpfc_mbx_unreg_vpi()
3536 vport->unreg_vpi_cmpl = VPORT_ERROR; in lpfc_mbx_unreg_vpi()
3545 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_reg_vpi() local
3546 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_mbx_cmpl_reg_vpi()
3553 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in lpfc_mbx_cmpl_reg_vpi()
3556 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_mbx_cmpl_reg_vpi()
3558 vport->fc_flag &= ~(FC_FABRIC | FC_PUBLIC_LOOP); in lpfc_mbx_cmpl_reg_vpi()
3560 vport->fc_myDID = 0; in lpfc_mbx_cmpl_reg_vpi()
3565 vport->vpi_state |= LPFC_VPI_REGISTERED; in lpfc_mbx_cmpl_reg_vpi()
3566 vport->fc_flag &= ~FC_VPORT_NEEDS_REG_VPI; in lpfc_mbx_cmpl_reg_vpi()
3568 vport->num_disc_nodes = 0; in lpfc_mbx_cmpl_reg_vpi()
3570 if (vport->fc_npr_cnt) in lpfc_mbx_cmpl_reg_vpi()
3571 lpfc_els_disc_plogi(vport); in lpfc_mbx_cmpl_reg_vpi()
3573 if (!vport->num_disc_nodes) { in lpfc_mbx_cmpl_reg_vpi()
3575 vport->fc_flag &= ~FC_NDISC_ACTIVE; in lpfc_mbx_cmpl_reg_vpi()
3577 lpfc_can_disctmo(vport); in lpfc_mbx_cmpl_reg_vpi()
3579 vport->port_state = LPFC_VPORT_READY; in lpfc_mbx_cmpl_reg_vpi()
3604 struct lpfc_vport *vport; in lpfc_create_static_vport() local
3640 pmb->vport = phba->pport; in lpfc_create_static_vport()
3713 vport = *(struct lpfc_vport **)new_fc_vport->dd_data; in lpfc_create_static_vport()
3714 vport->vport_flag |= STATIC_VPORT; in lpfc_create_static_vport()
3740 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_fabric_reg_login() local
3751 lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX, in lpfc_mbx_cmpl_fabric_reg_login()
3760 lpfc_disc_list_loopmap(vport); in lpfc_mbx_cmpl_fabric_reg_login()
3763 lpfc_disc_start(vport); in lpfc_mbx_cmpl_fabric_reg_login()
3771 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_mbx_cmpl_fabric_reg_login()
3783 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); in lpfc_mbx_cmpl_fabric_reg_login()
3785 if (vport->port_state == LPFC_FABRIC_CFG_LINK) { in lpfc_mbx_cmpl_fabric_reg_login()
3788 if (!(vport->fc_flag & FC_LOGO_RCVD_DID_CHNG)) in lpfc_mbx_cmpl_fabric_reg_login()
3791 shost = lpfc_shost_from_vport(vport); in lpfc_mbx_cmpl_fabric_reg_login()
3793 vport->fc_flag &= ~FC_LOGO_RCVD_DID_CHNG ; in lpfc_mbx_cmpl_fabric_reg_login()
3796 lpfc_do_scr_ns_plogi(phba, vport); in lpfc_mbx_cmpl_fabric_reg_login()
3822 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_ns_reg_login() local
3829 lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, in lpfc_mbx_cmpl_ns_reg_login()
3848 lpfc_disc_list_loopmap(vport); in lpfc_mbx_cmpl_ns_reg_login()
3851 lpfc_disc_start(vport); in lpfc_mbx_cmpl_ns_reg_login()
3854 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_mbx_cmpl_ns_reg_login()
3862 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); in lpfc_mbx_cmpl_ns_reg_login()
3863 lpfc_printf_vlog(vport, KERN_INFO, LOG_SLI, in lpfc_mbx_cmpl_ns_reg_login()
3869 if (vport->port_state < LPFC_VPORT_READY) { in lpfc_mbx_cmpl_ns_reg_login()
3871 lpfc_ns_cmd(vport, SLI_CTNS_RFF_ID, 0, 0); /* Do this first! */ in lpfc_mbx_cmpl_ns_reg_login()
3872 lpfc_ns_cmd(vport, SLI_CTNS_RNN_ID, 0, 0); in lpfc_mbx_cmpl_ns_reg_login()
3873 lpfc_ns_cmd(vport, SLI_CTNS_RSNN_NN, 0, 0); in lpfc_mbx_cmpl_ns_reg_login()
3874 lpfc_ns_cmd(vport, SLI_CTNS_RSPN_ID, 0, 0); in lpfc_mbx_cmpl_ns_reg_login()
3875 lpfc_ns_cmd(vport, SLI_CTNS_RFT_ID, 0, 0); in lpfc_mbx_cmpl_ns_reg_login()
3878 lpfc_issue_els_scr(vport, SCR_DID, 0); in lpfc_mbx_cmpl_ns_reg_login()
3881 vport->fc_ns_retry = 0; in lpfc_mbx_cmpl_ns_reg_login()
3883 if (lpfc_ns_cmd(vport, SLI_CTNS_GID_FT, 0, 0)) { in lpfc_mbx_cmpl_ns_reg_login()
3900 lpfc_register_remote_port(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) in lpfc_register_remote_port() argument
3902 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_register_remote_port()
3906 struct lpfc_hba *phba = vport->phba; in lpfc_register_remote_port()
3925 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_RPORT, in lpfc_register_remote_port()
3930 if (vport->load_flag & FC_UNLOADING) in lpfc_register_remote_port()
3954 lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_NODE, in lpfc_register_remote_port()
3970 lpfc_debugfs_disc_trc(ndlp->vport, LPFC_DISC_TRC_RPORT, in lpfc_unregister_remote_port()
3974 lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_NODE, in lpfc_unregister_remote_port()
3984 lpfc_nlp_counters(struct lpfc_vport *vport, int state, int count) in lpfc_nlp_counters() argument
3986 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_nlp_counters()
3991 vport->fc_unused_cnt += count; in lpfc_nlp_counters()
3994 vport->fc_plogi_cnt += count; in lpfc_nlp_counters()
3997 vport->fc_adisc_cnt += count; in lpfc_nlp_counters()
4000 vport->fc_reglogin_cnt += count; in lpfc_nlp_counters()
4003 vport->fc_prli_cnt += count; in lpfc_nlp_counters()
4006 vport->fc_unmap_cnt += count; in lpfc_nlp_counters()
4009 vport->fc_map_cnt += count; in lpfc_nlp_counters()
4012 if (vport->fc_npr_cnt == 0 && count == -1) in lpfc_nlp_counters()
4013 vport->fc_npr_cnt = 0; in lpfc_nlp_counters()
4015 vport->fc_npr_cnt += count; in lpfc_nlp_counters()
4022 lpfc_nlp_state_cleanup(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, in lpfc_nlp_state_cleanup() argument
4025 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_nlp_state_cleanup()
4039 vport->phba->nport_event_cnt++; in lpfc_nlp_state_cleanup()
4045 vport->phba->nport_event_cnt++; in lpfc_nlp_state_cleanup()
4051 lpfc_register_remote_port(vport, ndlp); in lpfc_nlp_state_cleanup()
4054 (vport->stat_data_enabled)) { in lpfc_nlp_state_cleanup()
4064 lpfc_printf_vlog(vport, KERN_ERR, LOG_NODE, in lpfc_nlp_state_cleanup()
4082 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); in lpfc_nlp_state_cleanup()
4109 lpfc_nlp_set_state(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, in lpfc_nlp_set_state() argument
4112 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_nlp_set_state()
4116 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in lpfc_nlp_set_state()
4122 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_NODE, in lpfc_nlp_set_state()
4128 lpfc_cancel_retry_delay_tmo(vport, ndlp); in lpfc_nlp_set_state()
4136 list_add_tail(&ndlp->nlp_listp, &vport->fc_nodes); in lpfc_nlp_set_state()
4139 lpfc_nlp_counters(vport, old_state, -1); in lpfc_nlp_set_state()
4142 lpfc_nlp_counters(vport, state, 1); in lpfc_nlp_set_state()
4143 lpfc_nlp_state_cleanup(vport, ndlp, old_state, state); in lpfc_nlp_set_state()
4147 lpfc_enqueue_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) in lpfc_enqueue_node() argument
4149 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_enqueue_node()
4153 list_add_tail(&ndlp->nlp_listp, &vport->fc_nodes); in lpfc_enqueue_node()
4159 lpfc_dequeue_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) in lpfc_dequeue_node() argument
4161 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_dequeue_node()
4163 lpfc_cancel_retry_delay_tmo(vport, ndlp); in lpfc_dequeue_node()
4165 lpfc_nlp_counters(vport, ndlp->nlp_state, -1); in lpfc_dequeue_node()
4169 lpfc_nlp_state_cleanup(vport, ndlp, ndlp->nlp_state, in lpfc_dequeue_node()
4174 lpfc_disable_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) in lpfc_disable_node() argument
4176 lpfc_cancel_retry_delay_tmo(vport, ndlp); in lpfc_disable_node()
4178 lpfc_nlp_counters(vport, ndlp->nlp_state, -1); in lpfc_disable_node()
4179 lpfc_nlp_state_cleanup(vport, ndlp, ndlp->nlp_state, in lpfc_disable_node()
4197 lpfc_initialize_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, in lpfc_initialize_node() argument
4206 ndlp->vport = vport; in lpfc_initialize_node()
4207 ndlp->phba = vport->phba; in lpfc_initialize_node()
4212 ndlp->cmd_qdepth = vport->cfg_tgt_queue_depth; in lpfc_initialize_node()
4216 lpfc_enable_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, in lpfc_enable_node() argument
4219 struct lpfc_hba *phba = vport->phba; in lpfc_enable_node()
4231 lpfc_printf_vlog(vport, KERN_WARNING, LOG_NODE, in lpfc_enable_node()
4241 lpfc_printf_vlog(vport, KERN_WARNING, LOG_NODE, in lpfc_enable_node()
4257 lpfc_initialize_node(vport, ndlp, did); in lpfc_enable_node()
4263 if (vport->phba->sli_rev == LPFC_SLI_REV4) { in lpfc_enable_node()
4264 ndlp->nlp_rpi = lpfc_sli4_alloc_rpi(vport->phba); in lpfc_enable_node()
4265 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in lpfc_enable_node()
4275 lpfc_nlp_set_state(vport, ndlp, state); in lpfc_enable_node()
4277 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_NODE, in lpfc_enable_node()
4284 lpfc_drop_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) in lpfc_drop_node() argument
4295 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNUSED_NODE); in lpfc_drop_node()
4296 if (vport->phba->sli_rev == LPFC_SLI_REV4) { in lpfc_drop_node()
4297 lpfc_cleanup_vports_rrqs(vport, ndlp); in lpfc_drop_node()
4298 lpfc_unreg_rpi(vport, ndlp); in lpfc_drop_node()
4309 lpfc_set_disctmo(struct lpfc_vport *vport) in lpfc_set_disctmo() argument
4311 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_set_disctmo()
4312 struct lpfc_hba *phba = vport->phba; in lpfc_set_disctmo()
4315 if (vport->port_state == LPFC_LOCAL_CFG_LINK) { in lpfc_set_disctmo()
4326 if (!timer_pending(&vport->fc_disctmo)) { in lpfc_set_disctmo()
4327 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_set_disctmo()
4329 tmo, vport->port_state, vport->fc_flag); in lpfc_set_disctmo()
4332 mod_timer(&vport->fc_disctmo, jiffies + msecs_to_jiffies(1000 * tmo)); in lpfc_set_disctmo()
4334 vport->fc_flag |= FC_DISC_TMO; in lpfc_set_disctmo()
4338 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_set_disctmo()
4341 vport->port_state, tmo, in lpfc_set_disctmo()
4342 (unsigned long)&vport->fc_disctmo, vport->fc_plogi_cnt, in lpfc_set_disctmo()
4343 vport->fc_adisc_cnt); in lpfc_set_disctmo()
4352 lpfc_can_disctmo(struct lpfc_vport *vport) in lpfc_can_disctmo() argument
4354 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_can_disctmo()
4357 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_can_disctmo()
4359 vport->port_state, vport->fc_ns_retry, vport->fc_flag); in lpfc_can_disctmo()
4362 if (vport->fc_flag & FC_DISC_TMO) { in lpfc_can_disctmo()
4364 vport->fc_flag &= ~FC_DISC_TMO; in lpfc_can_disctmo()
4366 del_timer_sync(&vport->fc_disctmo); in lpfc_can_disctmo()
4367 spin_lock_irqsave(&vport->work_port_lock, iflags); in lpfc_can_disctmo()
4368 vport->work_port_events &= ~WORKER_DISC_TMO; in lpfc_can_disctmo()
4369 spin_unlock_irqrestore(&vport->work_port_lock, iflags); in lpfc_can_disctmo()
4373 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_can_disctmo()
4376 vport->port_state, vport->fc_flag, in lpfc_can_disctmo()
4377 vport->fc_plogi_cnt, vport->fc_adisc_cnt); in lpfc_can_disctmo()
4393 struct lpfc_vport *vport = ndlp->vport; in lpfc_check_sli_ndlp() local
4395 if (iocb->vport != vport) in lpfc_check_sli_ndlp()
4489 struct lpfc_vport *vport = pmb->vport; in lpfc_nlp_logo_unreg() local
4495 lpfc_issue_els_logo(vport, ndlp, 0); in lpfc_nlp_logo_unreg()
4509 lpfc_unreg_rpi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) in lpfc_unreg_rpi() argument
4511 struct lpfc_hba *phba = vport->phba; in lpfc_unreg_rpi()
4519 lpfc_printf_vlog(vport, KERN_INFO, LOG_SLI, in lpfc_unreg_rpi()
4532 lpfc_unreg_login(phba, vport->vpi, rpi, mbox); in lpfc_unreg_rpi()
4533 mbox->vport = vport; in lpfc_unreg_rpi()
4539 (!(vport->load_flag & FC_UNLOADING)) && in lpfc_unreg_rpi()
4604 lpfc_unreg_all_rpis(struct lpfc_vport *vport) in lpfc_unreg_all_rpis() argument
4606 struct lpfc_hba *phba = vport->phba; in lpfc_unreg_all_rpis()
4611 lpfc_sli4_unreg_all_rpis(vport); in lpfc_unreg_all_rpis()
4617 lpfc_unreg_login(phba, vport->vpi, LPFC_UNREG_ALL_RPIS_VPORT, in lpfc_unreg_all_rpis()
4619 mbox->vport = vport; in lpfc_unreg_all_rpis()
4627 lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX | LOG_VPORT, in lpfc_unreg_all_rpis()
4634 lpfc_unreg_default_rpis(struct lpfc_vport *vport) in lpfc_unreg_default_rpis() argument
4636 struct lpfc_hba *phba = vport->phba; in lpfc_unreg_default_rpis()
4642 lpfc_unreg_did(phba, vport->vpi, LPFC_UNREG_ALL_DFLT_RPIS, in lpfc_unreg_default_rpis()
4644 mbox->vport = vport; in lpfc_unreg_default_rpis()
4652 lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX | LOG_VPORT, in lpfc_unreg_default_rpis()
4664 lpfc_cleanup_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) in lpfc_cleanup_node() argument
4666 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_cleanup_node()
4667 struct lpfc_hba *phba = vport->phba; in lpfc_cleanup_node()
4672 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in lpfc_cleanup_node()
4678 lpfc_printf_vlog(vport, KERN_WARNING, LOG_NODE, in lpfc_cleanup_node()
4683 lpfc_dequeue_node(vport, ndlp); in lpfc_cleanup_node()
4685 lpfc_printf_vlog(vport, KERN_WARNING, LOG_NODE, in lpfc_cleanup_node()
4690 lpfc_disable_node(vport, ndlp); in lpfc_cleanup_node()
4748 lpfc_cleanup_vports_rrqs(vport, ndlp); in lpfc_cleanup_node()
4749 lpfc_unreg_rpi(vport, ndlp); in lpfc_cleanup_node()
4760 lpfc_nlp_remove(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) in lpfc_nlp_remove() argument
4762 struct lpfc_hba *phba = vport->phba; in lpfc_nlp_remove()
4767 lpfc_cancel_retry_delay_tmo(vport, ndlp); in lpfc_nlp_remove()
4774 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in lpfc_nlp_remove()
4781 rc = lpfc_reg_rpi(phba, vport->vpi, ndlp->nlp_DID, in lpfc_nlp_remove()
4782 (uint8_t *) &vport->fc_sparam, mbox, ndlp->nlp_rpi); in lpfc_nlp_remove()
4789 mbox->vport = vport; in lpfc_nlp_remove()
4798 lpfc_cleanup_node(vport, ndlp); in lpfc_nlp_remove()
4813 lpfc_matchdid(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, in lpfc_matchdid() argument
4826 mydid.un.word = vport->fc_myDID; in lpfc_matchdid()
4859 __lpfc_findnode_did(struct lpfc_vport *vport, uint32_t did) in __lpfc_findnode_did() argument
4864 list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) { in __lpfc_findnode_did()
4865 if (lpfc_matchdid(vport, ndlp, did)) { in __lpfc_findnode_did()
4870 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in __lpfc_findnode_did()
4881 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in __lpfc_findnode_did()
4887 lpfc_findnode_did(struct lpfc_vport *vport, uint32_t did) in lpfc_findnode_did() argument
4889 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_findnode_did()
4894 ndlp = __lpfc_findnode_did(vport, did); in lpfc_findnode_did()
4900 lpfc_setup_disc_node(struct lpfc_vport *vport, uint32_t did) in lpfc_setup_disc_node() argument
4902 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_setup_disc_node()
4905 ndlp = lpfc_findnode_did(vport, did); in lpfc_setup_disc_node()
4907 if ((vport->fc_flag & FC_RSCN_MODE) != 0 && in lpfc_setup_disc_node()
4908 lpfc_rscn_payload_check(vport, did) == 0) in lpfc_setup_disc_node()
4911 mempool_alloc(vport->phba->nlp_mem_pool, GFP_KERNEL); in lpfc_setup_disc_node()
4914 lpfc_nlp_init(vport, ndlp, did); in lpfc_setup_disc_node()
4915 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); in lpfc_setup_disc_node()
4921 ndlp = lpfc_enable_node(vport, ndlp, NLP_STE_NPR_NODE); in lpfc_setup_disc_node()
4930 if ((vport->fc_flag & FC_RSCN_MODE) && in lpfc_setup_disc_node()
4931 !(vport->fc_flag & FC_NDISC_ACTIVE)) { in lpfc_setup_disc_node()
4932 if (lpfc_rscn_payload_check(vport, did)) { in lpfc_setup_disc_node()
4942 lpfc_cancel_retry_delay_tmo(vport, ndlp); in lpfc_setup_disc_node()
4957 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); in lpfc_setup_disc_node()
4967 lpfc_disc_list_loopmap(struct lpfc_vport *vport) in lpfc_disc_list_loopmap() argument
4969 struct lpfc_hba *phba = vport->phba; in lpfc_disc_list_loopmap()
4983 if (((vport->fc_myDID & 0xff) == alpa) || (alpa == 0)) in lpfc_disc_list_loopmap()
4985 lpfc_setup_disc_node(vport, alpa); in lpfc_disc_list_loopmap()
4993 if (vport->cfg_scan_down) in lpfc_disc_list_loopmap()
4998 if ((vport->fc_myDID & 0xff) == alpa) in lpfc_disc_list_loopmap()
5000 lpfc_setup_disc_node(vport, alpa); in lpfc_disc_list_loopmap()
5007 lpfc_issue_clear_la(struct lpfc_hba *phba, struct lpfc_vport *vport) in lpfc_issue_clear_la() argument
5021 (vport->port_type != LPFC_PHYSICAL_PORT) || in lpfc_issue_clear_la()
5030 mbox->vport = vport; in lpfc_issue_clear_la()
5034 lpfc_disc_flush_list(vport); in lpfc_issue_clear_la()
5045 lpfc_issue_reg_vpi(struct lpfc_hba *phba, struct lpfc_vport *vport) in lpfc_issue_reg_vpi() argument
5051 lpfc_reg_vpi(vport, regvpimbox); in lpfc_issue_reg_vpi()
5053 regvpimbox->vport = vport; in lpfc_issue_reg_vpi()
5063 lpfc_disc_start(struct lpfc_vport *vport) in lpfc_disc_start() argument
5065 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_disc_start()
5066 struct lpfc_hba *phba = vport->phba; in lpfc_disc_start()
5071 lpfc_printf_vlog(vport, KERN_INFO, LOG_SLI, in lpfc_disc_start()
5082 if (vport->port_state < LPFC_VPORT_READY) in lpfc_disc_start()
5083 vport->port_state = LPFC_DISC_AUTH; in lpfc_disc_start()
5085 lpfc_set_disctmo(vport); in lpfc_disc_start()
5087 vport->fc_prevDID = vport->fc_myDID; in lpfc_disc_start()
5088 vport->num_disc_nodes = 0; in lpfc_disc_start()
5091 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_disc_start()
5094 vport->port_state, vport->fc_flag, vport->fc_plogi_cnt, in lpfc_disc_start()
5095 vport->fc_adisc_cnt); in lpfc_disc_start()
5098 num_sent = lpfc_els_disc_adisc(vport); in lpfc_disc_start()
5105 !(vport->fc_flag & FC_PT2PT) && in lpfc_disc_start()
5106 !(vport->fc_flag & FC_RSCN_MODE) && in lpfc_disc_start()
5108 lpfc_issue_clear_la(phba, vport); in lpfc_disc_start()
5109 lpfc_issue_reg_vpi(phba, vport); in lpfc_disc_start()
5117 if (vport->port_state < LPFC_VPORT_READY && !clear_la_pending) { in lpfc_disc_start()
5119 lpfc_issue_clear_la(phba, vport); in lpfc_disc_start()
5121 if (!(vport->fc_flag & FC_ABORT_DISCOVERY)) { in lpfc_disc_start()
5122 vport->num_disc_nodes = 0; in lpfc_disc_start()
5124 if (vport->fc_npr_cnt) in lpfc_disc_start()
5125 lpfc_els_disc_plogi(vport); in lpfc_disc_start()
5127 if (!vport->num_disc_nodes) { in lpfc_disc_start()
5129 vport->fc_flag &= ~FC_NDISC_ACTIVE; in lpfc_disc_start()
5131 lpfc_can_disctmo(vport); in lpfc_disc_start()
5134 vport->port_state = LPFC_VPORT_READY; in lpfc_disc_start()
5137 num_sent = lpfc_els_disc_plogi(vport); in lpfc_disc_start()
5142 if (vport->fc_flag & FC_RSCN_MODE) { in lpfc_disc_start()
5146 if ((vport->fc_rscn_id_cnt == 0) && in lpfc_disc_start()
5147 (!(vport->fc_flag & FC_RSCN_DISCOVERY))) { in lpfc_disc_start()
5149 vport->fc_flag &= ~FC_RSCN_MODE; in lpfc_disc_start()
5151 lpfc_can_disctmo(vport); in lpfc_disc_start()
5153 lpfc_els_handle_rscn(vport); in lpfc_disc_start()
5210 lpfc_disc_flush_list(struct lpfc_vport *vport) in lpfc_disc_flush_list() argument
5213 struct lpfc_hba *phba = vport->phba; in lpfc_disc_flush_list()
5215 if (vport->fc_plogi_cnt || vport->fc_adisc_cnt) { in lpfc_disc_flush_list()
5216 list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, in lpfc_disc_flush_list()
5229 lpfc_cleanup_discovery_resources(struct lpfc_vport *vport) in lpfc_cleanup_discovery_resources() argument
5231 lpfc_els_flush_rscn(vport); in lpfc_cleanup_discovery_resources()
5232 lpfc_els_flush_cmd(vport); in lpfc_cleanup_discovery_resources()
5233 lpfc_disc_flush_list(vport); in lpfc_cleanup_discovery_resources()
5254 struct lpfc_vport *vport = (struct lpfc_vport *) ptr; in lpfc_disc_timeout() local
5255 struct lpfc_hba *phba = vport->phba; in lpfc_disc_timeout()
5262 spin_lock_irqsave(&vport->work_port_lock, flags); in lpfc_disc_timeout()
5263 tmo_posted = vport->work_port_events & WORKER_DISC_TMO; in lpfc_disc_timeout()
5265 vport->work_port_events |= WORKER_DISC_TMO; in lpfc_disc_timeout()
5266 spin_unlock_irqrestore(&vport->work_port_lock, flags); in lpfc_disc_timeout()
5274 lpfc_disc_timeout_handler(struct lpfc_vport *vport) in lpfc_disc_timeout_handler() argument
5276 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_disc_timeout_handler()
5277 struct lpfc_hba *phba = vport->phba; in lpfc_disc_timeout_handler()
5283 if (!(vport->fc_flag & FC_DISC_TMO)) in lpfc_disc_timeout_handler()
5287 vport->fc_flag &= ~FC_DISC_TMO; in lpfc_disc_timeout_handler()
5290 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_disc_timeout_handler()
5292 vport->port_state, vport->fc_ns_retry, vport->fc_flag); in lpfc_disc_timeout_handler()
5294 switch (vport->port_state) { in lpfc_disc_timeout_handler()
5301 lpfc_printf_vlog(vport, KERN_WARNING, LOG_DISCOVERY, in lpfc_disc_timeout_handler()
5304 list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, in lpfc_disc_timeout_handler()
5312 lpfc_drop_node(vport, ndlp); in lpfc_disc_timeout_handler()
5318 lpfc_unreg_rpi(vport, ndlp); in lpfc_disc_timeout_handler()
5321 if (vport->port_state != LPFC_FLOGI) { in lpfc_disc_timeout_handler()
5323 lpfc_initial_flogi(vport); in lpfc_disc_timeout_handler()
5325 lpfc_issue_init_vfi(vport); in lpfc_disc_timeout_handler()
5334 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, in lpfc_disc_timeout_handler()
5336 vport->vpi ? "FDISC" : "FLOGI"); in lpfc_disc_timeout_handler()
5343 lpfc_disc_list_loopmap(vport); in lpfc_disc_timeout_handler()
5346 lpfc_disc_start(vport); in lpfc_disc_timeout_handler()
5352 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, in lpfc_disc_timeout_handler()
5356 ndlp = lpfc_findnode_did(vport, NameServer_DID); in lpfc_disc_timeout_handler()
5365 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, in lpfc_disc_timeout_handler()
5368 vport->fc_ns_retry, LPFC_MAX_NS_RETRY); in lpfc_disc_timeout_handler()
5370 if (vport->fc_ns_retry < LPFC_MAX_NS_RETRY) { in lpfc_disc_timeout_handler()
5372 vport->fc_ns_retry++; in lpfc_disc_timeout_handler()
5373 rc = lpfc_ns_cmd(vport, SLI_CTNS_GID_FT, in lpfc_disc_timeout_handler()
5374 vport->fc_ns_retry, 0); in lpfc_disc_timeout_handler()
5378 vport->fc_ns_retry = 0; in lpfc_disc_timeout_handler()
5388 lpfc_issue_reg_vpi(phba, vport); in lpfc_disc_timeout_handler()
5390 lpfc_issue_clear_la(phba, vport); in lpfc_disc_timeout_handler()
5391 vport->port_state = LPFC_VPORT_READY; in lpfc_disc_timeout_handler()
5398 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, in lpfc_disc_timeout_handler()
5409 initlinkmbox->vport = vport; in lpfc_disc_timeout_handler()
5420 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, in lpfc_disc_timeout_handler()
5422 lpfc_disc_flush_list(vport); in lpfc_disc_timeout_handler()
5430 lpfc_issue_reg_vpi(phba, vport); in lpfc_disc_timeout_handler()
5432 lpfc_issue_clear_la(phba, vport); in lpfc_disc_timeout_handler()
5433 vport->port_state = LPFC_VPORT_READY; in lpfc_disc_timeout_handler()
5439 if (vport->fc_flag & FC_RSCN_MODE) { in lpfc_disc_timeout_handler()
5440 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, in lpfc_disc_timeout_handler()
5443 vport->fc_ns_retry, LPFC_MAX_NS_RETRY); in lpfc_disc_timeout_handler()
5446 lpfc_els_flush_cmd(vport); in lpfc_disc_timeout_handler()
5448 lpfc_els_flush_rscn(vport); in lpfc_disc_timeout_handler()
5449 lpfc_disc_flush_list(vport); in lpfc_disc_timeout_handler()
5454 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, in lpfc_disc_timeout_handler()
5456 "vport State x%x\n", vport->port_state); in lpfc_disc_timeout_handler()
5463 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, in lpfc_disc_timeout_handler()
5469 lpfc_issue_clear_la(phba, vport); in lpfc_disc_timeout_handler()
5477 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, in lpfc_disc_timeout_handler()
5488 lpfc_disc_flush_list(vport); in lpfc_disc_timeout_handler()
5492 vport->port_state = LPFC_VPORT_READY; in lpfc_disc_timeout_handler()
5510 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_fdmi_reg_login() local
5519 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); in lpfc_mbx_cmpl_fdmi_reg_login()
5520 lpfc_printf_vlog(vport, KERN_INFO, LOG_SLI, in lpfc_mbx_cmpl_fdmi_reg_login()
5531 if (vport->cfg_fdmi_on & LPFC_FDMI_REG_DELAY) in lpfc_mbx_cmpl_fdmi_reg_login()
5532 mod_timer(&vport->fc_fdmitmo, in lpfc_mbx_cmpl_fdmi_reg_login()
5535 lpfc_fdmi_cmd(vport, ndlp, SLI_MGMT_DHBA); in lpfc_mbx_cmpl_fdmi_reg_login()
5568 __lpfc_find_node(struct lpfc_vport *vport, node_filter filter, void *param) in __lpfc_find_node() argument
5572 list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) { in __lpfc_find_node()
5574 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in __lpfc_find_node()
5582 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in __lpfc_find_node()
5592 __lpfc_findnode_rpi(struct lpfc_vport *vport, uint16_t rpi) in __lpfc_findnode_rpi() argument
5594 return __lpfc_find_node(vport, lpfc_filter_by_rpi, &rpi); in __lpfc_findnode_rpi()
5602 lpfc_findnode_wwpn(struct lpfc_vport *vport, struct lpfc_name *wwpn) in lpfc_findnode_wwpn() argument
5604 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_findnode_wwpn()
5608 ndlp = __lpfc_find_node(vport, lpfc_filter_by_wwpn, wwpn); in lpfc_findnode_wwpn()
5619 lpfc_findnode_rpi(struct lpfc_vport *vport, uint16_t rpi) in lpfc_findnode_rpi() argument
5621 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_findnode_rpi()
5625 ndlp = __lpfc_findnode_rpi(vport, rpi); in lpfc_findnode_rpi()
5646 struct lpfc_vport *vport; in lpfc_find_vport_by_vpid() local
5670 list_for_each_entry(vport, &phba->port_list, listentry) { in lpfc_find_vport_by_vpid()
5671 if (vport->vpi == i) { in lpfc_find_vport_by_vpid()
5673 return vport; in lpfc_find_vport_by_vpid()
5681 lpfc_nlp_init(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, in lpfc_nlp_init() argument
5686 lpfc_initialize_node(vport, ndlp, did); in lpfc_nlp_init()
5688 if (vport->phba->sli_rev == LPFC_SLI_REV4) { in lpfc_nlp_init()
5689 ndlp->nlp_rpi = lpfc_sli4_alloc_rpi(vport->phba); in lpfc_nlp_init()
5690 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in lpfc_nlp_init()
5698 mempool_alloc(vport->phba->active_rrq_pool, in lpfc_nlp_init()
5707 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_NODE, in lpfc_nlp_init()
5725 lpfc_debugfs_disc_trc(ndlp->vport, LPFC_DISC_TRC_NODE, in lpfc_nlp_release()
5729 lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_NODE, in lpfc_nlp_release()
5736 lpfc_nlp_remove(ndlp->vport, ndlp); in lpfc_nlp_release()
5767 lpfc_debugfs_disc_trc(ndlp->vport, LPFC_DISC_TRC_NODE, in lpfc_nlp_get()
5779 lpfc_printf_vlog(ndlp->vport, KERN_WARNING, LOG_NODE, in lpfc_nlp_get()
5807 lpfc_debugfs_disc_trc(ndlp->vport, LPFC_DISC_TRC_NODE, in lpfc_nlp_put()
5819 lpfc_printf_vlog(ndlp->vport, KERN_WARNING, LOG_NODE, in lpfc_nlp_put()
5832 lpfc_printf_vlog(ndlp->vport, KERN_WARNING, LOG_NODE, in lpfc_nlp_put()
5869 lpfc_debugfs_disc_trc(ndlp->vport, LPFC_DISC_TRC_NODE, in lpfc_nlp_not_used()
5949 struct lpfc_vport *vport = mboxq->vport; in lpfc_unregister_vfi_cmpl() local
5950 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_unregister_vfi_cmpl()
5956 mboxq->u.mb.mbxStatus, vport->port_state); in lpfc_unregister_vfi_cmpl()
5975 struct lpfc_vport *vport = mboxq->vport; in lpfc_unregister_fcfi_cmpl() local
5981 mboxq->u.mb.mbxStatus, vport->port_state); in lpfc_unregister_fcfi_cmpl()
6076 mbox->vport = phba->pport; in lpfc_sli4_unregister_fcf()