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
120 vport = ndlp->vport; in lpfc_dev_loss_tmo_callbk()
121 phba = vport->phba; in lpfc_dev_loss_tmo_callbk()
123 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_RPORT, in lpfc_dev_loss_tmo_callbk()
127 lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_NODE, in lpfc_dev_loss_tmo_callbk()
135 if (vport->load_flag & FC_UNLOADING) { in lpfc_dev_loss_tmo_callbk()
151 lpfc_printf_vlog(vport, KERN_ERR, LOG_NODE, in lpfc_dev_loss_tmo_callbk()
159 lpfc_printf_vlog(vport, KERN_ERR, LOG_NODE, in lpfc_dev_loss_tmo_callbk()
165 shost = lpfc_shost_from_vport(vport); in lpfc_dev_loss_tmo_callbk()
201 struct lpfc_vport *vport; in lpfc_dev_loss_tmo_handler() local
210 vport = ndlp->vport; in lpfc_dev_loss_tmo_handler()
211 shost = lpfc_shost_from_vport(vport); in lpfc_dev_loss_tmo_handler()
221 phba = vport->phba; in lpfc_dev_loss_tmo_handler()
226 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_RPORT, in lpfc_dev_loss_tmo_handler()
230 lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_NODE, in lpfc_dev_loss_tmo_handler()
245 if (vport->load_flag & FC_UNLOADING) { in lpfc_dev_loss_tmo_handler()
248 lpfc_sli_abort_iocb(vport, in lpfc_dev_loss_tmo_handler()
263 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_dev_loss_tmo_handler()
285 lpfc_sli_abort_iocb(vport, &phba->sli.ring[phba->sli.fcp_ring], in lpfc_dev_loss_tmo_handler()
290 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, in lpfc_dev_loss_tmo_handler()
299 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_dev_loss_tmo_handler()
309 if (!(vport->load_flag & FC_UNLOADING) && in lpfc_dev_loss_tmo_handler()
315 lpfc_disc_state_machine(vport, ndlp, NULL, NLP_EVT_DEVICE_RM); in lpfc_dev_loss_tmo_handler()
457 shost = lpfc_shost_from_vport(fast_evt_data->vport); in lpfc_send_fastpath_evt()
608 struct lpfc_vport *vport; in lpfc_work_done() local
658 vport = phba->pport; in lpfc_work_done()
660 vport = vports[i]; in lpfc_work_done()
661 if (vport == NULL) in lpfc_work_done()
663 spin_lock_irq(&vport->work_port_lock); in lpfc_work_done()
664 work_port_events = vport->work_port_events; in lpfc_work_done()
665 vport->work_port_events &= ~work_port_events; in lpfc_work_done()
666 spin_unlock_irq(&vport->work_port_lock); in lpfc_work_done()
668 lpfc_disc_timeout_handler(vport); in lpfc_work_done()
670 lpfc_els_timeout_handler(vport); in lpfc_work_done()
678 lpfc_fdmi_timeout_handler(vport); in lpfc_work_done()
682 lpfc_delayed_disc_timeout_handler(vport); in lpfc_work_done()
798 lpfc_cleanup_rpis(struct lpfc_vport *vport, int remove) in lpfc_cleanup_rpis() argument
800 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_cleanup_rpis()
801 struct lpfc_hba *phba = vport->phba; in lpfc_cleanup_rpis()
804 list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, nlp_listp) { in lpfc_cleanup_rpis()
810 ((vport->port_type == LPFC_NPIV_PORT) && in lpfc_cleanup_rpis()
812 lpfc_unreg_rpi(vport, ndlp); in lpfc_cleanup_rpis()
818 lpfc_disc_state_machine(vport, ndlp, NULL, in lpfc_cleanup_rpis()
825 lpfc_sli4_unreg_all_rpis(vport); in lpfc_cleanup_rpis()
826 lpfc_mbx_unreg_vpi(vport); in lpfc_cleanup_rpis()
828 vport->fc_flag |= FC_VPORT_NEEDS_REG_VPI; in lpfc_cleanup_rpis()
834 lpfc_port_link_failure(struct lpfc_vport *vport) in lpfc_port_link_failure() argument
836 lpfc_vport_set_state(vport, FC_VPORT_LINKDOWN); in lpfc_port_link_failure()
839 lpfc_cleanup_rcv_buffers(vport); in lpfc_port_link_failure()
842 lpfc_els_flush_rscn(vport); in lpfc_port_link_failure()
845 lpfc_els_flush_cmd(vport); in lpfc_port_link_failure()
847 lpfc_cleanup_rpis(vport, 0); in lpfc_port_link_failure()
850 lpfc_can_disctmo(vport); in lpfc_port_link_failure()
854 lpfc_linkdown_port(struct lpfc_vport *vport) in lpfc_linkdown_port() argument
856 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_linkdown_port()
860 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_linkdown_port()
862 vport->port_state, vport->fc_ns_retry, vport->fc_flag); in lpfc_linkdown_port()
864 lpfc_port_link_failure(vport); in lpfc_linkdown_port()
868 vport->fc_flag &= ~FC_DISC_DELAYED; in lpfc_linkdown_port()
870 del_timer_sync(&vport->delayed_disc_tmo); in lpfc_linkdown_port()
876 struct lpfc_vport *vport = phba->pport; in lpfc_linkdown() local
877 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_linkdown()
908 mb->vport = vport; in lpfc_linkdown()
923 mb->vport = vport; in lpfc_linkdown()
938 lpfc_linkup_cleanup_nodes(struct lpfc_vport *vport) in lpfc_linkup_cleanup_nodes() argument
942 list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) { in lpfc_linkup_cleanup_nodes()
952 lpfc_unreg_rpi(vport, ndlp); in lpfc_linkup_cleanup_nodes()
953 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); in lpfc_linkup_cleanup_nodes()
958 lpfc_unreg_rpi(vport, ndlp); in lpfc_linkup_cleanup_nodes()
964 lpfc_linkup_port(struct lpfc_vport *vport) in lpfc_linkup_port() argument
966 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_linkup_port()
967 struct lpfc_hba *phba = vport->phba; in lpfc_linkup_port()
969 if ((vport->load_flag & FC_UNLOADING) != 0) in lpfc_linkup_port()
972 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_linkup_port()
978 (vport != phba->pport)) in lpfc_linkup_port()
984 vport->fc_flag &= ~(FC_PT2PT | FC_PT2PT_PLOGI | FC_ABORT_DISCOVERY | in lpfc_linkup_port()
986 vport->fc_flag |= FC_NDISC_ACTIVE; in lpfc_linkup_port()
987 vport->fc_ns_retry = 0; in lpfc_linkup_port()
990 if (vport->fc_flag & FC_LBIT) in lpfc_linkup_port()
991 lpfc_linkup_cleanup_nodes(vport); in lpfc_linkup_port()
1025 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_clear_la() local
1026 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_mbx_cmpl_clear_la()
1039 lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX, in lpfc_mbx_cmpl_clear_la()
1042 mb->mbxStatus, vport->port_state); in lpfc_mbx_cmpl_clear_la()
1047 if (vport->port_type == LPFC_PHYSICAL_PORT) in lpfc_mbx_cmpl_clear_la()
1062 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_mbx_cmpl_clear_la()
1067 vport->fc_flag &= ~FC_ABORT_DISCOVERY; in lpfc_mbx_cmpl_clear_la()
1070 lpfc_can_disctmo(vport); in lpfc_mbx_cmpl_clear_la()
1089 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_local_config_link() local
1103 vport->fc_flag & FC_PUBLIC_LOOP && in lpfc_mbx_cmpl_local_config_link()
1104 !(vport->fc_flag & FC_LBIT)) { in lpfc_mbx_cmpl_local_config_link()
1109 lpfc_set_disctmo(vport); in lpfc_mbx_cmpl_local_config_link()
1116 if (vport->port_state != LPFC_FLOGI || vport->fc_flag & FC_PT2PT_PLOGI) in lpfc_mbx_cmpl_local_config_link()
1117 lpfc_initial_flogi(vport); in lpfc_mbx_cmpl_local_config_link()
1121 lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX, in lpfc_mbx_cmpl_local_config_link()
1124 pmb->u.mb.mbxStatus, vport->port_state); in lpfc_mbx_cmpl_local_config_link()
1129 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, in lpfc_mbx_cmpl_local_config_link()
1131 vport->port_state); in lpfc_mbx_cmpl_local_config_link()
1133 lpfc_issue_clear_la(phba, vport); in lpfc_mbx_cmpl_local_config_link()
1162 struct lpfc_vport *vport = mboxq->vport; in lpfc_mbx_cmpl_reg_fcfi() local
1165 lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX, in lpfc_mbx_cmpl_reg_fcfi()
1168 mboxq->u.mb.mbxStatus, vport->port_state); in lpfc_mbx_cmpl_reg_fcfi()
1188 if (vport->port_state != LPFC_FLOGI) { in lpfc_mbx_cmpl_reg_fcfi()
1191 lpfc_issue_init_vfi(vport); in lpfc_mbx_cmpl_reg_fcfi()
1458 fcf_mbxq->vport = phba->pport; in lpfc_register_fcf()
1934 int lpfc_sli4_fcf_rr_next_proc(struct lpfc_vport *vport, uint16_t fcf_index) in lpfc_sli4_fcf_rr_next_proc() argument
1936 struct lpfc_hba *phba = vport->phba; in lpfc_sli4_fcf_rr_next_proc()
1978 lpfc_can_disctmo(vport); in lpfc_sli4_fcf_rr_next_proc()
2683 struct lpfc_vport *vport = mboxq->vport; in lpfc_init_vfi_cmpl() local
2693 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_init_vfi_cmpl()
2698 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_init_vfi_cmpl()
2702 lpfc_initial_flogi(vport); in lpfc_init_vfi_cmpl()
2715 lpfc_issue_init_vfi(struct lpfc_vport *vport) in lpfc_issue_init_vfi() argument
2719 struct lpfc_hba *phba = vport->phba; in lpfc_issue_init_vfi()
2723 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_issue_init_vfi()
2728 lpfc_init_vfi(mboxq, vport); in lpfc_issue_init_vfi()
2732 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_issue_init_vfi()
2734 mempool_free(mboxq, vport->phba->mbox_mem_pool); in lpfc_issue_init_vfi()
2748 struct lpfc_vport *vport = mboxq->vport; in lpfc_init_vpi_cmpl() local
2750 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_init_vpi_cmpl()
2753 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_init_vpi_cmpl()
2758 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_init_vpi_cmpl()
2762 vport->fc_flag &= ~FC_VPORT_NEEDS_INIT_VPI; in lpfc_init_vpi_cmpl()
2766 if ((phba->pport == vport) || (vport->port_state == LPFC_FDISC)) { in lpfc_init_vpi_cmpl()
2767 ndlp = lpfc_findnode_did(vport, Fabric_DID); in lpfc_init_vpi_cmpl()
2769 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_init_vpi_cmpl()
2774 lpfc_register_new_vport(phba, vport, ndlp); in lpfc_init_vpi_cmpl()
2780 lpfc_initial_fdisc(vport); in lpfc_init_vpi_cmpl()
2782 lpfc_vport_set_state(vport, FC_VPORT_NO_FABRIC_SUPP); in lpfc_init_vpi_cmpl()
2783 lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, in lpfc_init_vpi_cmpl()
2798 lpfc_issue_init_vpi(struct lpfc_vport *vport) in lpfc_issue_init_vpi() argument
2803 if ((vport->port_type != LPFC_PHYSICAL_PORT) && (!vport->vpi)) { in lpfc_issue_init_vpi()
2804 vpi = lpfc_alloc_vpi(vport->phba); in lpfc_issue_init_vpi()
2806 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_issue_init_vpi()
2809 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_issue_init_vpi()
2812 vport->vpi = vpi; in lpfc_issue_init_vpi()
2815 mboxq = mempool_alloc(vport->phba->mbox_mem_pool, GFP_KERNEL); in lpfc_issue_init_vpi()
2817 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_issue_init_vpi()
2822 lpfc_init_vpi(vport->phba, mboxq, vport->vpi); in lpfc_issue_init_vpi()
2823 mboxq->vport = vport; in lpfc_issue_init_vpi()
2825 rc = lpfc_sli_issue_mbox(vport->phba, mboxq, MBX_NOWAIT); in lpfc_issue_init_vpi()
2827 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_issue_init_vpi()
2829 mempool_free(mboxq, vport->phba->mbox_mem_pool); in lpfc_issue_init_vpi()
2885 struct lpfc_vport *vport = mboxq->vport; in lpfc_mbx_cmpl_reg_vfi() local
2886 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_mbx_cmpl_reg_vfi()
2896 lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX, in lpfc_mbx_cmpl_reg_vfi()
2899 mboxq->u.mb.mbxStatus, vport->port_state); in lpfc_mbx_cmpl_reg_vfi()
2902 lpfc_disc_list_loopmap(vport); in lpfc_mbx_cmpl_reg_vfi()
2904 lpfc_disc_start(vport); in lpfc_mbx_cmpl_reg_vfi()
2907 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_mbx_cmpl_reg_vfi()
2915 if (vport->fc_flag & FC_VFI_REGISTERED) in lpfc_mbx_cmpl_reg_vfi()
2917 vport->fc_flag & FC_PT2PT)) in lpfc_mbx_cmpl_reg_vfi()
2922 vport->vpi_state |= LPFC_VPI_REGISTERED; in lpfc_mbx_cmpl_reg_vfi()
2923 vport->fc_flag |= FC_VFI_REGISTERED; in lpfc_mbx_cmpl_reg_vfi()
2924 vport->fc_flag &= ~FC_VPORT_NEEDS_REG_VPI; in lpfc_mbx_cmpl_reg_vfi()
2925 vport->fc_flag &= ~FC_VPORT_NEEDS_INIT_VPI; in lpfc_mbx_cmpl_reg_vfi()
2935 lpfc_printf_vlog(vport, KERN_INFO, LOG_SLI, in lpfc_mbx_cmpl_reg_vfi()
2938 vport->port_state, vport->fc_flag, vport->fc_myDID, in lpfc_mbx_cmpl_reg_vfi()
2939 vport->phba->alpa_map[0], in lpfc_mbx_cmpl_reg_vfi()
2942 if (vport->port_state == LPFC_FABRIC_CFG_LINK) { in lpfc_mbx_cmpl_reg_vfi()
2947 if ((vport->fc_flag & FC_PT2PT) || in lpfc_mbx_cmpl_reg_vfi()
2949 !(vport->fc_flag & FC_PUBLIC_LOOP))) { in lpfc_mbx_cmpl_reg_vfi()
2952 lpfc_disc_list_loopmap(vport); in lpfc_mbx_cmpl_reg_vfi()
2954 if (vport->fc_flag & FC_PT2PT) in lpfc_mbx_cmpl_reg_vfi()
2955 vport->port_state = LPFC_VPORT_READY; in lpfc_mbx_cmpl_reg_vfi()
2957 lpfc_disc_start(vport); in lpfc_mbx_cmpl_reg_vfi()
2960 lpfc_do_scr_ns_plogi(phba, vport); in lpfc_mbx_cmpl_reg_vfi()
2976 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_read_sparam() local
2977 struct serv_parm *sp = &vport->fc_sparam; in lpfc_mbx_cmpl_read_sparam()
2983 lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX, in lpfc_mbx_cmpl_read_sparam()
2986 mb->mbxStatus, vport->port_state); in lpfc_mbx_cmpl_read_sparam()
2991 memcpy((uint8_t *) &vport->fc_sparam, (uint8_t *) mp->virt, in lpfc_mbx_cmpl_read_sparam()
3005 lpfc_update_vport_wwn(vport); in lpfc_mbx_cmpl_read_sparam()
3006 if (vport->port_type == LPFC_PHYSICAL_PORT) { in lpfc_mbx_cmpl_read_sparam()
3007 memcpy(&phba->wwnn, &vport->fc_nodename, sizeof(phba->wwnn)); in lpfc_mbx_cmpl_read_sparam()
3008 memcpy(&phba->wwpn, &vport->fc_portname, sizeof(phba->wwnn)); in lpfc_mbx_cmpl_read_sparam()
3020 lpfc_issue_clear_la(phba, vport); in lpfc_mbx_cmpl_read_sparam()
3028 struct lpfc_vport *vport = phba->pport; in lpfc_mbx_process_link_up() local
3065 shost = lpfc_shost_from_vport(vport); in lpfc_mbx_process_link_up()
3080 vport->fc_myDID = bf_get(lpfc_mbx_read_top_alpa_granted, la); in lpfc_mbx_process_link_up()
3086 if (vport->cfg_log_verbose & LOG_LINK_EVENT) { in lpfc_mbx_process_link_up()
3126 vport->fc_myDID = phba->fc_pref_DID; in lpfc_mbx_process_link_up()
3133 vport->fc_flag |= fc_flags; in lpfc_mbx_process_link_up()
3147 sparam_mbox->vport = vport; in lpfc_mbx_process_link_up()
3162 vport->port_state = LPFC_LOCAL_CFG_LINK; in lpfc_mbx_process_link_up()
3164 cfglink_mbox->vport = vport; in lpfc_mbx_process_link_up()
3172 vport->port_state = LPFC_VPORT_UNKNOWN; in lpfc_mbx_process_link_up()
3232 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_mbx_process_link_up()
3233 lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX, in lpfc_mbx_process_link_up()
3235 vport->port_state, sparam_mbox, cfglink_mbox); in lpfc_mbx_process_link_up()
3236 lpfc_issue_clear_la(phba, vport); in lpfc_mbx_process_link_up()
3275 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_read_topology() local
3276 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_mbx_cmpl_read_topology()
3287 mb->mbxStatus, vport->port_state); in lpfc_mbx_cmpl_read_topology()
3299 vport->fc_flag |= FC_BYPASSED_MODE; in lpfc_mbx_cmpl_read_topology()
3301 vport->fc_flag &= ~FC_BYPASSED_MODE; in lpfc_mbx_cmpl_read_topology()
3357 phba->pport->port_state, vport->fc_flag); in lpfc_mbx_cmpl_read_topology()
3363 phba->pport->port_state, vport->fc_flag, in lpfc_mbx_cmpl_read_topology()
3376 phba->pport->port_state, vport->fc_flag); in lpfc_mbx_cmpl_read_topology()
3385 phba->pport->port_state, vport->fc_flag); in lpfc_mbx_cmpl_read_topology()
3400 lpfc_issue_clear_la(phba, vport); in lpfc_mbx_cmpl_read_topology()
3422 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_reg_login() local
3425 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_mbx_cmpl_reg_login()
3430 lpfc_printf_vlog(vport, KERN_INFO, LOG_SLI, in lpfc_mbx_cmpl_reg_login()
3453 lpfc_disc_state_machine(vport, ndlp, pmb, in lpfc_mbx_cmpl_reg_login()
3471 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_unreg_vpi() local
3472 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_mbx_cmpl_unreg_vpi()
3477 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in lpfc_mbx_cmpl_unreg_vpi()
3483 lpfc_printf_vlog(vport, KERN_ERR, LOG_NODE, in lpfc_mbx_cmpl_unreg_vpi()
3485 vport->vpi, mb->mbxStatus); in lpfc_mbx_cmpl_unreg_vpi()
3491 vport->vpi_state &= ~LPFC_VPI_REGISTERED; in lpfc_mbx_cmpl_unreg_vpi()
3492 vport->fc_flag |= FC_VPORT_NEEDS_REG_VPI; in lpfc_mbx_cmpl_unreg_vpi()
3494 vport->unreg_vpi_cmpl = VPORT_OK; in lpfc_mbx_cmpl_unreg_vpi()
3496 lpfc_cleanup_vports_rrqs(vport, NULL); in lpfc_mbx_cmpl_unreg_vpi()
3501 if ((vport->load_flag & FC_UNLOADING) && (vport != phba->pport)) in lpfc_mbx_cmpl_unreg_vpi()
3506 lpfc_mbx_unreg_vpi(struct lpfc_vport *vport) in lpfc_mbx_unreg_vpi() argument
3508 struct lpfc_hba *phba = vport->phba; in lpfc_mbx_unreg_vpi()
3516 lpfc_unreg_vpi(phba, vport->vpi, mbox); in lpfc_mbx_unreg_vpi()
3517 mbox->vport = vport; in lpfc_mbx_unreg_vpi()
3521 lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX | LOG_VPORT, in lpfc_mbx_unreg_vpi()
3524 vport->unreg_vpi_cmpl = VPORT_ERROR; in lpfc_mbx_unreg_vpi()
3533 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_reg_vpi() local
3534 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_mbx_cmpl_reg_vpi()
3541 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in lpfc_mbx_cmpl_reg_vpi()
3544 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_mbx_cmpl_reg_vpi()
3546 vport->fc_flag &= ~(FC_FABRIC | FC_PUBLIC_LOOP); in lpfc_mbx_cmpl_reg_vpi()
3548 vport->fc_myDID = 0; in lpfc_mbx_cmpl_reg_vpi()
3553 vport->vpi_state |= LPFC_VPI_REGISTERED; in lpfc_mbx_cmpl_reg_vpi()
3554 vport->fc_flag &= ~FC_VPORT_NEEDS_REG_VPI; in lpfc_mbx_cmpl_reg_vpi()
3556 vport->num_disc_nodes = 0; in lpfc_mbx_cmpl_reg_vpi()
3558 if (vport->fc_npr_cnt) in lpfc_mbx_cmpl_reg_vpi()
3559 lpfc_els_disc_plogi(vport); in lpfc_mbx_cmpl_reg_vpi()
3561 if (!vport->num_disc_nodes) { in lpfc_mbx_cmpl_reg_vpi()
3563 vport->fc_flag &= ~FC_NDISC_ACTIVE; in lpfc_mbx_cmpl_reg_vpi()
3565 lpfc_can_disctmo(vport); in lpfc_mbx_cmpl_reg_vpi()
3567 vport->port_state = LPFC_VPORT_READY; in lpfc_mbx_cmpl_reg_vpi()
3592 struct lpfc_vport *vport; in lpfc_create_static_vport() local
3628 pmb->vport = phba->pport; in lpfc_create_static_vport()
3701 vport = *(struct lpfc_vport **)new_fc_vport->dd_data; in lpfc_create_static_vport()
3702 vport->vport_flag |= STATIC_VPORT; in lpfc_create_static_vport()
3728 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_fabric_reg_login() local
3739 lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX, in lpfc_mbx_cmpl_fabric_reg_login()
3748 lpfc_disc_list_loopmap(vport); in lpfc_mbx_cmpl_fabric_reg_login()
3751 lpfc_disc_start(vport); in lpfc_mbx_cmpl_fabric_reg_login()
3759 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_mbx_cmpl_fabric_reg_login()
3771 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); in lpfc_mbx_cmpl_fabric_reg_login()
3773 if (vport->port_state == LPFC_FABRIC_CFG_LINK) { in lpfc_mbx_cmpl_fabric_reg_login()
3776 if (!(vport->fc_flag & FC_LOGO_RCVD_DID_CHNG)) in lpfc_mbx_cmpl_fabric_reg_login()
3779 shost = lpfc_shost_from_vport(vport); in lpfc_mbx_cmpl_fabric_reg_login()
3781 vport->fc_flag &= ~FC_LOGO_RCVD_DID_CHNG ; in lpfc_mbx_cmpl_fabric_reg_login()
3784 lpfc_do_scr_ns_plogi(phba, vport); in lpfc_mbx_cmpl_fabric_reg_login()
3810 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_ns_reg_login() local
3817 lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, in lpfc_mbx_cmpl_ns_reg_login()
3836 lpfc_disc_list_loopmap(vport); in lpfc_mbx_cmpl_ns_reg_login()
3839 lpfc_disc_start(vport); in lpfc_mbx_cmpl_ns_reg_login()
3842 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_mbx_cmpl_ns_reg_login()
3850 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); in lpfc_mbx_cmpl_ns_reg_login()
3851 lpfc_printf_vlog(vport, KERN_INFO, LOG_SLI, in lpfc_mbx_cmpl_ns_reg_login()
3857 if (vport->port_state < LPFC_VPORT_READY) { in lpfc_mbx_cmpl_ns_reg_login()
3859 lpfc_ns_cmd(vport, SLI_CTNS_RNN_ID, 0, 0); in lpfc_mbx_cmpl_ns_reg_login()
3860 lpfc_ns_cmd(vport, SLI_CTNS_RSNN_NN, 0, 0); in lpfc_mbx_cmpl_ns_reg_login()
3861 lpfc_ns_cmd(vport, SLI_CTNS_RSPN_ID, 0, 0); in lpfc_mbx_cmpl_ns_reg_login()
3862 lpfc_ns_cmd(vport, SLI_CTNS_RFT_ID, 0, 0); in lpfc_mbx_cmpl_ns_reg_login()
3863 lpfc_ns_cmd(vport, SLI_CTNS_RFF_ID, 0, 0); in lpfc_mbx_cmpl_ns_reg_login()
3866 lpfc_issue_els_scr(vport, SCR_DID, 0); in lpfc_mbx_cmpl_ns_reg_login()
3869 vport->fc_ns_retry = 0; in lpfc_mbx_cmpl_ns_reg_login()
3871 if (lpfc_ns_cmd(vport, SLI_CTNS_GID_FT, 0, 0)) { in lpfc_mbx_cmpl_ns_reg_login()
3888 lpfc_register_remote_port(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) in lpfc_register_remote_port() argument
3890 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_register_remote_port()
3894 struct lpfc_hba *phba = vport->phba; in lpfc_register_remote_port()
3921 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_RPORT, in lpfc_register_remote_port()
3926 if (vport->load_flag & FC_UNLOADING) in lpfc_register_remote_port()
3950 lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_NODE, in lpfc_register_remote_port()
3966 lpfc_debugfs_disc_trc(ndlp->vport, LPFC_DISC_TRC_RPORT, in lpfc_unregister_remote_port()
3970 lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_NODE, in lpfc_unregister_remote_port()
3980 lpfc_nlp_counters(struct lpfc_vport *vport, int state, int count) in lpfc_nlp_counters() argument
3982 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_nlp_counters()
3987 vport->fc_unused_cnt += count; in lpfc_nlp_counters()
3990 vport->fc_plogi_cnt += count; in lpfc_nlp_counters()
3993 vport->fc_adisc_cnt += count; in lpfc_nlp_counters()
3996 vport->fc_reglogin_cnt += count; in lpfc_nlp_counters()
3999 vport->fc_prli_cnt += count; in lpfc_nlp_counters()
4002 vport->fc_unmap_cnt += count; in lpfc_nlp_counters()
4005 vport->fc_map_cnt += count; in lpfc_nlp_counters()
4008 if (vport->fc_npr_cnt == 0 && count == -1) in lpfc_nlp_counters()
4009 vport->fc_npr_cnt = 0; in lpfc_nlp_counters()
4011 vport->fc_npr_cnt += count; in lpfc_nlp_counters()
4018 lpfc_nlp_state_cleanup(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, in lpfc_nlp_state_cleanup() argument
4021 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_nlp_state_cleanup()
4035 vport->phba->nport_event_cnt++; in lpfc_nlp_state_cleanup()
4041 vport->phba->nport_event_cnt++; in lpfc_nlp_state_cleanup()
4047 lpfc_register_remote_port(vport, ndlp); in lpfc_nlp_state_cleanup()
4050 (vport->stat_data_enabled)) { in lpfc_nlp_state_cleanup()
4060 lpfc_printf_vlog(vport, KERN_ERR, LOG_NODE, in lpfc_nlp_state_cleanup()
4078 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); in lpfc_nlp_state_cleanup()
4105 lpfc_nlp_set_state(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, in lpfc_nlp_set_state() argument
4108 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_nlp_set_state()
4112 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in lpfc_nlp_set_state()
4118 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_NODE, in lpfc_nlp_set_state()
4124 lpfc_cancel_retry_delay_tmo(vport, ndlp); in lpfc_nlp_set_state()
4132 list_add_tail(&ndlp->nlp_listp, &vport->fc_nodes); in lpfc_nlp_set_state()
4135 lpfc_nlp_counters(vport, old_state, -1); in lpfc_nlp_set_state()
4138 lpfc_nlp_counters(vport, state, 1); in lpfc_nlp_set_state()
4139 lpfc_nlp_state_cleanup(vport, ndlp, old_state, state); in lpfc_nlp_set_state()
4143 lpfc_enqueue_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) in lpfc_enqueue_node() argument
4145 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_enqueue_node()
4149 list_add_tail(&ndlp->nlp_listp, &vport->fc_nodes); in lpfc_enqueue_node()
4155 lpfc_dequeue_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) in lpfc_dequeue_node() argument
4157 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_dequeue_node()
4159 lpfc_cancel_retry_delay_tmo(vport, ndlp); in lpfc_dequeue_node()
4161 lpfc_nlp_counters(vport, ndlp->nlp_state, -1); in lpfc_dequeue_node()
4165 lpfc_nlp_state_cleanup(vport, ndlp, ndlp->nlp_state, in lpfc_dequeue_node()
4170 lpfc_disable_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) in lpfc_disable_node() argument
4172 lpfc_cancel_retry_delay_tmo(vport, ndlp); in lpfc_disable_node()
4174 lpfc_nlp_counters(vport, ndlp->nlp_state, -1); in lpfc_disable_node()
4175 lpfc_nlp_state_cleanup(vport, ndlp, ndlp->nlp_state, in lpfc_disable_node()
4193 lpfc_initialize_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, in lpfc_initialize_node() argument
4202 ndlp->vport = vport; in lpfc_initialize_node()
4203 ndlp->phba = vport->phba; in lpfc_initialize_node()
4208 ndlp->cmd_qdepth = vport->cfg_tgt_queue_depth; in lpfc_initialize_node()
4212 lpfc_enable_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, in lpfc_enable_node() argument
4215 struct lpfc_hba *phba = vport->phba; in lpfc_enable_node()
4227 lpfc_printf_vlog(vport, KERN_WARNING, LOG_NODE, in lpfc_enable_node()
4237 lpfc_printf_vlog(vport, KERN_WARNING, LOG_NODE, in lpfc_enable_node()
4253 lpfc_initialize_node(vport, ndlp, did); in lpfc_enable_node()
4259 if (vport->phba->sli_rev == LPFC_SLI_REV4) { in lpfc_enable_node()
4260 ndlp->nlp_rpi = lpfc_sli4_alloc_rpi(vport->phba); in lpfc_enable_node()
4261 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in lpfc_enable_node()
4271 lpfc_nlp_set_state(vport, ndlp, state); in lpfc_enable_node()
4273 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_NODE, in lpfc_enable_node()
4280 lpfc_drop_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) in lpfc_drop_node() argument
4291 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNUSED_NODE); in lpfc_drop_node()
4292 if (vport->phba->sli_rev == LPFC_SLI_REV4) { in lpfc_drop_node()
4293 lpfc_cleanup_vports_rrqs(vport, ndlp); in lpfc_drop_node()
4294 lpfc_unreg_rpi(vport, ndlp); in lpfc_drop_node()
4305 lpfc_set_disctmo(struct lpfc_vport *vport) in lpfc_set_disctmo() argument
4307 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_set_disctmo()
4308 struct lpfc_hba *phba = vport->phba; in lpfc_set_disctmo()
4311 if (vport->port_state == LPFC_LOCAL_CFG_LINK) { in lpfc_set_disctmo()
4322 if (!timer_pending(&vport->fc_disctmo)) { in lpfc_set_disctmo()
4323 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_set_disctmo()
4325 tmo, vport->port_state, vport->fc_flag); in lpfc_set_disctmo()
4328 mod_timer(&vport->fc_disctmo, jiffies + msecs_to_jiffies(1000 * tmo)); in lpfc_set_disctmo()
4330 vport->fc_flag |= FC_DISC_TMO; in lpfc_set_disctmo()
4334 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_set_disctmo()
4337 vport->port_state, tmo, in lpfc_set_disctmo()
4338 (unsigned long)&vport->fc_disctmo, vport->fc_plogi_cnt, in lpfc_set_disctmo()
4339 vport->fc_adisc_cnt); in lpfc_set_disctmo()
4348 lpfc_can_disctmo(struct lpfc_vport *vport) in lpfc_can_disctmo() argument
4350 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_can_disctmo()
4353 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_can_disctmo()
4355 vport->port_state, vport->fc_ns_retry, vport->fc_flag); in lpfc_can_disctmo()
4358 if (vport->fc_flag & FC_DISC_TMO) { in lpfc_can_disctmo()
4360 vport->fc_flag &= ~FC_DISC_TMO; in lpfc_can_disctmo()
4362 del_timer_sync(&vport->fc_disctmo); in lpfc_can_disctmo()
4363 spin_lock_irqsave(&vport->work_port_lock, iflags); in lpfc_can_disctmo()
4364 vport->work_port_events &= ~WORKER_DISC_TMO; in lpfc_can_disctmo()
4365 spin_unlock_irqrestore(&vport->work_port_lock, iflags); in lpfc_can_disctmo()
4369 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_can_disctmo()
4372 vport->port_state, vport->fc_flag, in lpfc_can_disctmo()
4373 vport->fc_plogi_cnt, vport->fc_adisc_cnt); in lpfc_can_disctmo()
4389 struct lpfc_vport *vport = ndlp->vport; in lpfc_check_sli_ndlp() local
4391 if (iocb->vport != vport) in lpfc_check_sli_ndlp()
4485 struct lpfc_vport *vport = pmb->vport; in lpfc_nlp_logo_unreg() local
4491 lpfc_issue_els_logo(vport, ndlp, 0); in lpfc_nlp_logo_unreg()
4505 lpfc_unreg_rpi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) in lpfc_unreg_rpi() argument
4507 struct lpfc_hba *phba = vport->phba; in lpfc_unreg_rpi()
4515 lpfc_printf_vlog(vport, KERN_INFO, LOG_SLI, in lpfc_unreg_rpi()
4528 lpfc_unreg_login(phba, vport->vpi, rpi, mbox); in lpfc_unreg_rpi()
4529 mbox->vport = vport; in lpfc_unreg_rpi()
4535 (!(vport->load_flag & FC_UNLOADING)) && in lpfc_unreg_rpi()
4609 lpfc_unreg_all_rpis(struct lpfc_vport *vport) in lpfc_unreg_all_rpis() argument
4611 struct lpfc_hba *phba = vport->phba; in lpfc_unreg_all_rpis()
4616 lpfc_sli4_unreg_all_rpis(vport); in lpfc_unreg_all_rpis()
4622 lpfc_unreg_login(phba, vport->vpi, LPFC_UNREG_ALL_RPIS_VPORT, in lpfc_unreg_all_rpis()
4624 mbox->vport = vport; in lpfc_unreg_all_rpis()
4632 lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX | LOG_VPORT, in lpfc_unreg_all_rpis()
4639 lpfc_unreg_default_rpis(struct lpfc_vport *vport) in lpfc_unreg_default_rpis() argument
4641 struct lpfc_hba *phba = vport->phba; in lpfc_unreg_default_rpis()
4647 lpfc_unreg_did(phba, vport->vpi, LPFC_UNREG_ALL_DFLT_RPIS, in lpfc_unreg_default_rpis()
4649 mbox->vport = vport; in lpfc_unreg_default_rpis()
4657 lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX | LOG_VPORT, in lpfc_unreg_default_rpis()
4669 lpfc_cleanup_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) in lpfc_cleanup_node() argument
4671 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_cleanup_node()
4672 struct lpfc_hba *phba = vport->phba; in lpfc_cleanup_node()
4677 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in lpfc_cleanup_node()
4683 lpfc_printf_vlog(vport, KERN_WARNING, LOG_NODE, in lpfc_cleanup_node()
4688 lpfc_dequeue_node(vport, ndlp); in lpfc_cleanup_node()
4690 lpfc_printf_vlog(vport, KERN_WARNING, LOG_NODE, in lpfc_cleanup_node()
4695 lpfc_disable_node(vport, ndlp); in lpfc_cleanup_node()
4753 lpfc_cleanup_vports_rrqs(vport, ndlp); in lpfc_cleanup_node()
4754 lpfc_unreg_rpi(vport, ndlp); in lpfc_cleanup_node()
4765 lpfc_nlp_remove(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) in lpfc_nlp_remove() argument
4767 struct lpfc_hba *phba = vport->phba; in lpfc_nlp_remove()
4773 lpfc_cancel_retry_delay_tmo(vport, ndlp); in lpfc_nlp_remove()
4780 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in lpfc_nlp_remove()
4787 rc = lpfc_reg_rpi(phba, vport->vpi, ndlp->nlp_DID, in lpfc_nlp_remove()
4788 (uint8_t *) &vport->fc_sparam, mbox, ndlp->nlp_rpi); in lpfc_nlp_remove()
4795 mbox->vport = vport; in lpfc_nlp_remove()
4804 lpfc_cleanup_node(vport, ndlp); in lpfc_nlp_remove()
4816 lpfc_printf_vlog(vport, KERN_WARNING, LOG_NODE, in lpfc_nlp_remove()
4829 lpfc_matchdid(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, in lpfc_matchdid() argument
4842 mydid.un.word = vport->fc_myDID; in lpfc_matchdid()
4863 vport->phba->fc_topology == in lpfc_matchdid()
4885 __lpfc_findnode_did(struct lpfc_vport *vport, uint32_t did) in __lpfc_findnode_did() argument
4890 list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) { in __lpfc_findnode_did()
4891 if (lpfc_matchdid(vport, ndlp, did)) { in __lpfc_findnode_did()
4896 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in __lpfc_findnode_did()
4907 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in __lpfc_findnode_did()
4913 lpfc_findnode_did(struct lpfc_vport *vport, uint32_t did) in lpfc_findnode_did() argument
4915 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_findnode_did()
4920 ndlp = __lpfc_findnode_did(vport, did); in lpfc_findnode_did()
4926 lpfc_setup_disc_node(struct lpfc_vport *vport, uint32_t did) in lpfc_setup_disc_node() argument
4928 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_setup_disc_node()
4931 ndlp = lpfc_findnode_did(vport, did); in lpfc_setup_disc_node()
4933 if ((vport->fc_flag & FC_RSCN_MODE) != 0 && in lpfc_setup_disc_node()
4934 lpfc_rscn_payload_check(vport, did) == 0) in lpfc_setup_disc_node()
4937 mempool_alloc(vport->phba->nlp_mem_pool, GFP_KERNEL); in lpfc_setup_disc_node()
4940 lpfc_nlp_init(vport, ndlp, did); in lpfc_setup_disc_node()
4941 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); in lpfc_setup_disc_node()
4947 ndlp = lpfc_enable_node(vport, ndlp, NLP_STE_NPR_NODE); in lpfc_setup_disc_node()
4956 if ((vport->fc_flag & FC_RSCN_MODE) && in lpfc_setup_disc_node()
4957 !(vport->fc_flag & FC_NDISC_ACTIVE)) { in lpfc_setup_disc_node()
4958 if (lpfc_rscn_payload_check(vport, did)) { in lpfc_setup_disc_node()
4968 lpfc_cancel_retry_delay_tmo(vport, ndlp); in lpfc_setup_disc_node()
4983 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); in lpfc_setup_disc_node()
4993 lpfc_disc_list_loopmap(struct lpfc_vport *vport) in lpfc_disc_list_loopmap() argument
4995 struct lpfc_hba *phba = vport->phba; in lpfc_disc_list_loopmap()
5009 if (((vport->fc_myDID & 0xff) == alpa) || (alpa == 0)) in lpfc_disc_list_loopmap()
5011 lpfc_setup_disc_node(vport, alpa); in lpfc_disc_list_loopmap()
5019 if (vport->cfg_scan_down) in lpfc_disc_list_loopmap()
5024 if ((vport->fc_myDID & 0xff) == alpa) in lpfc_disc_list_loopmap()
5026 lpfc_setup_disc_node(vport, alpa); in lpfc_disc_list_loopmap()
5033 lpfc_issue_clear_la(struct lpfc_hba *phba, struct lpfc_vport *vport) in lpfc_issue_clear_la() argument
5047 (vport->port_type != LPFC_PHYSICAL_PORT) || in lpfc_issue_clear_la()
5056 mbox->vport = vport; in lpfc_issue_clear_la()
5060 lpfc_disc_flush_list(vport); in lpfc_issue_clear_la()
5071 lpfc_issue_reg_vpi(struct lpfc_hba *phba, struct lpfc_vport *vport) in lpfc_issue_reg_vpi() argument
5077 lpfc_reg_vpi(vport, regvpimbox); in lpfc_issue_reg_vpi()
5079 regvpimbox->vport = vport; in lpfc_issue_reg_vpi()
5089 lpfc_disc_start(struct lpfc_vport *vport) in lpfc_disc_start() argument
5091 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_disc_start()
5092 struct lpfc_hba *phba = vport->phba; in lpfc_disc_start()
5097 lpfc_printf_vlog(vport, KERN_INFO, LOG_SLI, in lpfc_disc_start()
5108 if (vport->port_state < LPFC_VPORT_READY) in lpfc_disc_start()
5109 vport->port_state = LPFC_DISC_AUTH; in lpfc_disc_start()
5111 lpfc_set_disctmo(vport); in lpfc_disc_start()
5113 vport->fc_prevDID = vport->fc_myDID; in lpfc_disc_start()
5114 vport->num_disc_nodes = 0; in lpfc_disc_start()
5117 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_disc_start()
5120 vport->port_state, vport->fc_flag, vport->fc_plogi_cnt, in lpfc_disc_start()
5121 vport->fc_adisc_cnt); in lpfc_disc_start()
5124 num_sent = lpfc_els_disc_adisc(vport); in lpfc_disc_start()
5131 !(vport->fc_flag & FC_PT2PT) && in lpfc_disc_start()
5132 !(vport->fc_flag & FC_RSCN_MODE) && in lpfc_disc_start()
5134 lpfc_issue_clear_la(phba, vport); in lpfc_disc_start()
5135 lpfc_issue_reg_vpi(phba, vport); in lpfc_disc_start()
5143 if (vport->port_state < LPFC_VPORT_READY && !clear_la_pending) { in lpfc_disc_start()
5145 lpfc_issue_clear_la(phba, vport); in lpfc_disc_start()
5147 if (!(vport->fc_flag & FC_ABORT_DISCOVERY)) { in lpfc_disc_start()
5148 vport->num_disc_nodes = 0; in lpfc_disc_start()
5150 if (vport->fc_npr_cnt) in lpfc_disc_start()
5151 lpfc_els_disc_plogi(vport); in lpfc_disc_start()
5153 if (!vport->num_disc_nodes) { in lpfc_disc_start()
5155 vport->fc_flag &= ~FC_NDISC_ACTIVE; in lpfc_disc_start()
5157 lpfc_can_disctmo(vport); in lpfc_disc_start()
5160 vport->port_state = LPFC_VPORT_READY; in lpfc_disc_start()
5163 num_sent = lpfc_els_disc_plogi(vport); in lpfc_disc_start()
5168 if (vport->fc_flag & FC_RSCN_MODE) { in lpfc_disc_start()
5172 if ((vport->fc_rscn_id_cnt == 0) && in lpfc_disc_start()
5173 (!(vport->fc_flag & FC_RSCN_DISCOVERY))) { in lpfc_disc_start()
5175 vport->fc_flag &= ~FC_RSCN_MODE; in lpfc_disc_start()
5177 lpfc_can_disctmo(vport); in lpfc_disc_start()
5179 lpfc_els_handle_rscn(vport); in lpfc_disc_start()
5236 lpfc_disc_flush_list(struct lpfc_vport *vport) in lpfc_disc_flush_list() argument
5239 struct lpfc_hba *phba = vport->phba; in lpfc_disc_flush_list()
5241 if (vport->fc_plogi_cnt || vport->fc_adisc_cnt) { in lpfc_disc_flush_list()
5242 list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, in lpfc_disc_flush_list()
5255 lpfc_cleanup_discovery_resources(struct lpfc_vport *vport) in lpfc_cleanup_discovery_resources() argument
5257 lpfc_els_flush_rscn(vport); in lpfc_cleanup_discovery_resources()
5258 lpfc_els_flush_cmd(vport); in lpfc_cleanup_discovery_resources()
5259 lpfc_disc_flush_list(vport); in lpfc_cleanup_discovery_resources()
5280 struct lpfc_vport *vport = (struct lpfc_vport *) ptr; in lpfc_disc_timeout() local
5281 struct lpfc_hba *phba = vport->phba; in lpfc_disc_timeout()
5288 spin_lock_irqsave(&vport->work_port_lock, flags); in lpfc_disc_timeout()
5289 tmo_posted = vport->work_port_events & WORKER_DISC_TMO; in lpfc_disc_timeout()
5291 vport->work_port_events |= WORKER_DISC_TMO; in lpfc_disc_timeout()
5292 spin_unlock_irqrestore(&vport->work_port_lock, flags); in lpfc_disc_timeout()
5300 lpfc_disc_timeout_handler(struct lpfc_vport *vport) in lpfc_disc_timeout_handler() argument
5302 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_disc_timeout_handler()
5303 struct lpfc_hba *phba = vport->phba; in lpfc_disc_timeout_handler()
5309 if (!(vport->fc_flag & FC_DISC_TMO)) in lpfc_disc_timeout_handler()
5313 vport->fc_flag &= ~FC_DISC_TMO; in lpfc_disc_timeout_handler()
5316 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_disc_timeout_handler()
5318 vport->port_state, vport->fc_ns_retry, vport->fc_flag); in lpfc_disc_timeout_handler()
5320 switch (vport->port_state) { in lpfc_disc_timeout_handler()
5327 lpfc_printf_vlog(vport, KERN_WARNING, LOG_DISCOVERY, in lpfc_disc_timeout_handler()
5330 list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, in lpfc_disc_timeout_handler()
5338 lpfc_drop_node(vport, ndlp); in lpfc_disc_timeout_handler()
5344 lpfc_unreg_rpi(vport, ndlp); in lpfc_disc_timeout_handler()
5347 if (vport->port_state != LPFC_FLOGI) { in lpfc_disc_timeout_handler()
5349 lpfc_initial_flogi(vport); in lpfc_disc_timeout_handler()
5351 lpfc_issue_init_vfi(vport); in lpfc_disc_timeout_handler()
5360 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, in lpfc_disc_timeout_handler()
5362 vport->vpi ? "FDISC" : "FLOGI"); in lpfc_disc_timeout_handler()
5369 lpfc_disc_list_loopmap(vport); in lpfc_disc_timeout_handler()
5372 lpfc_disc_start(vport); in lpfc_disc_timeout_handler()
5378 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, in lpfc_disc_timeout_handler()
5382 ndlp = lpfc_findnode_did(vport, NameServer_DID); in lpfc_disc_timeout_handler()
5391 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, in lpfc_disc_timeout_handler()
5394 vport->fc_ns_retry, LPFC_MAX_NS_RETRY); in lpfc_disc_timeout_handler()
5396 if (vport->fc_ns_retry < LPFC_MAX_NS_RETRY) { in lpfc_disc_timeout_handler()
5398 vport->fc_ns_retry++; in lpfc_disc_timeout_handler()
5399 rc = lpfc_ns_cmd(vport, SLI_CTNS_GID_FT, in lpfc_disc_timeout_handler()
5400 vport->fc_ns_retry, 0); in lpfc_disc_timeout_handler()
5404 vport->fc_ns_retry = 0; in lpfc_disc_timeout_handler()
5414 lpfc_issue_reg_vpi(phba, vport); in lpfc_disc_timeout_handler()
5416 lpfc_issue_clear_la(phba, vport); in lpfc_disc_timeout_handler()
5417 vport->port_state = LPFC_VPORT_READY; in lpfc_disc_timeout_handler()
5424 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, in lpfc_disc_timeout_handler()
5435 initlinkmbox->vport = vport; in lpfc_disc_timeout_handler()
5446 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, in lpfc_disc_timeout_handler()
5448 lpfc_disc_flush_list(vport); in lpfc_disc_timeout_handler()
5456 lpfc_issue_reg_vpi(phba, vport); in lpfc_disc_timeout_handler()
5458 lpfc_issue_clear_la(phba, vport); in lpfc_disc_timeout_handler()
5459 vport->port_state = LPFC_VPORT_READY; in lpfc_disc_timeout_handler()
5465 if (vport->fc_flag & FC_RSCN_MODE) { in lpfc_disc_timeout_handler()
5466 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, in lpfc_disc_timeout_handler()
5469 vport->fc_ns_retry, LPFC_MAX_NS_RETRY); in lpfc_disc_timeout_handler()
5472 lpfc_els_flush_cmd(vport); in lpfc_disc_timeout_handler()
5474 lpfc_els_flush_rscn(vport); in lpfc_disc_timeout_handler()
5475 lpfc_disc_flush_list(vport); in lpfc_disc_timeout_handler()
5480 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, in lpfc_disc_timeout_handler()
5482 "vport State x%x\n", vport->port_state); in lpfc_disc_timeout_handler()
5489 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, in lpfc_disc_timeout_handler()
5495 lpfc_issue_clear_la(phba, vport); in lpfc_disc_timeout_handler()
5503 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, in lpfc_disc_timeout_handler()
5514 lpfc_disc_flush_list(vport); in lpfc_disc_timeout_handler()
5518 vport->port_state = LPFC_VPORT_READY; in lpfc_disc_timeout_handler()
5536 struct lpfc_vport *vport = pmb->vport; in lpfc_mbx_cmpl_fdmi_reg_login() local
5545 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); in lpfc_mbx_cmpl_fdmi_reg_login()
5546 lpfc_printf_vlog(vport, KERN_INFO, LOG_SLI, in lpfc_mbx_cmpl_fdmi_reg_login()
5557 if (vport->cfg_fdmi_on & LPFC_FDMI_REG_DELAY) in lpfc_mbx_cmpl_fdmi_reg_login()
5558 mod_timer(&vport->fc_fdmitmo, in lpfc_mbx_cmpl_fdmi_reg_login()
5561 lpfc_fdmi_cmd(vport, ndlp, SLI_MGMT_DHBA); in lpfc_mbx_cmpl_fdmi_reg_login()
5594 __lpfc_find_node(struct lpfc_vport *vport, node_filter filter, void *param) in __lpfc_find_node() argument
5598 list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) { in __lpfc_find_node()
5600 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in __lpfc_find_node()
5608 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in __lpfc_find_node()
5618 __lpfc_findnode_rpi(struct lpfc_vport *vport, uint16_t rpi) in __lpfc_findnode_rpi() argument
5620 return __lpfc_find_node(vport, lpfc_filter_by_rpi, &rpi); in __lpfc_findnode_rpi()
5628 lpfc_findnode_wwpn(struct lpfc_vport *vport, struct lpfc_name *wwpn) in lpfc_findnode_wwpn() argument
5630 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_findnode_wwpn()
5634 ndlp = __lpfc_find_node(vport, lpfc_filter_by_wwpn, wwpn); in lpfc_findnode_wwpn()
5645 lpfc_findnode_rpi(struct lpfc_vport *vport, uint16_t rpi) in lpfc_findnode_rpi() argument
5647 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_findnode_rpi()
5651 ndlp = __lpfc_findnode_rpi(vport, rpi); in lpfc_findnode_rpi()
5672 struct lpfc_vport *vport; in lpfc_find_vport_by_vpid() local
5696 list_for_each_entry(vport, &phba->port_list, listentry) { in lpfc_find_vport_by_vpid()
5697 if (vport->vpi == i) { in lpfc_find_vport_by_vpid()
5699 return vport; in lpfc_find_vport_by_vpid()
5707 lpfc_nlp_init(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, in lpfc_nlp_init() argument
5712 lpfc_initialize_node(vport, ndlp, did); in lpfc_nlp_init()
5714 if (vport->phba->sli_rev == LPFC_SLI_REV4) { in lpfc_nlp_init()
5715 ndlp->nlp_rpi = lpfc_sli4_alloc_rpi(vport->phba); in lpfc_nlp_init()
5716 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in lpfc_nlp_init()
5724 mempool_alloc(vport->phba->active_rrq_pool, in lpfc_nlp_init()
5733 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_NODE, in lpfc_nlp_init()
5751 lpfc_debugfs_disc_trc(ndlp->vport, LPFC_DISC_TRC_NODE, in lpfc_nlp_release()
5755 lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_NODE, in lpfc_nlp_release()
5762 lpfc_nlp_remove(ndlp->vport, ndlp); in lpfc_nlp_release()
5793 lpfc_debugfs_disc_trc(ndlp->vport, LPFC_DISC_TRC_NODE, in lpfc_nlp_get()
5805 lpfc_printf_vlog(ndlp->vport, KERN_WARNING, LOG_NODE, in lpfc_nlp_get()
5833 lpfc_debugfs_disc_trc(ndlp->vport, LPFC_DISC_TRC_NODE, in lpfc_nlp_put()
5845 lpfc_printf_vlog(ndlp->vport, KERN_WARNING, LOG_NODE, in lpfc_nlp_put()
5858 lpfc_printf_vlog(ndlp->vport, KERN_WARNING, LOG_NODE, in lpfc_nlp_put()
5895 lpfc_debugfs_disc_trc(ndlp->vport, LPFC_DISC_TRC_NODE, in lpfc_nlp_not_used()
5975 struct lpfc_vport *vport = mboxq->vport; in lpfc_unregister_vfi_cmpl() local
5976 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_unregister_vfi_cmpl()
5982 mboxq->u.mb.mbxStatus, vport->port_state); in lpfc_unregister_vfi_cmpl()
6001 struct lpfc_vport *vport = mboxq->vport; in lpfc_unregister_fcfi_cmpl() local
6007 mboxq->u.mb.mbxStatus, vport->port_state); in lpfc_unregister_fcfi_cmpl()
6102 mbox->vport = phba->pport; in lpfc_sli4_unregister_fcf()