Lines Matching refs:vport

54 static void lpfc_fabric_abort_vport(struct lpfc_vport *vport);
55 static int lpfc_issue_els_fdisc(struct lpfc_vport *vport,
67 static void lpfc_init_cs_ctl_bitmap(struct lpfc_vport *vport);
68 static void lpfc_vmid_set_cs_ctl_range(struct lpfc_vport *vport, u32 min, u32 max);
69 static void lpfc_vmid_put_cs_ctl(struct lpfc_vport *vport, u32 ctcl_vmid);
94 lpfc_els_chk_latt(struct lpfc_vport *vport) in lpfc_els_chk_latt() argument
96 struct lpfc_hba *phba = vport->phba; in lpfc_els_chk_latt()
99 if (vport->port_state >= LPFC_VPORT_READY || in lpfc_els_chk_latt()
112 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_els_chk_latt()
123 set_bit(FC_ABORT_DISCOVERY, &vport->fc_flag); in lpfc_els_chk_latt()
126 lpfc_issue_clear_la(phba, vport); in lpfc_els_chk_latt()
169 lpfc_prep_els_iocb(struct lpfc_vport *vport, u8 expect_rsp, in lpfc_prep_els_iocb() argument
174 struct lpfc_hba *phba = vport->phba; in lpfc_prep_els_iocb()
271 lpfc_sli_prep_els_req_rsp(phba, elsiocb, vport, bmp, cmd_size, did, in lpfc_prep_els_iocb()
291 elsiocb->vport = vport; in lpfc_prep_els_iocb()
298 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, in lpfc_prep_els_iocb()
303 vport->port_state, ndlp->nlp_rpi, in lpfc_prep_els_iocb()
304 vport->fc_flag); in lpfc_prep_els_iocb()
307 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, in lpfc_prep_els_iocb()
312 cmd_size, vport->port_state, in lpfc_prep_els_iocb()
313 ndlp->nlp_rpi, vport->fc_flag); in lpfc_prep_els_iocb()
350 lpfc_issue_fabric_reglogin(struct lpfc_vport *vport) in lpfc_issue_fabric_reglogin() argument
352 struct lpfc_hba *phba = vport->phba; in lpfc_issue_fabric_reglogin()
360 ndlp = lpfc_findnode_did(vport, Fabric_DID); in lpfc_issue_fabric_reglogin()
372 vport->port_state = LPFC_FABRIC_CFG_LINK; in lpfc_issue_fabric_reglogin()
375 mbox->vport = vport; in lpfc_issue_fabric_reglogin()
388 rc = lpfc_reg_rpi(phba, vport->vpi, Fabric_DID, (uint8_t *)sp, mbox, in lpfc_issue_fabric_reglogin()
396 mbox->vport = vport; in lpfc_issue_fabric_reglogin()
422 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_issue_fabric_reglogin()
423 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_issue_fabric_reglogin()
441 lpfc_issue_reg_vfi(struct lpfc_vport *vport) in lpfc_issue_reg_vfi() argument
443 struct lpfc_hba *phba = vport->phba; in lpfc_issue_reg_vfi()
452 !test_bit(FC_PT2PT, &vport->fc_flag)) { in lpfc_issue_reg_vfi()
453 ndlp = lpfc_findnode_did(vport, Fabric_DID); in lpfc_issue_reg_vfi()
467 if (test_bit(FC_FABRIC, &vport->fc_flag) || in lpfc_issue_reg_vfi()
468 test_bit(FC_PT2PT, &vport->fc_flag)) { in lpfc_issue_reg_vfi()
479 vport->port_state = LPFC_FABRIC_CFG_LINK; in lpfc_issue_reg_vfi()
481 lpfc_reg_vfi(mboxq, vport, dmabuf->phys); in lpfc_issue_reg_vfi()
485 lpfc_reg_vfi(mboxq, vport, 0); in lpfc_issue_reg_vfi()
489 mboxq->vport = vport; in lpfc_issue_reg_vfi()
500 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_issue_reg_vfi()
501 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_issue_reg_vfi()
518 lpfc_issue_unreg_vfi(struct lpfc_vport *vport) in lpfc_issue_unreg_vfi() argument
520 struct lpfc_hba *phba = vport->phba; in lpfc_issue_unreg_vfi()
532 lpfc_unreg_vfi(mboxq, vport); in lpfc_issue_unreg_vfi()
533 mboxq->vport = vport; in lpfc_issue_unreg_vfi()
546 clear_bit(FC_VFI_REGISTERED, &vport->fc_flag); in lpfc_issue_unreg_vfi()
569 lpfc_check_clean_addr_bit(struct lpfc_vport *vport, in lpfc_check_clean_addr_bit() argument
572 struct lpfc_hba *phba = vport->phba; in lpfc_check_clean_addr_bit()
575 if ((vport->fc_prevDID != vport->fc_myDID) || in lpfc_check_clean_addr_bit()
576 memcmp(&vport->fabric_portname, &sp->portName, in lpfc_check_clean_addr_bit()
578 memcmp(&vport->fabric_nodename, &sp->nodeName, in lpfc_check_clean_addr_bit()
580 (vport->vport_flag & FAWWPN_PARAM_CHG)) { in lpfc_check_clean_addr_bit()
582 vport->vport_flag &= ~FAWWPN_PARAM_CHG; in lpfc_check_clean_addr_bit()
595 (vport->fc_prevDID || phba->cfg_delay_discovery)) in lpfc_check_clean_addr_bit()
596 set_bit(FC_DISC_DELAYED, &vport->fc_flag); in lpfc_check_clean_addr_bit()
623 lpfc_cmpl_els_flogi_fabric(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, in lpfc_cmpl_els_flogi_fabric() argument
626 struct lpfc_hba *phba = vport->phba; in lpfc_cmpl_els_flogi_fabric()
631 set_bit(FC_FABRIC, &vport->fc_flag); in lpfc_cmpl_els_flogi_fabric()
641 set_bit(FC_PUBLIC_LOOP, &vport->fc_flag); in lpfc_cmpl_els_flogi_fabric()
643 vport->fc_myDID = ulp_word4 & Mask_DID; in lpfc_cmpl_els_flogi_fabric()
658 fabric_param_changed = lpfc_check_clean_addr_bit(vport, sp); in lpfc_cmpl_els_flogi_fabric()
664 vport->fdmi_hba_mask = LPFC_FDMI2_HBA_ATTR; in lpfc_cmpl_els_flogi_fabric()
666 vport->fdmi_port_mask = LPFC_FDMI2_SMART_ATTR; in lpfc_cmpl_els_flogi_fabric()
668 vport->fdmi_port_mask = LPFC_FDMI2_PORT_ATTR; in lpfc_cmpl_els_flogi_fabric()
670 vport->fdmi_hba_mask = 0; in lpfc_cmpl_els_flogi_fabric()
671 vport->fdmi_port_mask = 0; in lpfc_cmpl_els_flogi_fabric()
675 memcpy(&vport->fabric_portname, &sp->portName, in lpfc_cmpl_els_flogi_fabric()
677 memcpy(&vport->fabric_nodename, &sp->nodeName, in lpfc_cmpl_els_flogi_fabric()
683 lpfc_printf_vlog(vport, KERN_WARNING, in lpfc_cmpl_els_flogi_fabric()
694 lpfc_printf_vlog(vport, KERN_WARNING, in lpfc_cmpl_els_flogi_fabric()
715 if (test_bit(FC_VFI_REGISTERED, &vport->fc_flag)) in lpfc_cmpl_els_flogi_fabric()
716 lpfc_issue_reg_vfi(vport); in lpfc_cmpl_els_flogi_fabric()
720 !test_bit(FC_VPORT_NEEDS_REG_VPI, &vport->fc_flag)) { in lpfc_cmpl_els_flogi_fabric()
726 &vport->fc_nodes, nlp_listp) { in lpfc_cmpl_els_flogi_fabric()
733 lpfc_unreg_rpi(vport, np); in lpfc_cmpl_els_flogi_fabric()
735 lpfc_cleanup_pending_mbox(vport); in lpfc_cmpl_els_flogi_fabric()
738 lpfc_sli4_unreg_all_rpis(vport); in lpfc_cmpl_els_flogi_fabric()
739 lpfc_mbx_unreg_vpi(vport); in lpfc_cmpl_els_flogi_fabric()
740 set_bit(FC_VPORT_NEEDS_INIT_VPI, &vport->fc_flag); in lpfc_cmpl_els_flogi_fabric()
747 set_bit(FC_VPORT_NEEDS_REG_VPI, &vport->fc_flag); in lpfc_cmpl_els_flogi_fabric()
749 !test_bit(FC_VPORT_NEEDS_REG_VPI, &vport->fc_flag)) { in lpfc_cmpl_els_flogi_fabric()
754 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); in lpfc_cmpl_els_flogi_fabric()
755 lpfc_register_new_vport(phba, vport, ndlp); in lpfc_cmpl_els_flogi_fabric()
760 lpfc_nlp_set_state(vport, ndlp, NLP_STE_REG_LOGIN_ISSUE); in lpfc_cmpl_els_flogi_fabric()
762 test_bit(FC_VPORT_NEEDS_REG_VPI, &vport->fc_flag)) in lpfc_cmpl_els_flogi_fabric()
763 lpfc_register_new_vport(phba, vport, ndlp); in lpfc_cmpl_els_flogi_fabric()
765 lpfc_issue_fabric_reglogin(vport); in lpfc_cmpl_els_flogi_fabric()
768 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); in lpfc_cmpl_els_flogi_fabric()
769 if ((!test_bit(FC_VPORT_NEEDS_REG_VPI, &vport->fc_flag)) && in lpfc_cmpl_els_flogi_fabric()
770 (vport->vpi_state & LPFC_VPI_REGISTERED)) { in lpfc_cmpl_els_flogi_fabric()
772 lpfc_do_scr_ns_plogi(phba, vport); in lpfc_cmpl_els_flogi_fabric()
773 } else if (test_bit(FC_VFI_REGISTERED, &vport->fc_flag)) in lpfc_cmpl_els_flogi_fabric()
774 lpfc_issue_init_vpi(vport); in lpfc_cmpl_els_flogi_fabric()
776 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, in lpfc_cmpl_els_flogi_fabric()
778 vport->fc_prevDID, vport->fc_myDID); in lpfc_cmpl_els_flogi_fabric()
779 lpfc_issue_reg_vfi(vport); in lpfc_cmpl_els_flogi_fabric()
806 lpfc_cmpl_els_flogi_nport(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, in lpfc_cmpl_els_flogi_nport() argument
809 struct lpfc_hba *phba = vport->phba; in lpfc_cmpl_els_flogi_nport()
813 clear_bit(FC_FABRIC, &vport->fc_flag); in lpfc_cmpl_els_flogi_nport()
814 clear_bit(FC_PUBLIC_LOOP, &vport->fc_flag); in lpfc_cmpl_els_flogi_nport()
815 set_bit(FC_PT2PT, &vport->fc_flag); in lpfc_cmpl_els_flogi_nport()
823 clear_bit(FC_VFI_REGISTERED, &vport->fc_flag); in lpfc_cmpl_els_flogi_nport()
827 rc = memcmp(&vport->fc_portname, &sp->portName, in lpfc_cmpl_els_flogi_nport()
828 sizeof(vport->fc_portname)); in lpfc_cmpl_els_flogi_nport()
832 set_bit(FC_PT2PT_PLOGI, &vport->fc_flag); in lpfc_cmpl_els_flogi_nport()
841 vport->fc_myDID = PT2PT_LocalID; in lpfc_cmpl_els_flogi_nport()
850 ndlp = lpfc_findnode_did(vport, PT2PT_RemoteID); in lpfc_cmpl_els_flogi_nport()
856 ndlp = lpfc_nlp_init(vport, PT2PT_RemoteID); in lpfc_cmpl_els_flogi_nport()
866 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); in lpfc_cmpl_els_flogi_nport()
878 mbox->vport = vport; in lpfc_cmpl_els_flogi_nport()
893 lpfc_disc_start(vport); in lpfc_cmpl_els_flogi_nport()
928 struct lpfc_vport *vport = cmdiocb->vport; in lpfc_cmpl_els_flogi() local
939 if (lpfc_els_chk_latt(vport)) { in lpfc_cmpl_els_flogi()
958 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_cmpl_els_flogi()
961 vport->port_state); in lpfc_cmpl_els_flogi()
990 rc = lpfc_sli4_fcf_rr_next_proc(vport, fcf_index); in lpfc_cmpl_els_flogi()
1000 lpfc_vlog_msg(vport, KERN_WARNING, LOG_ELS, in lpfc_cmpl_els_flogi()
1012 lpfc_check_nlp_post_devloss(vport, ndlp); in lpfc_cmpl_els_flogi()
1025 lpfc_printf_vlog(vport, KERN_WARNING, LOG_ELS, in lpfc_cmpl_els_flogi()
1036 lpfc_vlog_msg(vport, KERN_WARNING, LOG_ELS, in lpfc_cmpl_els_flogi()
1044 clear_bit(FC_FABRIC, &vport->fc_flag); in lpfc_cmpl_els_flogi()
1045 clear_bit(FC_PUBLIC_LOOP, &vport->fc_flag); in lpfc_cmpl_els_flogi()
1046 clear_bit(FC_PT2PT_NO_NVME, &vport->fc_flag); in lpfc_cmpl_els_flogi()
1053 vport->cfg_discovery_threads = LPFC_MAX_DISC_THREADS; in lpfc_cmpl_els_flogi()
1055 (!test_bit(FC_VFI_REGISTERED, &vport->fc_flag) || in lpfc_cmpl_els_flogi()
1056 (vport->fc_prevDID != vport->fc_myDID) || in lpfc_cmpl_els_flogi()
1058 if (test_bit(FC_VFI_REGISTERED, &vport->fc_flag)) { in lpfc_cmpl_els_flogi()
1062 &vport->fc_flag); in lpfc_cmpl_els_flogi()
1065 lpfc_sli4_unreg_all_rpis(vport); in lpfc_cmpl_els_flogi()
1070 if (!lpfc_error_lost_link(vport, ulp_status, ulp_word4)) in lpfc_cmpl_els_flogi()
1071 lpfc_issue_reg_vfi(vport); in lpfc_cmpl_els_flogi()
1077 clear_bit(FC_VPORT_CVL_RCVD, &vport->fc_flag); in lpfc_cmpl_els_flogi()
1078 clear_bit(FC_VPORT_LOGO_RCVD, &vport->fc_flag); in lpfc_cmpl_els_flogi()
1092 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, in lpfc_cmpl_els_flogi()
1098 vport->port_state, vport->fc_flag, in lpfc_cmpl_els_flogi()
1103 lpfc_reinit_vmid(vport); in lpfc_cmpl_els_flogi()
1104 vport->vmid_flag = 0; in lpfc_cmpl_els_flogi()
1107 vport->phba->pport->vmid_flag |= (LPFC_VMID_ISSUE_QFPA | in lpfc_cmpl_els_flogi()
1115 lpfc_check_nlp_post_devloss(vport, ndlp); in lpfc_cmpl_els_flogi()
1116 if (vport->port_state == LPFC_FLOGI) { in lpfc_cmpl_els_flogi()
1122 rc = lpfc_cmpl_els_flogi_fabric(vport, ndlp, sp, in lpfc_cmpl_els_flogi()
1125 rc = lpfc_cmpl_els_flogi_nport(vport, ndlp, sp); in lpfc_cmpl_els_flogi()
1127 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_cmpl_els_flogi()
1163 lpfc_printf_vlog(vport, KERN_INFO, LOG_FIP | in lpfc_cmpl_els_flogi()
1176 } else if (vport->port_state > LPFC_FLOGI && in lpfc_cmpl_els_flogi()
1177 test_bit(FC_PT2PT, &vport->fc_flag)) { in lpfc_cmpl_els_flogi()
1192 if (!lpfc_error_lost_link(vport, ulp_status, ulp_word4)) { in lpfc_cmpl_els_flogi()
1194 lpfc_disc_list_loopmap(vport); in lpfc_cmpl_els_flogi()
1197 lpfc_disc_start(vport); in lpfc_cmpl_els_flogi()
1205 lpfc_issue_clear_la(phba, vport); in lpfc_cmpl_els_flogi()
1272 lpfc_issue_els_flogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, in lpfc_issue_els_flogi() argument
1275 struct lpfc_hba *phba = vport->phba; in lpfc_issue_els_flogi()
1287 elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, retry, ndlp, in lpfc_issue_els_flogi()
1300 memcpy(pcmd, &vport->fc_sparam, sizeof(struct serv_parm)); in lpfc_issue_els_flogi()
1317 if (!memchr_inv(vport->lpfc_vmid_host_uuid, 0, in lpfc_issue_els_flogi()
1318 sizeof(vport->lpfc_vmid_host_uuid))) { in lpfc_issue_els_flogi()
1319 memcpy(vport->lpfc_vmid_host_uuid, phba->wwpn, in lpfc_issue_els_flogi()
1321 memcpy(&vport->lpfc_vmid_host_uuid[8], phba->wwnn, in lpfc_issue_els_flogi()
1362 lpfc_set_disctmo(vport); in lpfc_issue_els_flogi()
1368 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_issue_els_flogi()
1397 ndlp = lpfc_findnode_did(vport, 0); in lpfc_issue_els_flogi()
1401 did = vport->fc_myDID; in lpfc_issue_els_flogi()
1402 vport->fc_myDID = Fabric_DID; in lpfc_issue_els_flogi()
1420 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, in lpfc_issue_els_flogi()
1427 lpfc_els_rsp_acc(vport, ELS_CMD_FLOGI, &defer_flogi_acc, in lpfc_issue_els_flogi()
1440 vport->fc_myDID = did; in lpfc_issue_els_flogi()
1522 lpfc_initial_flogi(struct lpfc_vport *vport) in lpfc_initial_flogi() argument
1526 vport->port_state = LPFC_FLOGI; in lpfc_initial_flogi()
1527 lpfc_set_disctmo(vport); in lpfc_initial_flogi()
1530 ndlp = lpfc_findnode_did(vport, Fabric_DID); in lpfc_initial_flogi()
1533 ndlp = lpfc_nlp_init(vport, Fabric_DID); in lpfc_initial_flogi()
1540 lpfc_enqueue_node(vport, ndlp); in lpfc_initial_flogi()
1544 clear_bit(FC_FABRIC, &vport->fc_flag); in lpfc_initial_flogi()
1545 if (lpfc_issue_els_flogi(vport, ndlp, 0)) { in lpfc_initial_flogi()
1575 lpfc_initial_fdisc(struct lpfc_vport *vport) in lpfc_initial_fdisc() argument
1580 ndlp = lpfc_findnode_did(vport, Fabric_DID); in lpfc_initial_fdisc()
1583 ndlp = lpfc_nlp_init(vport, Fabric_DID); in lpfc_initial_fdisc()
1591 lpfc_enqueue_node(vport, ndlp); in lpfc_initial_fdisc()
1594 if (lpfc_issue_els_fdisc(vport, ndlp, 0)) { in lpfc_initial_fdisc()
1619 lpfc_more_plogi(struct lpfc_vport *vport) in lpfc_more_plogi() argument
1621 if (vport->num_disc_nodes) in lpfc_more_plogi()
1622 vport->num_disc_nodes--; in lpfc_more_plogi()
1625 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_more_plogi()
1628 vport->num_disc_nodes, in lpfc_more_plogi()
1629 atomic_read(&vport->fc_plogi_cnt), in lpfc_more_plogi()
1630 vport->fc_flag, vport->port_state); in lpfc_more_plogi()
1632 if (test_bit(FC_NLP_MORE, &vport->fc_flag)) in lpfc_more_plogi()
1634 lpfc_els_disc_plogi(vport); in lpfc_more_plogi()
1674 struct lpfc_vport *vport = ndlp->vport; in lpfc_plogi_confirm_nport() local
1692 new_ndlp = lpfc_findnode_wwpn(vport, &sp->portName); in lpfc_plogi_confirm_nport()
1706 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS | LOG_NODE, in lpfc_plogi_confirm_nport()
1723 new_ndlp = lpfc_nlp_init(vport, ndlp->nlp_DID); in lpfc_plogi_confirm_nport()
1741 lpfc_nlp_unreg_node(vport, new_ndlp); in lpfc_plogi_confirm_nport()
1751 if (test_bit(FC_FABRIC, &vport->fc_flag)) { in lpfc_plogi_confirm_nport()
1756 lpfc_unreg_rpi(vport, new_ndlp); in lpfc_plogi_confirm_nport()
1820 lpfc_nlp_set_state(vport, new_ndlp, ndlp->nlp_state); in lpfc_plogi_confirm_nport()
1832 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, in lpfc_plogi_confirm_nport()
1842 lpfc_nlp_set_state(vport, ndlp, keep_nlp_state); in lpfc_plogi_confirm_nport()
1850 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, in lpfc_plogi_confirm_nport()
1854 lpfc_unreg_rpi(vport, ndlp); in lpfc_plogi_confirm_nport()
1874 lpfc_nlp_set_state(vport, ndlp, keep_nlp_state); in lpfc_plogi_confirm_nport()
1883 lpfc_disc_state_machine(vport, ndlp, NULL, NLP_EVT_DEVICE_RM); in lpfc_plogi_confirm_nport()
1890 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS | LOG_NODE, in lpfc_plogi_confirm_nport()
1910 lpfc_end_rscn(struct lpfc_vport *vport) in lpfc_end_rscn() argument
1913 if (test_bit(FC_RSCN_MODE, &vport->fc_flag)) { in lpfc_end_rscn()
1918 if (vport->fc_rscn_id_cnt || in lpfc_end_rscn()
1919 test_bit(FC_RSCN_DISCOVERY, &vport->fc_flag)) in lpfc_end_rscn()
1920 lpfc_els_handle_rscn(vport); in lpfc_end_rscn()
1922 clear_bit(FC_RSCN_MODE, &vport->fc_flag); in lpfc_end_rscn()
1942 struct lpfc_vport *vport = cmdiocb->vport; in lpfc_cmpl_els_rrq() local
1952 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_cmpl_els_rrq()
1959 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, in lpfc_cmpl_els_rrq()
1972 lpfc_vlog_msg(vport, KERN_WARNING, LOG_ELS, in lpfc_cmpl_els_rrq()
2008 struct lpfc_vport *vport = cmdiocb->vport; in lpfc_cmpl_els_plogi() local
2031 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_cmpl_els_plogi()
2035 ndlp = lpfc_findnode_did(vport, did); in lpfc_cmpl_els_plogi()
2037 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_cmpl_els_plogi()
2053 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, in lpfc_cmpl_els_plogi()
2059 disc, vport->num_disc_nodes); in lpfc_cmpl_els_plogi()
2062 if (lpfc_els_chk_latt(vport)) { in lpfc_cmpl_els_plogi()
2085 lpfc_vlog_msg(vport, KERN_WARNING, LOG_ELS, in lpfc_cmpl_els_plogi()
2092 if (!lpfc_error_lost_link(vport, ulp_status, ulp_word4)) in lpfc_cmpl_els_plogi()
2093 lpfc_disc_state_machine(vport, ndlp, cmdiocb, in lpfc_cmpl_els_plogi()
2118 lpfc_disc_state_machine(vport, ndlp, cmdiocb, in lpfc_cmpl_els_plogi()
2146 lpfc_disc_state_machine(vport, ndlp, cmdiocb, in lpfc_cmpl_els_plogi()
2150 if (disc && vport->num_disc_nodes) { in lpfc_cmpl_els_plogi()
2152 lpfc_more_plogi(vport); in lpfc_cmpl_els_plogi()
2154 if (vport->num_disc_nodes == 0) { in lpfc_cmpl_els_plogi()
2155 clear_bit(FC_NDISC_ACTIVE, &vport->fc_flag); in lpfc_cmpl_els_plogi()
2157 lpfc_can_disctmo(vport); in lpfc_cmpl_els_plogi()
2158 lpfc_end_rscn(vport); in lpfc_cmpl_els_plogi()
2163 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_NODE, in lpfc_cmpl_els_plogi()
2197 lpfc_issue_els_plogi(struct lpfc_vport *vport, uint32_t did, uint8_t retry) in lpfc_issue_els_plogi() argument
2199 struct lpfc_hba *phba = vport->phba; in lpfc_issue_els_plogi()
2207 ndlp = lpfc_findnode_did(vport, did); in lpfc_issue_els_plogi()
2217 !test_bit(FC_OFFLINE_MODE, &vport->fc_flag)) { in lpfc_issue_els_plogi()
2218 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_issue_els_plogi()
2232 elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, retry, ndlp, did, in lpfc_issue_els_plogi()
2242 memcpy(pcmd, &vport->fc_sparam, sizeof(struct serv_parm)); in lpfc_issue_els_plogi()
2249 if (test_bit(FC_FABRIC, &vport->fc_flag) && in lpfc_issue_els_plogi()
2250 !test_bit(FC_PUBLIC_LOOP, &vport->fc_flag)) in lpfc_issue_els_plogi()
2265 if (vport->vmid_priority_tagging) in lpfc_issue_els_plogi()
2271 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_issue_els_plogi()
2287 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_issue_els_plogi()
2323 struct lpfc_vport *vport = cmdiocb->vport; in lpfc_cmpl_els_prli() local
2342 vport->fc_prli_sent--; in lpfc_cmpl_els_prli()
2346 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_cmpl_els_prli()
2352 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, in lpfc_cmpl_els_prli()
2356 vport->num_disc_nodes, ndlp->fc4_prli_sent, in lpfc_cmpl_els_prli()
2360 if (lpfc_els_chk_latt(vport)) in lpfc_cmpl_els_prli()
2373 if (test_bit(FC_FABRIC, &vport->fc_flag) || in lpfc_cmpl_els_prli()
2374 vport->cfg_enable_fc4_type != LPFC_ENABLE_BOTH) in lpfc_cmpl_els_prli()
2380 lpfc_printf_vlog(vport, mode, LOG_ELS, in lpfc_cmpl_els_prli()
2388 if (!lpfc_error_lost_link(vport, ulp_status, ulp_word4)) in lpfc_cmpl_els_prli()
2389 lpfc_disc_state_machine(vport, ndlp, cmdiocb, in lpfc_cmpl_els_prli()
2400 lpfc_printf_vlog(vport, KERN_WARNING, LOG_NODE, in lpfc_cmpl_els_prli()
2412 if (test_bit(FC_PT2PT, &vport->fc_flag)) in lpfc_cmpl_els_prli()
2430 lpfc_disc_state_machine(vport, ndlp, cmdiocb, in lpfc_cmpl_els_prli()
2438 lpfc_disc_state_machine(vport, ndlp, cmdiocb, in lpfc_cmpl_els_prli()
2469 lpfc_issue_els_prli(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, in lpfc_issue_els_prli() argument
2473 struct lpfc_hba *phba = vport->phba; in lpfc_issue_els_prli()
2488 test_bit(FC_RSCN_MODE, &vport->fc_flag) && in lpfc_issue_els_prli()
2489 vport->nvmei_support) in lpfc_issue_els_prli()
2512 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_issue_els_prli()
2523 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_issue_els_prli()
2526 lpfc_disc_state_machine(vport, ndlp, NULL, NLP_EVT_DEVICE_RM); in lpfc_issue_els_prli()
2530 elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, retry, ndlp, in lpfc_issue_els_prli()
2561 if (vport->cfg_first_burst_size) in lpfc_issue_els_prli()
2610 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_issue_els_prli()
2632 vport->fc_prli_sent++; in lpfc_issue_els_prli()
2659 lpfc_rscn_disc(struct lpfc_vport *vport) in lpfc_rscn_disc() argument
2661 lpfc_can_disctmo(vport); in lpfc_rscn_disc()
2665 if (atomic_read(&vport->fc_npr_cnt)) in lpfc_rscn_disc()
2666 if (lpfc_els_disc_plogi(vport)) in lpfc_rscn_disc()
2669 lpfc_end_rscn(vport); in lpfc_rscn_disc()
2683 lpfc_adisc_done(struct lpfc_vport *vport) in lpfc_adisc_done() argument
2685 struct lpfc_hba *phba = vport->phba; in lpfc_adisc_done()
2692 !test_bit(FC_RSCN_MODE, &vport->fc_flag) && in lpfc_adisc_done()
2710 lpfc_issue_clear_la(phba, vport); in lpfc_adisc_done()
2711 lpfc_issue_reg_vpi(phba, vport); in lpfc_adisc_done()
2718 if (vport->port_state < LPFC_VPORT_READY) { in lpfc_adisc_done()
2720 lpfc_issue_clear_la(phba, vport); in lpfc_adisc_done()
2721 if (!test_bit(FC_ABORT_DISCOVERY, &vport->fc_flag)) { in lpfc_adisc_done()
2722 vport->num_disc_nodes = 0; in lpfc_adisc_done()
2724 if (atomic_read(&vport->fc_npr_cnt)) in lpfc_adisc_done()
2725 lpfc_els_disc_plogi(vport); in lpfc_adisc_done()
2726 if (!vport->num_disc_nodes) { in lpfc_adisc_done()
2727 clear_bit(FC_NDISC_ACTIVE, &vport->fc_flag); in lpfc_adisc_done()
2728 lpfc_can_disctmo(vport); in lpfc_adisc_done()
2729 lpfc_end_rscn(vport); in lpfc_adisc_done()
2732 vport->port_state = LPFC_VPORT_READY; in lpfc_adisc_done()
2734 lpfc_rscn_disc(vport); in lpfc_adisc_done()
2747 lpfc_more_adisc(struct lpfc_vport *vport) in lpfc_more_adisc() argument
2749 if (vport->num_disc_nodes) in lpfc_more_adisc()
2750 vport->num_disc_nodes--; in lpfc_more_adisc()
2752 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_more_adisc()
2755 vport->num_disc_nodes, in lpfc_more_adisc()
2756 atomic_read(&vport->fc_adisc_cnt), in lpfc_more_adisc()
2757 vport->fc_flag, vport->port_state); in lpfc_more_adisc()
2759 if (test_bit(FC_NLP_MORE, &vport->fc_flag)) { in lpfc_more_adisc()
2760 lpfc_set_disctmo(vport); in lpfc_more_adisc()
2762 lpfc_els_disc_adisc(vport); in lpfc_more_adisc()
2764 if (!vport->num_disc_nodes) in lpfc_more_adisc()
2765 lpfc_adisc_done(vport); in lpfc_more_adisc()
2789 struct lpfc_vport *vport = cmdiocb->vport; in lpfc_cmpl_els_adisc() local
2813 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_cmpl_els_adisc()
2826 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, in lpfc_cmpl_els_adisc()
2831 tmo, disc, vport->num_disc_nodes); in lpfc_cmpl_els_adisc()
2834 if (lpfc_els_chk_latt(vport)) { in lpfc_cmpl_els_adisc()
2849 lpfc_set_disctmo(vport); in lpfc_cmpl_els_adisc()
2854 lpfc_vlog_msg(vport, KERN_WARNING, LOG_ELS, in lpfc_cmpl_els_adisc()
2858 lpfc_disc_state_machine(vport, ndlp, cmdiocb, in lpfc_cmpl_els_adisc()
2874 lpfc_disc_state_machine(vport, ndlp, cmdiocb, in lpfc_cmpl_els_adisc()
2878 lpfc_disc_state_machine(vport, ndlp, cmdiocb, in lpfc_cmpl_els_adisc()
2882 if (disc && vport->num_disc_nodes) in lpfc_cmpl_els_adisc()
2883 lpfc_more_adisc(vport); in lpfc_cmpl_els_adisc()
2910 lpfc_issue_els_adisc(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, in lpfc_issue_els_adisc() argument
2914 struct lpfc_hba *phba = vport->phba; in lpfc_issue_els_adisc()
2921 elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, retry, ndlp, in lpfc_issue_els_adisc()
2935 memcpy(&ap->portName, &vport->fc_portname, sizeof(struct lpfc_name)); in lpfc_issue_els_adisc()
2936 memcpy(&ap->nodeName, &vport->fc_nodename, sizeof(struct lpfc_name)); in lpfc_issue_els_adisc()
2937 ap->DID = be32_to_cpu(vport->fc_myDID); in lpfc_issue_els_adisc()
2950 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_issue_els_adisc()
2986 struct lpfc_vport *vport = ndlp->vport; in lpfc_cmpl_els_logo() local
3018 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_cmpl_els_logo()
3024 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, in lpfc_cmpl_els_logo()
3031 tmo, vport->num_disc_nodes); in lpfc_cmpl_els_logo()
3033 if (lpfc_els_chk_latt(vport)) { in lpfc_cmpl_els_logo()
3045 lpfc_vlog_msg(vport, KERN_WARNING, LOG_ELS, in lpfc_cmpl_els_logo()
3051 if (lpfc_error_lost_link(vport, ulp_status, ulp_word4)) in lpfc_cmpl_els_logo()
3056 lpfc_disc_state_machine(vport, ndlp, cmdiocb, NLP_EVT_CMPL_LOGO); in lpfc_cmpl_els_logo()
3070 lpfc_disc_state_machine(vport, ndlp, cmdiocb, in lpfc_cmpl_els_logo()
3091 lpfc_cancel_retry_delay_tmo(vport, ndlp); in lpfc_cmpl_els_logo()
3096 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, in lpfc_cmpl_els_logo()
3101 vport->num_disc_nodes); in lpfc_cmpl_els_logo()
3106 lpfc_disc_start(vport); in lpfc_cmpl_els_logo()
3119 lpfc_disc_state_machine(vport, ndlp, cmdiocb, in lpfc_cmpl_els_logo()
3150 lpfc_issue_els_logo(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, in lpfc_issue_els_logo() argument
3153 struct lpfc_hba *phba = vport->phba; in lpfc_issue_els_logo()
3167 elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, retry, ndlp, in lpfc_issue_els_logo()
3177 *((uint32_t *) (pcmd)) = be32_to_cpu(vport->fc_myDID); in lpfc_issue_els_logo()
3179 memcpy(pcmd, &vport->fc_portname, sizeof(struct lpfc_name)); in lpfc_issue_els_logo()
3193 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_issue_els_logo()
3207 lpfc_nlp_set_state(vport, ndlp, NLP_STE_LOGO_ISSUE); in lpfc_issue_els_logo()
3236 struct lpfc_vport *vport = cmdiocb->vport; in lpfc_cmpl_els_cmd() local
3254 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_cmpl_els_cmd()
3259 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, in lpfc_cmpl_els_cmd()
3264 lpfc_els_chk_latt(vport); in lpfc_cmpl_els_cmd()
3287 lpfc_reg_fab_ctrl_node(struct lpfc_vport *vport, struct lpfc_nodelist *fc_ndlp) in lpfc_reg_fab_ctrl_node() argument
3290 struct lpfc_hba *phba = vport->phba; in lpfc_reg_fab_ctrl_node()
3297 ns_ndlp = lpfc_findnode_did(vport, NameServer_DID); in lpfc_reg_fab_ctrl_node()
3301 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE, in lpfc_reg_fab_ctrl_node()
3310 lpfc_printf_vlog(vport, KERN_ERR, LOG_NODE, in lpfc_reg_fab_ctrl_node()
3317 rc = lpfc_reg_rpi(phba, vport->vpi, fc_ndlp->nlp_DID, in lpfc_reg_fab_ctrl_node()
3318 (u8 *)&vport->fc_sparam, mbox, fc_ndlp->nlp_rpi); in lpfc_reg_fab_ctrl_node()
3332 mbox->vport = vport; in lpfc_reg_fab_ctrl_node()
3340 lpfc_nlp_set_state(vport, fc_ndlp, in lpfc_reg_fab_ctrl_node()
3346 lpfc_printf_vlog(vport, KERN_ERR, LOG_NODE, in lpfc_reg_fab_ctrl_node()
3369 struct lpfc_vport *vport = cmdiocb->vport; in lpfc_cmpl_els_disc_cmd() local
3391 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_cmpl_els_disc_cmd()
3396 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS | LOG_CGN_MGMT, in lpfc_cmpl_els_disc_cmd()
3417 lpfc_issue_els_scr(vport, cmdiocb->retry); in lpfc_cmpl_els_disc_cmd()
3420 lpfc_issue_els_edc(vport, cmdiocb->retry); in lpfc_cmpl_els_disc_cmd()
3423 lpfc_issue_els_rdf(vport, cmdiocb->retry); in lpfc_cmpl_els_disc_cmd()
3437 lpfc_printf_vlog(vport, KERN_WARNING, LOG_ELS | LOG_CGN_MGMT, in lpfc_cmpl_els_disc_cmd()
3461 lpfc_printf_vlog(vport, KERN_INFO, in lpfc_cmpl_els_disc_cmd()
3473 lpfc_els_chk_latt(vport); in lpfc_cmpl_els_disc_cmd()
3500 lpfc_issue_els_scr(struct lpfc_vport *vport, uint8_t retry) in lpfc_issue_els_scr() argument
3503 struct lpfc_hba *phba = vport->phba; in lpfc_issue_els_scr()
3511 ndlp = lpfc_findnode_did(vport, Fabric_Cntl_DID); in lpfc_issue_els_scr()
3513 ndlp = lpfc_nlp_init(vport, Fabric_Cntl_DID); in lpfc_issue_els_scr()
3516 lpfc_enqueue_node(vport, ndlp); in lpfc_issue_els_scr()
3519 elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, retry, ndlp, in lpfc_issue_els_scr()
3525 rc = lpfc_reg_fab_ctrl_node(vport, ndlp); in lpfc_issue_els_scr()
3528 lpfc_printf_vlog(vport, KERN_ERR, LOG_NODE, in lpfc_issue_els_scr()
3543 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_issue_els_scr()
3555 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_issue_els_scr()
3589 lpfc_issue_els_rscn(struct lpfc_vport *vport, uint8_t retry) in lpfc_issue_els_rscn() argument
3592 struct lpfc_hba *phba = vport->phba; in lpfc_issue_els_rscn()
3604 !test_bit(FC_PUBLIC_LOOP, &vport->fc_flag)) in lpfc_issue_els_rscn()
3607 if (test_bit(FC_PT2PT, &vport->fc_flag)) { in lpfc_issue_els_rscn()
3609 ndlp = lpfc_findnode_mapped(vport); in lpfc_issue_els_rscn()
3615 ndlp = lpfc_findnode_did(vport, nportid); in lpfc_issue_els_rscn()
3618 ndlp = lpfc_nlp_init(vport, nportid); in lpfc_issue_els_rscn()
3621 lpfc_enqueue_node(vport, ndlp); in lpfc_issue_els_rscn()
3625 elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, retry, ndlp, in lpfc_issue_els_rscn()
3637 nportid = vport->fc_myDID; in lpfc_issue_els_rscn()
3652 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_issue_els_rscn()
3688 lpfc_issue_els_farpr(struct lpfc_vport *vport, uint32_t nportid, uint8_t retry) in lpfc_issue_els_farpr() argument
3691 struct lpfc_hba *phba = vport->phba; in lpfc_issue_els_farpr()
3702 ndlp = lpfc_findnode_did(vport, nportid); in lpfc_issue_els_farpr()
3704 ndlp = lpfc_nlp_init(vport, nportid); in lpfc_issue_els_farpr()
3707 lpfc_enqueue_node(vport, ndlp); in lpfc_issue_els_farpr()
3710 elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, retry, ndlp, in lpfc_issue_els_farpr()
3725 *lp++ = be32_to_cpu(vport->fc_myDID); in lpfc_issue_els_farpr()
3729 memcpy(&fp->RportName, &vport->fc_portname, sizeof(struct lpfc_name)); in lpfc_issue_els_farpr()
3730 memcpy(&fp->RnodeName, &vport->fc_nodename, sizeof(struct lpfc_name)); in lpfc_issue_els_farpr()
3731 ondlp = lpfc_findnode_did(vport, nportid); in lpfc_issue_els_farpr()
3739 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_issue_els_farpr()
3785 lpfc_issue_els_rdf(struct lpfc_vport *vport, uint8_t retry) in lpfc_issue_els_rdf() argument
3787 struct lpfc_hba *phba = vport->phba; in lpfc_issue_els_rdf()
3796 ndlp = lpfc_findnode_did(vport, Fabric_Cntl_DID); in lpfc_issue_els_rdf()
3798 ndlp = lpfc_nlp_init(vport, Fabric_Cntl_DID); in lpfc_issue_els_rdf()
3801 lpfc_enqueue_node(vport, ndlp); in lpfc_issue_els_rdf()
3805 if (vport->port_type == LPFC_NPIV_PORT) in lpfc_issue_els_rdf()
3808 elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, retry, ndlp, in lpfc_issue_els_rdf()
3828 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS | LOG_CGN_MGMT, in lpfc_issue_els_rdf()
3841 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_issue_els_rdf()
3869 lpfc_els_rcv_rdf(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, in lpfc_els_rcv_rdf() argument
3873 if (lpfc_els_rsp_acc(vport, ELS_CMD_RDF, cmdiocb, ndlp, NULL)) { in lpfc_els_rcv_rdf()
3874 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS | LOG_CGN_MGMT, in lpfc_els_rcv_rdf()
3876 ndlp->nlp_DID, vport->fc_myDID); in lpfc_els_rcv_rdf()
3881 if (lpfc_issue_els_rdf(vport, 0)) { in lpfc_els_rcv_rdf()
3882 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS | LOG_CGN_MGMT, in lpfc_els_rcv_rdf()
3884 vport->fc_myDID); in lpfc_els_rcv_rdf()
4284 lpfc_issue_els_edc(struct lpfc_vport *vport, uint8_t retry) in lpfc_issue_els_edc() argument
4286 struct lpfc_hba *phba = vport->phba; in lpfc_issue_els_edc()
4296 if (vport->port_type == LPFC_NPIV_PORT) in lpfc_issue_els_edc()
4299 ndlp = lpfc_findnode_did(vport, Fabric_DID); in lpfc_issue_els_edc()
4314 elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, retry, ndlp, in lpfc_issue_els_edc()
4336 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS | LOG_CGN_MGMT, in lpfc_issue_els_edc()
4349 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_issue_els_edc()
4366 rc = lpfc_issue_els_rdf(vport, 0); in lpfc_issue_els_edc()
4383 lpfc_cancel_retry_delay_tmo(struct lpfc_vport *vport, struct lpfc_nodelist *nlp) in lpfc_cancel_retry_delay_tmo() argument
4404 if (vport->num_disc_nodes) { in lpfc_cancel_retry_delay_tmo()
4405 if (vport->port_state < LPFC_VPORT_READY) { in lpfc_cancel_retry_delay_tmo()
4407 lpfc_more_adisc(vport); in lpfc_cancel_retry_delay_tmo()
4410 lpfc_more_plogi(vport); in lpfc_cancel_retry_delay_tmo()
4411 if (vport->num_disc_nodes == 0) { in lpfc_cancel_retry_delay_tmo()
4413 &vport->fc_flag); in lpfc_cancel_retry_delay_tmo()
4414 lpfc_can_disctmo(vport); in lpfc_cancel_retry_delay_tmo()
4415 lpfc_end_rscn(vport); in lpfc_cancel_retry_delay_tmo()
4441 struct lpfc_vport *vport = ndlp->vport; in lpfc_els_retry_delay() local
4442 struct lpfc_hba *phba = vport->phba; in lpfc_els_retry_delay()
4477 struct lpfc_vport *vport = ndlp->vport; in lpfc_els_retry_delay_handler() local
4502 lpfc_issue_els_flogi(vport, ndlp, retry); in lpfc_els_retry_delay_handler()
4505 if (!lpfc_issue_els_plogi(vport, ndlp->nlp_DID, retry)) { in lpfc_els_retry_delay_handler()
4507 lpfc_nlp_set_state(vport, ndlp, NLP_STE_PLOGI_ISSUE); in lpfc_els_retry_delay_handler()
4511 if (!lpfc_issue_els_adisc(vport, ndlp, retry)) { in lpfc_els_retry_delay_handler()
4513 lpfc_nlp_set_state(vport, ndlp, NLP_STE_ADISC_ISSUE); in lpfc_els_retry_delay_handler()
4518 if (!lpfc_issue_els_prli(vport, ndlp, retry)) { in lpfc_els_retry_delay_handler()
4520 lpfc_nlp_set_state(vport, ndlp, NLP_STE_PRLI_ISSUE); in lpfc_els_retry_delay_handler()
4524 if (!lpfc_issue_els_logo(vport, ndlp, retry)) { in lpfc_els_retry_delay_handler()
4526 lpfc_nlp_set_state(vport, ndlp, NLP_STE_LOGO_ISSUE); in lpfc_els_retry_delay_handler()
4530 if (!test_bit(FC_VPORT_NEEDS_INIT_VPI, &vport->fc_flag)) in lpfc_els_retry_delay_handler()
4531 lpfc_issue_els_fdisc(vport, ndlp, retry); in lpfc_els_retry_delay_handler()
4550 lpfc_link_reset(struct lpfc_vport *vport) in lpfc_link_reset() argument
4552 struct lpfc_hba *phba = vport->phba; in lpfc_link_reset()
4557 lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, in lpfc_link_reset()
4580 mbox->vport = vport; in lpfc_link_reset()
4618 struct lpfc_vport *vport = cmdiocb->vport; in lpfc_els_retry() local
4647 ndlp = lpfc_findnode_did(vport, did); in lpfc_els_retry()
4652 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_els_retry()
4678 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_els_retry()
4768 if (test_bit(FC_PT2PT, &vport->fc_flag) && in lpfc_els_retry()
4775 lpfc_printf_vlog(vport, KERN_WARNING, LOG_ELS, in lpfc_els_retry()
4781 set_bit(FC_PT2PT_NO_NVME, &vport->fc_flag); in lpfc_els_retry()
4795 lpfc_printf_vlog(vport, KERN_INFO, in lpfc_els_retry()
4836 lpfc_vlog_msg(vport, KERN_WARNING, LOG_ELS, in lpfc_els_retry()
4840 lpfc_vport_set_state(vport, in lpfc_els_retry()
4873 vport->fc_sparam.cmn.bbRcvSizeMsb &= 0xf; in lpfc_els_retry()
4875 lpfc_vlog_msg(vport, KERN_WARNING, LOG_ELS, in lpfc_els_retry()
4888 lpfc_vlog_msg(vport, KERN_WARNING, LOG_ELS, in lpfc_els_retry()
4892 lpfc_vport_set_state(vport, in lpfc_els_retry()
4926 rc = lpfc_link_reset(vport); in lpfc_els_retry()
4943 !lpfc_error_lost_link(vport, ulp_status, ulp_word4)) { in lpfc_els_retry()
4957 !lpfc_error_lost_link(vport, ulp_status, ulp_word4)) { in lpfc_els_retry()
4960 maxretry = vport->cfg_devloss_tmo; in lpfc_els_retry()
4970 if (test_bit(FC_UNLOADING, &vport->load_flag)) in lpfc_els_retry()
4978 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, in lpfc_els_retry()
4988 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, in lpfc_els_retry()
5000 if (timer_pending(&vport->fc_disctmo) || in lpfc_els_retry()
5001 test_bit(FC_RSCN_MODE, &vport->fc_flag)) in lpfc_els_retry()
5002 lpfc_set_disctmo(vport); in lpfc_els_retry()
5020 lpfc_nlp_set_state(vport, ndlp, in lpfc_els_retry()
5023 lpfc_nlp_set_state(vport, ndlp, in lpfc_els_retry()
5031 lpfc_issue_els_flogi(vport, ndlp, cmdiocb->retry); in lpfc_els_retry()
5034 lpfc_issue_els_fdisc(vport, ndlp, cmdiocb->retry); in lpfc_els_retry()
5039 lpfc_nlp_set_state(vport, ndlp, in lpfc_els_retry()
5042 lpfc_issue_els_plogi(vport, did, cmdiocb->retry); in lpfc_els_retry()
5046 lpfc_nlp_set_state(vport, ndlp, NLP_STE_ADISC_ISSUE); in lpfc_els_retry()
5047 lpfc_issue_els_adisc(vport, ndlp, cmdiocb->retry); in lpfc_els_retry()
5052 lpfc_nlp_set_state(vport, ndlp, NLP_STE_PRLI_ISSUE); in lpfc_els_retry()
5053 lpfc_issue_els_prli(vport, ndlp, cmdiocb->retry); in lpfc_els_retry()
5057 lpfc_nlp_set_state(vport, ndlp, NLP_STE_LOGO_ISSUE); in lpfc_els_retry()
5058 lpfc_issue_els_logo(vport, ndlp, cmdiocb->retry); in lpfc_els_retry()
5064 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_els_retry()
5072 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, in lpfc_els_retry()
5230 struct lpfc_vport *vport = cmdiocb->vport; in lpfc_cmpl_els_logo_acc() local
5236 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_RSP, in lpfc_cmpl_els_logo_acc()
5240 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, in lpfc_cmpl_els_logo_acc()
5258 lpfc_unreg_rpi(vport, ndlp); in lpfc_cmpl_els_logo_acc()
5268 lpfc_nlp_set_state(vport, ndlp, NLP_STE_PLOGI_ISSUE); in lpfc_cmpl_els_logo_acc()
5269 lpfc_issue_els_plogi(vport, ndlp->nlp_DID, 0); in lpfc_cmpl_els_logo_acc()
5302 lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_NODE, in lpfc_mbx_cmpl_dflt_rpi()
5320 lpfc_drop_node(ndlp->vport, ndlp); in lpfc_mbx_cmpl_dflt_rpi()
5344 struct lpfc_vport *vport = ndlp ? ndlp->vport : NULL; in lpfc_cmpl_els_rsp() local
5345 struct Scsi_Host *shost = vport ? lpfc_shost_from_vport(vport) : NULL; in lpfc_cmpl_els_rsp()
5350 if (!vport) { in lpfc_cmpl_els_rsp()
5372 if (!ndlp || lpfc_els_chk_latt(vport)) { in lpfc_cmpl_els_rsp()
5378 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_RSP, in lpfc_cmpl_els_rsp()
5382 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, in lpfc_cmpl_els_rsp()
5391 if (!lpfc_unreg_rpi(vport, ndlp) && in lpfc_cmpl_els_rsp()
5392 !test_bit(FC_PT2PT, &vport->fc_flag)) { in lpfc_cmpl_els_rsp()
5396 lpfc_printf_vlog(vport, KERN_INFO, in lpfc_cmpl_els_rsp()
5416 mbox->vport = vport; in lpfc_cmpl_els_rsp()
5424 lpfc_nlp_set_state(vport, ndlp, in lpfc_cmpl_els_rsp()
5440 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_cmpl_els_rsp()
5462 vport && vport->port_type == LPFC_NPIV_PORT && in lpfc_cmpl_els_rsp()
5473 lpfc_drop_node(vport, ndlp); in lpfc_cmpl_els_rsp()
5484 lpfc_drop_node(vport, ndlp); in lpfc_cmpl_els_rsp()
5520 lpfc_els_rsp_acc(struct lpfc_vport *vport, uint32_t flag, in lpfc_els_rsp_acc() argument
5524 struct lpfc_hba *phba = vport->phba; in lpfc_els_rsp_acc()
5540 elsiocb = lpfc_prep_els_iocb(vport, 0, cmdsize, oldiocb->retry, in lpfc_els_rsp_acc()
5572 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_RSP, in lpfc_els_rsp_acc()
5579 elsiocb = lpfc_prep_els_iocb(vport, 0, cmdsize, oldiocb->retry, in lpfc_els_rsp_acc()
5627 memcpy(&sp->portName, &vport->fc_sparam.portName, in lpfc_els_rsp_acc()
5629 memcpy(&sp->nodeName, &vport->fc_sparam.nodeName, in lpfc_els_rsp_acc()
5632 memcpy(pcmd, &vport->fc_sparam, in lpfc_els_rsp_acc()
5651 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_RSP, in lpfc_els_rsp_acc()
5657 elsiocb = lpfc_prep_els_iocb(vport, 0, cmdsize, oldiocb->retry, in lpfc_els_rsp_acc()
5689 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_RSP, in lpfc_els_rsp_acc()
5695 elsiocb = lpfc_prep_els_iocb(vport, 0, cmdsize, oldiocb->retry, in lpfc_els_rsp_acc()
5761 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, in lpfc_els_rsp_acc()
5767 ndlp->nlp_rpi, vport->fc_flag, kref_read(&ndlp->kref)); in lpfc_els_rsp_acc()
5794 lpfc_els_rsp_reject(struct lpfc_vport *vport, uint32_t rejectError, in lpfc_els_rsp_reject() argument
5799 struct lpfc_hba *phba = vport->phba; in lpfc_els_rsp_reject()
5808 elsiocb = lpfc_prep_els_iocb(vport, 0, cmdsize, oldiocb->retry, ndlp, in lpfc_els_rsp_reject()
5836 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, in lpfc_els_rsp_reject()
5843 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_RSP, in lpfc_els_rsp_reject()
5860 vport->port_type == LPFC_NPIV_PORT && in lpfc_els_rsp_reject()
5892 lpfc_issue_els_edc_rsp(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, in lpfc_issue_els_edc_rsp() argument
5895 struct lpfc_hba *phba = vport->phba; in lpfc_issue_els_edc_rsp()
5911 elsiocb = lpfc_prep_els_iocb(vport, 0, cmdsize, cmdiocb->retry, in lpfc_issue_els_edc_rsp()
5946 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_RSP, in lpfc_issue_els_edc_rsp()
5967 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, in lpfc_issue_els_edc_rsp()
5973 ndlp->nlp_rpi, vport->fc_flag); in lpfc_issue_els_edc_rsp()
5998 lpfc_els_rsp_adisc_acc(struct lpfc_vport *vport, struct lpfc_iocbq *oldiocb, in lpfc_els_rsp_adisc_acc() argument
6001 struct lpfc_hba *phba = vport->phba; in lpfc_els_rsp_adisc_acc()
6012 elsiocb = lpfc_prep_els_iocb(vport, 0, cmdsize, oldiocb->retry, ndlp, in lpfc_els_rsp_adisc_acc()
6036 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, in lpfc_els_rsp_adisc_acc()
6049 memcpy(&ap->portName, &vport->fc_portname, sizeof(struct lpfc_name)); in lpfc_els_rsp_adisc_acc()
6050 memcpy(&ap->nodeName, &vport->fc_nodename, sizeof(struct lpfc_name)); in lpfc_els_rsp_adisc_acc()
6051 ap->DID = be32_to_cpu(vport->fc_myDID); in lpfc_els_rsp_adisc_acc()
6053 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_RSP, in lpfc_els_rsp_adisc_acc()
6095 lpfc_els_rsp_prli_acc(struct lpfc_vport *vport, struct lpfc_iocbq *oldiocb, in lpfc_els_rsp_prli_acc() argument
6098 struct lpfc_hba *phba = vport->phba; in lpfc_els_rsp_prli_acc()
6122 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, in lpfc_els_rsp_prli_acc()
6136 elsiocb = lpfc_prep_els_iocb(vport, 0, cmdsize, oldiocb->retry, ndlp, in lpfc_els_rsp_prli_acc()
6158 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, in lpfc_els_rsp_prli_acc()
6199 lpfc_printf_vlog(vport, KERN_INFO, in lpfc_els_rsp_prli_acc()
6229 lpfc_printf_vlog(vport, KERN_INFO, LOG_NVME_DISC, in lpfc_els_rsp_prli_acc()
6240 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_els_rsp_prli_acc()
6245 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_RSP, in lpfc_els_rsp_prli_acc()
6288 lpfc_els_rsp_rnid_acc(struct lpfc_vport *vport, uint8_t format, in lpfc_els_rsp_rnid_acc() argument
6291 struct lpfc_hba *phba = vport->phba; in lpfc_els_rsp_rnid_acc()
6306 elsiocb = lpfc_prep_els_iocb(vport, 0, cmdsize, oldiocb->retry, ndlp, in lpfc_els_rsp_rnid_acc()
6328 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, in lpfc_els_rsp_rnid_acc()
6339 memcpy(&rn->portName, &vport->fc_portname, sizeof(struct lpfc_name)); in lpfc_els_rsp_rnid_acc()
6340 memcpy(&rn->nodeName, &vport->fc_nodename, sizeof(struct lpfc_name)); in lpfc_els_rsp_rnid_acc()
6348 &vport->fc_portname, sizeof(struct lpfc_name)); in lpfc_els_rsp_rnid_acc()
6359 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_RSP, in lpfc_els_rsp_rnid_acc()
6390 lpfc_els_clear_rrq(struct lpfc_vport *vport, in lpfc_els_clear_rrq() argument
6393 struct lpfc_hba *phba = vport->phba; in lpfc_els_clear_rrq()
6407 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, in lpfc_els_clear_rrq()
6416 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_RSP, in lpfc_els_clear_rrq()
6419 if (vport->fc_myDID == be32_to_cpu(bf_get(rrq_did, rrq))) in lpfc_els_clear_rrq()
6423 prrq = lpfc_get_active_rrq(vport, xri, ndlp->nlp_DID); in lpfc_els_clear_rrq()
6441 lpfc_els_rsp_echo_acc(struct lpfc_vport *vport, uint8_t *data, in lpfc_els_rsp_echo_acc() argument
6444 struct lpfc_hba *phba = vport->phba; in lpfc_els_rsp_echo_acc()
6463 elsiocb = lpfc_prep_els_iocb(vport, 0, cmdsize, oldiocb->retry, ndlp, in lpfc_els_rsp_echo_acc()
6485 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, in lpfc_els_rsp_echo_acc()
6493 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_RSP, in lpfc_els_rsp_echo_acc()
6535 lpfc_els_disc_adisc(struct lpfc_vport *vport) in lpfc_els_disc_adisc() argument
6541 list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, nlp_listp) { in lpfc_els_disc_adisc()
6559 lpfc_nlp_unreg_node(vport, ndlp); in lpfc_els_disc_adisc()
6560 lpfc_unreg_rpi(vport, ndlp); in lpfc_els_disc_adisc()
6565 lpfc_nlp_set_state(vport, ndlp, NLP_STE_ADISC_ISSUE); in lpfc_els_disc_adisc()
6566 lpfc_issue_els_adisc(vport, ndlp, 0); in lpfc_els_disc_adisc()
6568 vport->num_disc_nodes++; in lpfc_els_disc_adisc()
6569 if (vport->num_disc_nodes >= in lpfc_els_disc_adisc()
6570 vport->cfg_discovery_threads) { in lpfc_els_disc_adisc()
6571 set_bit(FC_NLP_MORE, &vport->fc_flag); in lpfc_els_disc_adisc()
6577 clear_bit(FC_NLP_MORE, &vport->fc_flag); in lpfc_els_disc_adisc()
6601 lpfc_els_disc_plogi(struct lpfc_vport *vport) in lpfc_els_disc_plogi() argument
6607 list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, nlp_listp) { in lpfc_els_disc_plogi()
6613 lpfc_nlp_set_state(vport, ndlp, NLP_STE_PLOGI_ISSUE); in lpfc_els_disc_plogi()
6614 lpfc_issue_els_plogi(vport, ndlp->nlp_DID, 0); in lpfc_els_disc_plogi()
6616 vport->num_disc_nodes++; in lpfc_els_disc_plogi()
6617 if (vport->num_disc_nodes >= in lpfc_els_disc_plogi()
6618 vport->cfg_discovery_threads) { in lpfc_els_disc_plogi()
6619 set_bit(FC_NLP_MORE, &vport->fc_flag); in lpfc_els_disc_plogi()
6625 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_els_disc_plogi()
6627 sentplogi, vport->fc_flag); in lpfc_els_disc_plogi()
6630 lpfc_set_disctmo(vport); in lpfc_els_disc_plogi()
6632 clear_bit(FC_NLP_MORE, &vport->fc_flag); in lpfc_els_disc_plogi()
6744 struct lpfc_vport *vport) in lpfc_rdp_res_bbc_desc() argument
6750 bbCredit = vport->fc_sparam.cmn.bbCreditLsb | in lpfc_rdp_res_bbc_desc()
6751 (vport->fc_sparam.cmn.bbCreditMsb << 8); in lpfc_rdp_res_bbc_desc()
6753 if (vport->phba->fc_topology != LPFC_TOPOLOGY_LOOP) { in lpfc_rdp_res_bbc_desc()
6754 bbCredit = vport->phba->fc_fabparam.cmn.bbCreditLsb | in lpfc_rdp_res_bbc_desc()
6755 (vport->phba->fc_fabparam.cmn.bbCreditMsb << 8); in lpfc_rdp_res_bbc_desc()
6914 uint8_t *page_a0, struct lpfc_vport *vport) in lpfc_rdp_res_opd_desc() argument
7022 struct lpfc_vport *vport) in lpfc_rdp_res_diag_port_names() argument
7027 memcpy(desc->port_names.wwnn, &vport->fc_nodename, in lpfc_rdp_res_diag_port_names()
7030 memcpy(desc->port_names.wwpn, &vport->fc_portname, in lpfc_rdp_res_diag_port_names()
7039 struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) in lpfc_rdp_res_attach_port_names() argument
7043 if (test_bit(FC_FABRIC, &vport->fc_flag)) { in lpfc_rdp_res_attach_port_names()
7044 memcpy(desc->port_names.wwnn, &vport->fabric_nodename, in lpfc_rdp_res_attach_port_names()
7047 memcpy(desc->port_names.wwpn, &vport->fabric_portname, in lpfc_rdp_res_attach_port_names()
7066 struct lpfc_vport *vport = ndlp->vport; in lpfc_els_rdp_cmpl() local
7085 elsiocb = lpfc_prep_els_iocb(vport, 0, cmdsize, in lpfc_els_rdp_cmpl()
7105 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, in lpfc_els_rdp_cmpl()
7134 (len + pcmd), vport); in lpfc_els_rdp_cmpl()
7136 (len + pcmd), vport, ndlp); in lpfc_els_rdp_cmpl()
7140 &rdp_context->link_stat, vport); in lpfc_els_rdp_cmpl()
7157 rdp_context->page_a0, vport); in lpfc_els_rdp_cmpl()
7185 elsiocb = lpfc_prep_els_iocb(vport, 0, cmdsize, lpfc_max_els_tries, in lpfc_els_rdp_cmpl()
7247 mbox->vport = rdp_context->ndlp->vport; in lpfc_get_rdp_info()
7308 mbox->vport = phba->pport; in lpfc_get_sfp_info_wait()
7335 mbox->vport = phba->pport; in lpfc_get_sfp_info_wait()
7412 lpfc_els_rcv_rdp(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, in lpfc_els_rcv_rdp() argument
7415 struct lpfc_hba *phba = vport->phba; in lpfc_els_rcv_rdp()
7441 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, in lpfc_els_rcv_rdp()
7476 lpfc_printf_vlog(ndlp->vport, KERN_WARNING, LOG_ELS, in lpfc_els_rcv_rdp()
7493 lpfc_els_rsp_reject(vport, stat.un.lsRjtError, cmdiocb, ndlp, NULL); in lpfc_els_rcv_rdp()
7637 lpfc_sli4_set_beacon(struct lpfc_vport *vport, in lpfc_sli4_set_beacon() argument
7641 struct lpfc_hba *phba = vport->phba; in lpfc_sli4_set_beacon()
7658 mbox->vport = phba->pport; in lpfc_sli4_set_beacon()
7723 lpfc_els_rcv_lcb(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, in lpfc_els_rcv_lcb() argument
7726 struct lpfc_hba *phba = vport->phba; in lpfc_els_rcv_lcb()
7738 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, in lpfc_els_rcv_lcb()
7782 if (lpfc_sli4_set_beacon(vport, lcb_context, state)) { in lpfc_els_rcv_lcb()
7783 lpfc_printf_vlog(ndlp->vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_els_rcv_lcb()
7796 lpfc_els_rsp_reject(vport, stat.un.lsRjtError, cmdiocb, ndlp, NULL); in lpfc_els_rcv_lcb()
7811 lpfc_els_flush_rscn(struct lpfc_vport *vport) in lpfc_els_flush_rscn() argument
7813 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_els_flush_rscn()
7814 struct lpfc_hba *phba = vport->phba; in lpfc_els_flush_rscn()
7818 if (vport->fc_rscn_flush) { in lpfc_els_flush_rscn()
7824 vport->fc_rscn_flush = 1; in lpfc_els_flush_rscn()
7827 for (i = 0; i < vport->fc_rscn_id_cnt; i++) { in lpfc_els_flush_rscn()
7828 lpfc_in_buf_free(phba, vport->fc_rscn_id_list[i]); in lpfc_els_flush_rscn()
7829 vport->fc_rscn_id_list[i] = NULL; in lpfc_els_flush_rscn()
7831 clear_bit(FC_RSCN_MODE, &vport->fc_flag); in lpfc_els_flush_rscn()
7832 clear_bit(FC_RSCN_DISCOVERY, &vport->fc_flag); in lpfc_els_flush_rscn()
7834 vport->fc_rscn_id_cnt = 0; in lpfc_els_flush_rscn()
7836 lpfc_can_disctmo(vport); in lpfc_els_flush_rscn()
7838 vport->fc_rscn_flush = 0; in lpfc_els_flush_rscn()
7854 lpfc_rscn_payload_check(struct lpfc_vport *vport, uint32_t did) in lpfc_rscn_payload_check() argument
7860 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_rscn_payload_check()
7869 if (test_bit(FC_RSCN_DISCOVERY, &vport->fc_flag)) in lpfc_rscn_payload_check()
7873 if (vport->fc_rscn_flush) { in lpfc_rscn_payload_check()
7879 vport->fc_rscn_flush = 1; in lpfc_rscn_payload_check()
7881 for (i = 0; i < vport->fc_rscn_id_cnt; i++) { in lpfc_rscn_payload_check()
7882 lp = vport->fc_rscn_id_list[i]->virt; in lpfc_rscn_payload_check()
7910 vport->fc_rscn_flush = 0; in lpfc_rscn_payload_check()
7914 vport->fc_rscn_flush = 0; in lpfc_rscn_payload_check()
7930 lpfc_rscn_recovery_check(struct lpfc_vport *vport) in lpfc_rscn_recovery_check() argument
7935 list_for_each_entry_safe(ndlp, n, &vport->fc_nodes, nlp_listp) { in lpfc_rscn_recovery_check()
7937 !lpfc_rscn_payload_check(vport, ndlp->nlp_DID)) in lpfc_rscn_recovery_check()
7941 if (vport->phba->nvmet_support) in lpfc_rscn_recovery_check()
7956 lpfc_disc_state_machine(vport, ndlp, NULL, in lpfc_rscn_recovery_check()
7958 lpfc_cancel_retry_delay_tmo(vport, ndlp); in lpfc_rscn_recovery_check()
7972 lpfc_send_rscn_event(struct lpfc_vport *vport, in lpfc_send_rscn_event() argument
7976 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_send_rscn_event()
7988 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_send_rscn_event()
8029 lpfc_els_rcv_rscn(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, in lpfc_els_rcv_rscn() argument
8032 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_els_rcv_rscn()
8033 struct lpfc_hba *phba = vport->phba; in lpfc_els_rcv_rscn()
8047 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_els_rcv_rscn()
8049 vport->fc_flag, payload_len, *lp, in lpfc_els_rcv_rscn()
8050 vport->fc_rscn_id_cnt); in lpfc_els_rcv_rscn()
8053 lpfc_send_rscn_event(vport, cmdiocb); in lpfc_els_rcv_rscn()
8060 if (test_bit(FC_PT2PT, &vport->fc_flag)) { in lpfc_els_rcv_rscn()
8062 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, in lpfc_els_rcv_rscn()
8064 *lp, vport->fc_flag, payload_len); in lpfc_els_rcv_rscn()
8065 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL); in lpfc_els_rcv_rscn()
8072 lpfc_nvme_rescan_port(vport, ndlp); in lpfc_els_rcv_rscn()
8079 if (vport->port_state <= LPFC_NS_QRY) { in lpfc_els_rcv_rscn()
8080 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, in lpfc_els_rcv_rscn()
8082 ndlp->nlp_DID, vport->port_state, ndlp->nlp_flag); in lpfc_els_rcv_rscn()
8084 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL); in lpfc_els_rcv_rscn()
8092 !(vport->cfg_peer_port_login)) { in lpfc_els_rcv_rscn()
8105 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_els_rcv_rscn()
8108 vport->fc_flag, payload_len, in lpfc_els_rcv_rscn()
8109 *lp, vport->fc_rscn_id_cnt); in lpfc_els_rcv_rscn()
8110 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, in lpfc_els_rcv_rscn()
8112 ndlp->nlp_DID, vport->port_state, in lpfc_els_rcv_rscn()
8115 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, in lpfc_els_rcv_rscn()
8118 if (test_bit(FC_DISC_TMO, &vport->fc_flag)) { in lpfc_els_rcv_rscn()
8120 mod_timer(&vport->fc_disctmo, in lpfc_els_rcv_rscn()
8129 if (vport->fc_rscn_flush) { in lpfc_els_rcv_rscn()
8132 set_bit(FC_RSCN_DISCOVERY, &vport->fc_flag); in lpfc_els_rcv_rscn()
8134 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL); in lpfc_els_rcv_rscn()
8138 vport->fc_rscn_flush = 1; in lpfc_els_rcv_rscn()
8141 rscn_cnt = vport->fc_rscn_id_cnt; in lpfc_els_rcv_rscn()
8145 if (test_bit(FC_RSCN_MODE, &vport->fc_flag) || in lpfc_els_rcv_rscn()
8146 test_bit(FC_NDISC_ACTIVE, &vport->fc_flag)) { in lpfc_els_rcv_rscn()
8147 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, in lpfc_els_rcv_rscn()
8149 ndlp->nlp_DID, vport->port_state, ndlp->nlp_flag); in lpfc_els_rcv_rscn()
8151 set_bit(FC_RSCN_DEFERRED, &vport->fc_flag); in lpfc_els_rcv_rscn()
8154 if (test_bit(FC_DISC_TMO, &vport->fc_flag)) { in lpfc_els_rcv_rscn()
8156 mod_timer(&vport->fc_disctmo, in lpfc_els_rcv_rscn()
8160 !test_bit(FC_RSCN_DISCOVERY, &vport->fc_flag)) { in lpfc_els_rcv_rscn()
8161 set_bit(FC_RSCN_MODE, &vport->fc_flag); in lpfc_els_rcv_rscn()
8163 cmd = vport->fc_rscn_id_list[rscn_cnt-1]->virt; in lpfc_els_rcv_rscn()
8173 vport->fc_rscn_id_list[rscn_cnt] = pcmd; in lpfc_els_rcv_rscn()
8174 vport->fc_rscn_id_cnt++; in lpfc_els_rcv_rscn()
8181 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_els_rcv_rscn()
8184 vport->fc_rscn_id_cnt, vport->fc_flag, in lpfc_els_rcv_rscn()
8185 vport->port_state); in lpfc_els_rcv_rscn()
8187 set_bit(FC_RSCN_DISCOVERY, &vport->fc_flag); in lpfc_els_rcv_rscn()
8189 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_els_rcv_rscn()
8192 vport->fc_rscn_id_cnt, vport->fc_flag, in lpfc_els_rcv_rscn()
8193 vport->port_state); in lpfc_els_rcv_rscn()
8196 vport->fc_rscn_flush = 0; in lpfc_els_rcv_rscn()
8198 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL); in lpfc_els_rcv_rscn()
8200 lpfc_rscn_recovery_check(vport); in lpfc_els_rcv_rscn()
8203 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, in lpfc_els_rcv_rscn()
8205 ndlp->nlp_DID, vport->port_state, ndlp->nlp_flag); in lpfc_els_rcv_rscn()
8207 set_bit(FC_RSCN_MODE, &vport->fc_flag); in lpfc_els_rcv_rscn()
8208 vport->fc_rscn_id_list[vport->fc_rscn_id_cnt++] = pcmd; in lpfc_els_rcv_rscn()
8210 vport->fc_rscn_flush = 0; in lpfc_els_rcv_rscn()
8216 lpfc_set_disctmo(vport); in lpfc_els_rcv_rscn()
8218 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL); in lpfc_els_rcv_rscn()
8220 lpfc_rscn_recovery_check(vport); in lpfc_els_rcv_rscn()
8221 return lpfc_els_handle_rscn(vport); in lpfc_els_rcv_rscn()
8241 lpfc_els_handle_rscn(struct lpfc_vport *vport) in lpfc_els_handle_rscn() argument
8244 struct lpfc_hba *phba = vport->phba; in lpfc_els_handle_rscn()
8247 if (test_bit(FC_UNLOADING, &vport->load_flag)) { in lpfc_els_handle_rscn()
8248 lpfc_els_flush_rscn(vport); in lpfc_els_handle_rscn()
8253 lpfc_set_disctmo(vport); in lpfc_els_handle_rscn()
8256 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, in lpfc_els_handle_rscn()
8258 vport->fc_flag, 0, vport->fc_rscn_id_cnt, in lpfc_els_handle_rscn()
8259 vport->port_state, vport->num_disc_nodes, in lpfc_els_handle_rscn()
8260 vport->gidft_inp); in lpfc_els_handle_rscn()
8263 vport->fc_ns_retry = 0; in lpfc_els_handle_rscn()
8264 vport->num_disc_nodes = 0; in lpfc_els_handle_rscn()
8266 ndlp = lpfc_findnode_did(vport, NameServer_DID); in lpfc_els_handle_rscn()
8274 if (lpfc_issue_gidft(vport) > 0) in lpfc_els_handle_rscn()
8277 if (lpfc_issue_gidpt(vport) > 0) in lpfc_els_handle_rscn()
8286 lpfc_nlp_set_state(vport, ndlp, NLP_STE_PLOGI_ISSUE); in lpfc_els_handle_rscn()
8288 ndlp = lpfc_nlp_init(vport, NameServer_DID); in lpfc_els_handle_rscn()
8290 lpfc_els_flush_rscn(vport); in lpfc_els_handle_rscn()
8294 lpfc_nlp_set_state(vport, ndlp, NLP_STE_PLOGI_ISSUE); in lpfc_els_handle_rscn()
8297 lpfc_issue_els_plogi(vport, NameServer_DID, 0); in lpfc_els_handle_rscn()
8304 lpfc_els_flush_rscn(vport); in lpfc_els_handle_rscn()
8334 lpfc_els_rcv_flogi(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, in lpfc_els_rcv_flogi() argument
8337 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_els_rcv_flogi()
8338 struct lpfc_hba *phba = vport->phba; in lpfc_els_rcv_flogi()
8357 lpfc_set_disctmo(vport); in lpfc_els_rcv_flogi()
8365 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_els_rcv_flogi()
8372 (void) lpfc_check_sparm(vport, ndlp, sp, CLASS3, 1); in lpfc_els_rcv_flogi()
8379 rc = memcmp(&vport->fc_portname, &sp->portName, in lpfc_els_rcv_flogi()
8394 mbox->vport = vport; in lpfc_els_rcv_flogi()
8406 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS | LOG_LIBDFC, in lpfc_els_rcv_flogi()
8416 set_bit(FC_PT2PT_PLOGI, &vport->fc_flag); in lpfc_els_rcv_flogi()
8423 vport->fc_myDID = PT2PT_LocalID; in lpfc_els_rcv_flogi()
8425 vport->fc_myDID = PT2PT_RemoteID; in lpfc_els_rcv_flogi()
8433 fc_flag = vport->fc_flag; in lpfc_els_rcv_flogi()
8434 port_state = vport->port_state; in lpfc_els_rcv_flogi()
8438 vport->rcv_flogi_cnt++; in lpfc_els_rcv_flogi()
8440 set_bit(FC_PT2PT, &vport->fc_flag); in lpfc_els_rcv_flogi()
8441 clear_bit(FC_FABRIC, &vport->fc_flag); in lpfc_els_rcv_flogi()
8442 clear_bit(FC_PUBLIC_LOOP, &vport->fc_flag); in lpfc_els_rcv_flogi()
8443 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, in lpfc_els_rcv_flogi()
8446 port_state, vport->port_state, in lpfc_els_rcv_flogi()
8447 fc_flag, vport->fc_flag); in lpfc_els_rcv_flogi()
8454 did = vport->fc_myDID; in lpfc_els_rcv_flogi()
8455 vport->fc_myDID = Fabric_DID; in lpfc_els_rcv_flogi()
8466 vport->fc_myDID = did; in lpfc_els_rcv_flogi()
8468 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, in lpfc_els_rcv_flogi()
8486 lpfc_els_rsp_acc(vport, ELS_CMD_FLOGI, cmdiocb, ndlp, NULL); in lpfc_els_rcv_flogi()
8489 vport->fc_myDID = did; in lpfc_els_rcv_flogi()
8511 lpfc_els_rcv_rnid(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, in lpfc_els_rcv_rnid() argument
8531 lpfc_els_rsp_rnid_acc(vport, rn->Format, cmdiocb, ndlp); in lpfc_els_rcv_rnid()
8539 lpfc_els_rsp_reject(vport, stat.un.lsRjtError, cmdiocb, ndlp, in lpfc_els_rcv_rnid()
8555 lpfc_els_rcv_echo(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, in lpfc_els_rcv_echo() argument
8565 lpfc_els_rsp_echo_acc(vport, pcmd, cmdiocb, ndlp); in lpfc_els_rcv_echo()
8583 lpfc_els_rcv_lirr(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, in lpfc_els_rcv_lirr() argument
8593 lpfc_els_rsp_reject(vport, stat.un.lsRjtError, cmdiocb, ndlp, NULL); in lpfc_els_rcv_lirr()
8614 lpfc_els_rcv_rrq(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, in lpfc_els_rcv_rrq() argument
8617 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL); in lpfc_els_rcv_rrq()
8618 if (vport->phba->sli_rev == LPFC_SLI_REV4) in lpfc_els_rcv_rrq()
8619 lpfc_els_clear_rrq(vport, cmdiocb, ndlp); in lpfc_els_rcv_rrq()
8708 lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_ELS, in lpfc_els_rsp_rls_acc()
8749 lpfc_els_rcv_rls(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, in lpfc_els_rcv_rls() argument
8752 struct lpfc_hba *phba = vport->phba; in lpfc_els_rcv_rls()
8770 mbox->vport = vport; in lpfc_els_rcv_rls()
8789 lpfc_els_rsp_reject(vport, stat.un.lsRjtError, cmdiocb, ndlp, NULL); in lpfc_els_rcv_rls()
8815 lpfc_els_rcv_rtv(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, in lpfc_els_rcv_rtv() argument
8821 struct lpfc_hba *phba = vport->phba; in lpfc_els_rcv_rtv()
8870 lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_ELS, in lpfc_els_rcv_rtv()
8899 lpfc_els_rsp_reject(vport, stat.un.lsRjtError, cmdiocb, ndlp, NULL); in lpfc_els_rcv_rtv()
8917 lpfc_issue_els_rrq(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, in lpfc_issue_els_rrq() argument
8920 struct lpfc_hba *phba = vport->phba; in lpfc_issue_els_rrq()
8932 elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, 0, ndlp, did, in lpfc_issue_els_rrq()
8946 bf_set(rrq_did, els_rrq, vport->fc_myDID); in lpfc_issue_els_rrq()
8951 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_issue_els_rrq()
8988 struct lpfc_nodelist *ndlp = lpfc_findnode_did(rrq->vport, in lpfc_send_rrq()
8994 return lpfc_issue_els_rrq(rrq->vport, ndlp, in lpfc_send_rrq()
9020 lpfc_els_rsp_rpl_acc(struct lpfc_vport *vport, uint16_t cmdsize, in lpfc_els_rsp_rpl_acc() argument
9024 struct lpfc_hba *phba = vport->phba; in lpfc_els_rsp_rpl_acc()
9032 elsiocb = lpfc_prep_els_iocb(vport, 0, cmdsize, oldiocb->retry, ndlp, in lpfc_els_rsp_rpl_acc()
9062 rpl_rsp.port_num_blk.portID = be32_to_cpu(vport->fc_myDID); in lpfc_els_rsp_rpl_acc()
9063 memcpy(&rpl_rsp.port_num_blk.portName, &vport->fc_portname, in lpfc_els_rsp_rpl_acc()
9067 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, in lpfc_els_rsp_rpl_acc()
9109 lpfc_els_rcv_rpl(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, in lpfc_els_rcv_rpl() argument
9126 lpfc_els_rsp_reject(vport, stat.un.lsRjtError, cmdiocb, ndlp, in lpfc_els_rcv_rpl()
9145 lpfc_els_rsp_rpl_acc(vport, cmdsize, cmdiocb, ndlp); in lpfc_els_rcv_rpl()
9175 lpfc_els_rcv_farp(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, in lpfc_els_rcv_farp() argument
9183 did = get_job_els_rsp64_did(vport->phba, cmdiocb); in lpfc_els_rcv_farp()
9190 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, in lpfc_els_rcv_farp()
9200 if (memcmp(&fp->RportName, &vport->fc_portname, in lpfc_els_rcv_farp()
9207 if (memcmp(&fp->RnodeName, &vport->fc_nodename, in lpfc_els_rcv_farp()
9218 lpfc_nlp_set_state(vport, ndlp, in lpfc_els_rcv_farp()
9220 lpfc_issue_els_plogi(vport, ndlp->nlp_DID, 0); in lpfc_els_rcv_farp()
9225 lpfc_issue_els_farpr(vport, did, 0); in lpfc_els_rcv_farp()
9246 lpfc_els_rcv_farpr(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, in lpfc_els_rcv_farpr() argument
9251 did = get_job_els_rsp64_did(vport->phba, cmdiocb); in lpfc_els_rcv_farpr()
9254 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, in lpfc_els_rcv_farpr()
9257 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL); in lpfc_els_rcv_farpr()
9282 lpfc_els_rcv_fan(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, in lpfc_els_rcv_fan() argument
9285 struct lpfc_hba *phba = vport->phba; in lpfc_els_rcv_fan()
9289 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, "0265 FAN received\n"); in lpfc_els_rcv_fan()
9293 if ((vport == phba->pport) && in lpfc_els_rcv_fan()
9294 (vport->port_state == LPFC_LOCAL_CFG_LINK)) { in lpfc_els_rcv_fan()
9300 lpfc_issue_init_vfi(vport); in lpfc_els_rcv_fan()
9303 vport->fc_myDID = vport->fc_prevDID; in lpfc_els_rcv_fan()
9305 lpfc_issue_fabric_reglogin(vport); in lpfc_els_rcv_fan()
9307 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, in lpfc_els_rcv_fan()
9309 vport->fc_prevDID, vport->fc_myDID); in lpfc_els_rcv_fan()
9310 lpfc_issue_reg_vfi(vport); in lpfc_els_rcv_fan()
9327 lpfc_els_rcv_edc(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, in lpfc_els_rcv_edc() argument
9330 struct lpfc_hba *phba = vport->phba; in lpfc_els_rcv_edc()
9345 lpfc_printf_vlog(vport, KERN_INFO, in lpfc_els_rcv_edc()
9443 lpfc_issue_els_edc_rsp(vport, cmdiocb, ndlp); in lpfc_els_rcv_edc()
9462 struct lpfc_vport *vport = from_timer(vport, t, els_tmofunc); in lpfc_els_timeout() local
9463 struct lpfc_hba *phba = vport->phba; in lpfc_els_timeout()
9467 spin_lock_irqsave(&vport->work_port_lock, iflag); in lpfc_els_timeout()
9468 tmo_posted = vport->work_port_events & WORKER_ELS_TMO; in lpfc_els_timeout()
9469 if (!tmo_posted && !test_bit(FC_UNLOADING, &vport->load_flag)) in lpfc_els_timeout()
9470 vport->work_port_events |= WORKER_ELS_TMO; in lpfc_els_timeout()
9471 spin_unlock_irqrestore(&vport->work_port_lock, iflag); in lpfc_els_timeout()
9473 if (!tmo_posted && !test_bit(FC_UNLOADING, &vport->load_flag)) in lpfc_els_timeout()
9489 lpfc_els_timeout_handler(struct lpfc_vport *vport) in lpfc_els_timeout_handler() argument
9491 struct lpfc_hba *phba = vport->phba; in lpfc_els_timeout_handler()
9534 if (piocb->vport != vport) in lpfc_els_timeout_handler()
9559 ndlp = __lpfc_findnode_rpi(vport, ulp_context); in lpfc_els_timeout_handler()
9570 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_els_timeout_handler()
9586 mod_timer(&vport->els_tmofunc, in lpfc_els_timeout_handler()
9611 lpfc_els_flush_cmd(struct lpfc_vport *vport) in lpfc_els_flush_cmd() argument
9615 struct lpfc_hba *phba = vport->phba; in lpfc_els_flush_cmd()
9622 lpfc_fabric_abort_vport(vport); in lpfc_els_flush_cmd()
9648 if (piocb->vport != vport) in lpfc_els_flush_cmd()
9699 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_els_flush_cmd()
9724 if (piocb->vport != vport) in lpfc_els_flush_cmd()
9732 if (vport == phba->pport) { in lpfc_els_flush_cmd()
9771 struct lpfc_vport *vport; in lpfc_els_flush_all_cmd() local
9774 list_for_each_entry(vport, &phba->port_list, listentry) in lpfc_els_flush_all_cmd()
9775 lpfc_els_flush_cmd(vport); in lpfc_els_flush_all_cmd()
9795 struct lpfc_vport *vport = cmdiocbp->vport; in lpfc_send_els_failure_event() local
9796 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_send_els_failure_event()
9861 lpfc_send_els_event(struct lpfc_vport *vport, in lpfc_send_els_event() argument
9867 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_send_els_event()
9872 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_send_els_event()
9882 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_send_els_event()
10225 lpfc_els_rcv_fpin(struct lpfc_vport *vport, void *p, u32 fpin_length) in lpfc_els_rcv_fpin() argument
10227 struct lpfc_hba *phba = vport->phba; in lpfc_els_rcv_fpin()
10236 if (vport->port_state < LPFC_DISC_AUTH) in lpfc_els_rcv_fpin()
10325 fc_host_fpin_rcv(lpfc_shost_from_vport(vport), in lpfc_els_rcv_fpin()
10347 struct lpfc_vport *vport, struct lpfc_iocbq *elsiocb) in lpfc_els_unsol_buffer() argument
10357 if (!vport || !elsiocb->cmd_dmabuf) in lpfc_els_unsol_buffer()
10374 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, in lpfc_els_unsol_buffer()
10381 if (lpfc_els_chk_latt(vport)) in lpfc_els_unsol_buffer()
10385 if (test_bit(FC_UNLOADING, &vport->load_flag)) in lpfc_els_unsol_buffer()
10389 if (test_bit(FC_DISC_DELAYED, &vport->fc_flag) && in lpfc_els_unsol_buffer()
10393 ndlp = lpfc_findnode_did(vport, did); in lpfc_els_unsol_buffer()
10396 ndlp = lpfc_nlp_init(vport, did); in lpfc_els_unsol_buffer()
10399 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); in lpfc_els_unsol_buffer()
10404 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); in lpfc_els_unsol_buffer()
10426 elsiocb->vport = vport; in lpfc_els_unsol_buffer()
10432 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, in lpfc_els_unsol_buffer()
10435 cmd, did, kref_read(&ndlp->kref), vport->port_state, in lpfc_els_unsol_buffer()
10436 vport->fc_flag, vport->fc_myDID, vport->fc_prevDID); in lpfc_els_unsol_buffer()
10439 if ((vport->port_state < LPFC_FABRIC_CFG_LINK) && in lpfc_els_unsol_buffer()
10441 !((cmd == ELS_CMD_PLOGI) && test_bit(FC_PT2PT, &vport->fc_flag))) { in lpfc_els_unsol_buffer()
10449 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, in lpfc_els_unsol_buffer()
10451 did, vport->port_state, ndlp->nlp_flag); in lpfc_els_unsol_buffer()
10457 vport->fc_prevDID = vport->fc_myDID; in lpfc_els_unsol_buffer()
10462 vport->fc_myDID = in lpfc_els_unsol_buffer()
10465 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, in lpfc_els_unsol_buffer()
10467 "%x\n", vport->fc_myDID, in lpfc_els_unsol_buffer()
10468 vport->fc_prevDID); in lpfc_els_unsol_buffer()
10471 lpfc_send_els_event(vport, ndlp, payload); in lpfc_els_unsol_buffer()
10474 if (test_bit(FC_DISC_DELAYED, &vport->fc_flag)) { in lpfc_els_unsol_buffer()
10480 if (vport->port_state < LPFC_DISC_AUTH) { in lpfc_els_unsol_buffer()
10493 lpfc_disc_state_machine(vport, ndlp, elsiocb, in lpfc_els_unsol_buffer()
10498 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, in lpfc_els_unsol_buffer()
10500 did, vport->port_state, ndlp->nlp_flag); in lpfc_els_unsol_buffer()
10507 if (vport->port_state >= LPFC_LOCAL_CFG_LINK && in lpfc_els_unsol_buffer()
10508 test_bit(FC_PT2PT, &vport->fc_flag) && in lpfc_els_unsol_buffer()
10509 vport->rcv_flogi_cnt >= 1) { in lpfc_els_unsol_buffer()
10516 lpfc_els_rcv_flogi(vport, elsiocb, ndlp); in lpfc_els_unsol_buffer()
10521 lpfc_disc_state_machine(vport, ndlp, NULL, in lpfc_els_unsol_buffer()
10525 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, in lpfc_els_unsol_buffer()
10527 did, vport->port_state, ndlp->nlp_flag); in lpfc_els_unsol_buffer()
10530 lpfc_send_els_event(vport, ndlp, payload); in lpfc_els_unsol_buffer()
10531 if (vport->port_state < LPFC_DISC_AUTH) { in lpfc_els_unsol_buffer()
10536 lpfc_disc_state_machine(vport, ndlp, elsiocb, NLP_EVT_RCV_LOGO); in lpfc_els_unsol_buffer()
10538 lpfc_disc_state_machine(vport, ndlp, NULL, in lpfc_els_unsol_buffer()
10542 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, in lpfc_els_unsol_buffer()
10544 did, vport->port_state, ndlp->nlp_flag); in lpfc_els_unsol_buffer()
10547 lpfc_send_els_event(vport, ndlp, payload); in lpfc_els_unsol_buffer()
10548 if (vport->port_state < LPFC_DISC_AUTH) { in lpfc_els_unsol_buffer()
10553 lpfc_disc_state_machine(vport, ndlp, elsiocb, NLP_EVT_RCV_PRLO); in lpfc_els_unsol_buffer()
10557 lpfc_els_rcv_lcb(vport, elsiocb, ndlp); in lpfc_els_unsol_buffer()
10561 lpfc_els_rcv_rdp(vport, elsiocb, ndlp); in lpfc_els_unsol_buffer()
10565 lpfc_els_rcv_rscn(vport, elsiocb, ndlp); in lpfc_els_unsol_buffer()
10567 lpfc_disc_state_machine(vport, ndlp, NULL, in lpfc_els_unsol_buffer()
10571 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, in lpfc_els_unsol_buffer()
10573 did, vport->port_state, ndlp->nlp_flag); in lpfc_els_unsol_buffer()
10575 lpfc_send_els_event(vport, ndlp, payload); in lpfc_els_unsol_buffer()
10577 if (vport->port_state < LPFC_DISC_AUTH) { in lpfc_els_unsol_buffer()
10582 lpfc_disc_state_machine(vport, ndlp, elsiocb, in lpfc_els_unsol_buffer()
10586 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, in lpfc_els_unsol_buffer()
10588 did, vport->port_state, ndlp->nlp_flag); in lpfc_els_unsol_buffer()
10591 if (vport->port_state < LPFC_DISC_AUTH) { in lpfc_els_unsol_buffer()
10596 lpfc_disc_state_machine(vport, ndlp, elsiocb, in lpfc_els_unsol_buffer()
10600 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, in lpfc_els_unsol_buffer()
10602 did, vport->port_state, ndlp->nlp_flag); in lpfc_els_unsol_buffer()
10605 lpfc_els_rcv_farpr(vport, elsiocb, ndlp); in lpfc_els_unsol_buffer()
10608 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, in lpfc_els_unsol_buffer()
10610 did, vport->port_state, ndlp->nlp_flag); in lpfc_els_unsol_buffer()
10613 lpfc_els_rcv_farp(vport, elsiocb, ndlp); in lpfc_els_unsol_buffer()
10616 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, in lpfc_els_unsol_buffer()
10618 did, vport->port_state, ndlp->nlp_flag); in lpfc_els_unsol_buffer()
10621 lpfc_els_rcv_fan(vport, elsiocb, ndlp); in lpfc_els_unsol_buffer()
10625 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, in lpfc_els_unsol_buffer()
10627 did, vport->port_state, ndlp->nlp_flag); in lpfc_els_unsol_buffer()
10630 if ((vport->port_state < LPFC_DISC_AUTH) && in lpfc_els_unsol_buffer()
10631 test_bit(FC_FABRIC, &vport->fc_flag)) { in lpfc_els_unsol_buffer()
10636 lpfc_disc_state_machine(vport, ndlp, elsiocb, NLP_EVT_RCV_PRLI); in lpfc_els_unsol_buffer()
10639 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, in lpfc_els_unsol_buffer()
10641 did, vport->port_state, ndlp->nlp_flag); in lpfc_els_unsol_buffer()
10644 lpfc_els_rcv_lirr(vport, elsiocb, ndlp); in lpfc_els_unsol_buffer()
10646 lpfc_disc_state_machine(vport, ndlp, NULL, in lpfc_els_unsol_buffer()
10650 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, in lpfc_els_unsol_buffer()
10652 did, vport->port_state, ndlp->nlp_flag); in lpfc_els_unsol_buffer()
10655 lpfc_els_rcv_rls(vport, elsiocb, ndlp); in lpfc_els_unsol_buffer()
10657 lpfc_disc_state_machine(vport, ndlp, NULL, in lpfc_els_unsol_buffer()
10661 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, in lpfc_els_unsol_buffer()
10663 did, vport->port_state, ndlp->nlp_flag); in lpfc_els_unsol_buffer()
10666 lpfc_els_rcv_rpl(vport, elsiocb, ndlp); in lpfc_els_unsol_buffer()
10668 lpfc_disc_state_machine(vport, ndlp, NULL, in lpfc_els_unsol_buffer()
10672 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, in lpfc_els_unsol_buffer()
10674 did, vport->port_state, ndlp->nlp_flag); in lpfc_els_unsol_buffer()
10677 lpfc_els_rcv_rnid(vport, elsiocb, ndlp); in lpfc_els_unsol_buffer()
10679 lpfc_disc_state_machine(vport, ndlp, NULL, in lpfc_els_unsol_buffer()
10683 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, in lpfc_els_unsol_buffer()
10685 did, vport->port_state, ndlp->nlp_flag); in lpfc_els_unsol_buffer()
10687 lpfc_els_rcv_rtv(vport, elsiocb, ndlp); in lpfc_els_unsol_buffer()
10689 lpfc_disc_state_machine(vport, ndlp, NULL, in lpfc_els_unsol_buffer()
10693 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, in lpfc_els_unsol_buffer()
10695 did, vport->port_state, ndlp->nlp_flag); in lpfc_els_unsol_buffer()
10698 lpfc_els_rcv_rrq(vport, elsiocb, ndlp); in lpfc_els_unsol_buffer()
10700 lpfc_disc_state_machine(vport, ndlp, NULL, in lpfc_els_unsol_buffer()
10704 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, in lpfc_els_unsol_buffer()
10706 did, vport->port_state, ndlp->nlp_flag); in lpfc_els_unsol_buffer()
10709 lpfc_els_rcv_echo(vport, elsiocb, ndlp); in lpfc_els_unsol_buffer()
10711 lpfc_disc_state_machine(vport, ndlp, NULL, in lpfc_els_unsol_buffer()
10720 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, in lpfc_els_unsol_buffer()
10722 did, vport->port_state, ndlp->nlp_flag); in lpfc_els_unsol_buffer()
10724 lpfc_els_rcv_fpin(vport, (struct fc_els_fpin *)payload, in lpfc_els_unsol_buffer()
10730 lpfc_els_rcv_edc(vport, elsiocb, ndlp); in lpfc_els_unsol_buffer()
10736 lpfc_printf_vlog(vport, KERN_WARNING, LOG_ELS, in lpfc_els_unsol_buffer()
10744 lpfc_els_rcv_rdf(vport, elsiocb, ndlp); in lpfc_els_unsol_buffer()
10747 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, in lpfc_els_unsol_buffer()
10749 cmd, did, vport->port_state); in lpfc_els_unsol_buffer()
10756 lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, in lpfc_els_unsol_buffer()
10760 lpfc_disc_state_machine(vport, ndlp, NULL, in lpfc_els_unsol_buffer()
10771 lpfc_els_rsp_reject(vport, stat.un.lsRjtError, elsiocb, ndlp, in lpfc_els_unsol_buffer()
10775 lpfc_disc_state_machine(vport, ndlp, NULL, in lpfc_els_unsol_buffer()
10797 mbox->vport = vport; in lpfc_els_unsol_buffer()
10806 if (vport && !test_bit(FC_UNLOADING, &vport->load_flag)) in lpfc_els_unsol_buffer()
10807 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_els_unsol_buffer()
10831 struct lpfc_vport *vport = elsiocb->vport; in lpfc_els_unsol_event() local
10870 vport = phba->pport; in lpfc_els_unsol_event()
10872 vport = lpfc_find_vport_by_vpid(phba, in lpfc_els_unsol_event()
10903 lpfc_els_unsol_buffer(phba, pring, vport, elsiocb); in lpfc_els_unsol_event()
10921 lpfc_start_fdmi(struct lpfc_vport *vport) in lpfc_start_fdmi() argument
10929 ndlp = lpfc_findnode_did(vport, FDMI_DID); in lpfc_start_fdmi()
10931 ndlp = lpfc_nlp_init(vport, FDMI_DID); in lpfc_start_fdmi()
10939 lpfc_nlp_set_state(vport, ndlp, NLP_STE_PLOGI_ISSUE); in lpfc_start_fdmi()
10940 lpfc_issue_els_plogi(vport, ndlp->nlp_DID, 0); in lpfc_start_fdmi()
10957 lpfc_do_scr_ns_plogi(struct lpfc_hba *phba, struct lpfc_vport *vport) in lpfc_do_scr_ns_plogi() argument
10966 if (test_bit(FC_DISC_DELAYED, &vport->fc_flag)) { in lpfc_do_scr_ns_plogi()
10967 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_do_scr_ns_plogi()
10970 mod_timer(&vport->delayed_disc_tmo, in lpfc_do_scr_ns_plogi()
10975 ndlp = lpfc_findnode_did(vport, NameServer_DID); in lpfc_do_scr_ns_plogi()
10977 ndlp = lpfc_nlp_init(vport, NameServer_DID); in lpfc_do_scr_ns_plogi()
10980 lpfc_disc_start(vport); in lpfc_do_scr_ns_plogi()
10983 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_do_scr_ns_plogi()
10984 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_do_scr_ns_plogi()
10992 lpfc_nlp_set_state(vport, ndlp, NLP_STE_PLOGI_ISSUE); in lpfc_do_scr_ns_plogi()
10994 if (lpfc_issue_els_plogi(vport, ndlp->nlp_DID, 0)) { in lpfc_do_scr_ns_plogi()
10995 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_do_scr_ns_plogi()
10996 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_do_scr_ns_plogi()
11003 test_bit(FC_ALLOW_FDMI, &vport->load_flag)) in lpfc_do_scr_ns_plogi()
11004 lpfc_start_fdmi(vport); in lpfc_do_scr_ns_plogi()
11022 struct lpfc_vport *vport = pmb->vport; in lpfc_cmpl_reg_new_vport() local
11023 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); in lpfc_cmpl_reg_new_vport()
11028 clear_bit(FC_VPORT_NEEDS_REG_VPI, &vport->fc_flag); in lpfc_cmpl_reg_new_vport()
11031 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_cmpl_reg_new_vport()
11044 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_cmpl_reg_new_vport()
11045 clear_bit(FC_FABRIC, &vport->fc_flag); in lpfc_cmpl_reg_new_vport()
11046 clear_bit(FC_PUBLIC_LOOP, &vport->fc_flag); in lpfc_cmpl_reg_new_vport()
11047 lpfc_can_disctmo(vport); in lpfc_cmpl_reg_new_vport()
11051 set_bit(FC_VPORT_NEEDS_REG_VPI, &vport->fc_flag); in lpfc_cmpl_reg_new_vport()
11052 lpfc_init_vpi(phba, pmb, vport->vpi); in lpfc_cmpl_reg_new_vport()
11053 pmb->vport = vport; in lpfc_cmpl_reg_new_vport()
11058 lpfc_printf_vlog(vport, KERN_ERR, in lpfc_cmpl_reg_new_vport()
11070 lpfc_sli4_unreg_all_rpis(vport); in lpfc_cmpl_reg_new_vport()
11071 lpfc_mbx_unreg_vpi(vport); in lpfc_cmpl_reg_new_vport()
11072 set_bit(FC_VPORT_NEEDS_REG_VPI, &vport->fc_flag); in lpfc_cmpl_reg_new_vport()
11075 if ((vport->port_type == LPFC_PHYSICAL_PORT) && in lpfc_cmpl_reg_new_vport()
11076 !test_bit(FC_LOGO_RCVD_DID_CHNG, &vport->fc_flag)) { in lpfc_cmpl_reg_new_vport()
11078 lpfc_issue_init_vfi(vport); in lpfc_cmpl_reg_new_vport()
11080 lpfc_initial_flogi(vport); in lpfc_cmpl_reg_new_vport()
11082 lpfc_initial_fdisc(vport); in lpfc_cmpl_reg_new_vport()
11088 vport->vpi_state |= LPFC_VPI_REGISTERED; in lpfc_cmpl_reg_new_vport()
11090 if (vport == phba->pport) { in lpfc_cmpl_reg_new_vport()
11092 lpfc_issue_fabric_reglogin(vport); in lpfc_cmpl_reg_new_vport()
11098 if (vport->port_state != LPFC_FDISC) in lpfc_cmpl_reg_new_vport()
11100 lpfc_do_scr_ns_plogi(phba, vport); in lpfc_cmpl_reg_new_vport()
11103 lpfc_do_scr_ns_plogi(phba, vport); in lpfc_cmpl_reg_new_vport()
11118 lpfc_reinit_vmid(vport); in lpfc_cmpl_reg_new_vport()
11119 vport->vmid_flag = vport->phba->pport->vmid_flag; in lpfc_cmpl_reg_new_vport()
11134 lpfc_register_new_vport(struct lpfc_hba *phba, struct lpfc_vport *vport, in lpfc_register_new_vport() argument
11141 lpfc_reg_vpi(vport, mbox); in lpfc_register_new_vport()
11142 mbox->vport = vport; in lpfc_register_new_vport()
11158 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_register_new_vport()
11163 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_register_new_vport()
11170 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_register_new_vport()
11171 clear_bit(FC_VPORT_NEEDS_REG_VPI, &vport->fc_flag); in lpfc_register_new_vport()
11285 struct lpfc_vport *vport = cmdiocb->vport; in lpfc_cmpl_els_fdisc() local
11298 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, in lpfc_cmpl_els_fdisc()
11301 vport->fc_prevDID); in lpfc_cmpl_els_fdisc()
11307 lpfc_set_disctmo(piocb->vport); in lpfc_cmpl_els_fdisc()
11310 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_cmpl_els_fdisc()
11312 ulp_status, ulp_word4, vport->fc_prevDID); in lpfc_cmpl_els_fdisc()
11325 lpfc_vlog_msg(vport, KERN_WARNING, LOG_ELS, in lpfc_cmpl_els_fdisc()
11331 lpfc_check_nlp_post_devloss(vport, ndlp); in lpfc_cmpl_els_fdisc()
11333 clear_bit(FC_VPORT_CVL_RCVD, &vport->fc_flag); in lpfc_cmpl_els_fdisc()
11334 clear_bit(FC_VPORT_LOGO_RCVD, &vport->fc_flag); in lpfc_cmpl_els_fdisc()
11335 set_bit(FC_FABRIC, &vport->fc_flag); in lpfc_cmpl_els_fdisc()
11336 if (vport->phba->fc_topology == LPFC_TOPOLOGY_LOOP) in lpfc_cmpl_els_fdisc()
11337 set_bit(FC_PUBLIC_LOOP, &vport->fc_flag); in lpfc_cmpl_els_fdisc()
11339 vport->fc_myDID = ulp_word4 & Mask_DID; in lpfc_cmpl_els_fdisc()
11340 lpfc_vport_set_state(vport, FC_VPORT_ACTIVE); in lpfc_cmpl_els_fdisc()
11348 fabric_param_changed = lpfc_check_clean_addr_bit(vport, sp); in lpfc_cmpl_els_fdisc()
11349 memcpy(&vport->fabric_portname, &sp->portName, in lpfc_cmpl_els_fdisc()
11351 memcpy(&vport->fabric_nodename, &sp->nodeName, in lpfc_cmpl_els_fdisc()
11354 !test_bit(FC_VPORT_NEEDS_REG_VPI, &vport->fc_flag)) { in lpfc_cmpl_els_fdisc()
11360 &vport->fc_nodes, nlp_listp) { in lpfc_cmpl_els_fdisc()
11367 lpfc_unreg_rpi(vport, np); in lpfc_cmpl_els_fdisc()
11369 lpfc_cleanup_pending_mbox(vport); in lpfc_cmpl_els_fdisc()
11372 lpfc_sli4_unreg_all_rpis(vport); in lpfc_cmpl_els_fdisc()
11374 lpfc_mbx_unreg_vpi(vport); in lpfc_cmpl_els_fdisc()
11375 set_bit(FC_VPORT_NEEDS_REG_VPI, &vport->fc_flag); in lpfc_cmpl_els_fdisc()
11377 set_bit(FC_VPORT_NEEDS_INIT_VPI, &vport->fc_flag); in lpfc_cmpl_els_fdisc()
11379 set_bit(FC_LOGO_RCVD_DID_CHNG, &vport->fc_flag); in lpfc_cmpl_els_fdisc()
11381 !test_bit(FC_VPORT_NEEDS_REG_VPI, &vport->fc_flag)) { in lpfc_cmpl_els_fdisc()
11386 lpfc_register_new_vport(phba, vport, ndlp); in lpfc_cmpl_els_fdisc()
11387 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); in lpfc_cmpl_els_fdisc()
11391 if (test_bit(FC_VPORT_NEEDS_INIT_VPI, &vport->fc_flag)) in lpfc_cmpl_els_fdisc()
11392 lpfc_issue_init_vpi(vport); in lpfc_cmpl_els_fdisc()
11393 else if (test_bit(FC_VPORT_NEEDS_REG_VPI, &vport->fc_flag)) in lpfc_cmpl_els_fdisc()
11394 lpfc_register_new_vport(phba, vport, ndlp); in lpfc_cmpl_els_fdisc()
11396 lpfc_do_scr_ns_plogi(phba, vport); in lpfc_cmpl_els_fdisc()
11401 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); in lpfc_cmpl_els_fdisc()
11405 if (vport->fc_vport && in lpfc_cmpl_els_fdisc()
11406 (vport->fc_vport->vport_state != FC_VPORT_NO_FABRIC_RSCS)) in lpfc_cmpl_els_fdisc()
11407 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_cmpl_els_fdisc()
11409 lpfc_can_disctmo(vport); in lpfc_cmpl_els_fdisc()
11435 lpfc_issue_els_fdisc(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, in lpfc_issue_els_fdisc() argument
11438 struct lpfc_hba *phba = vport->phba; in lpfc_issue_els_fdisc()
11448 vport->port_state = LPFC_FDISC; in lpfc_issue_els_fdisc()
11449 vport->fc_myDID = 0; in lpfc_issue_els_fdisc()
11451 elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, retry, ndlp, did, in lpfc_issue_els_fdisc()
11454 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_issue_els_fdisc()
11455 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_issue_els_fdisc()
11475 memcpy(pcmd, &vport->phba->pport->fc_sparam, sizeof(struct serv_parm)); in lpfc_issue_els_fdisc()
11489 memcpy(pcmd, &vport->fc_portname, 8); in lpfc_issue_els_fdisc()
11492 memcpy(pcmd, &vport->fc_nodename, 8); in lpfc_issue_els_fdisc()
11495 lpfc_set_disctmo(vport); in lpfc_issue_els_fdisc()
11500 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_issue_els_fdisc()
11514 lpfc_vport_set_state(vport, FC_VPORT_INITIALIZING); in lpfc_issue_els_fdisc()
11519 lpfc_vport_set_state(vport, FC_VPORT_FAILED); in lpfc_issue_els_fdisc()
11520 lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_issue_els_fdisc()
11543 struct lpfc_vport *vport = cmdiocb->vport; in lpfc_cmpl_els_npiv_logo() local
11562 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_cmpl_els_npiv_logo()
11567 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, in lpfc_cmpl_els_npiv_logo()
11571 tmo, vport->num_disc_nodes, in lpfc_cmpl_els_npiv_logo()
11576 clear_bit(FC_NDISC_ACTIVE, &vport->fc_flag); in lpfc_cmpl_els_npiv_logo()
11577 clear_bit(FC_FABRIC, &vport->fc_flag); in lpfc_cmpl_els_npiv_logo()
11578 lpfc_can_disctmo(vport); in lpfc_cmpl_els_npiv_logo()
11612 lpfc_issue_els_npiv_logo(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) in lpfc_issue_els_npiv_logo() argument
11615 struct lpfc_hba *phba = vport->phba; in lpfc_issue_els_npiv_logo()
11621 elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, 0, ndlp, ndlp->nlp_DID, in lpfc_issue_els_npiv_logo()
11631 *((uint32_t *) (pcmd)) = be32_to_cpu(vport->fc_myDID); in lpfc_issue_els_npiv_logo()
11633 memcpy(pcmd, &vport->fc_portname, sizeof(struct lpfc_name)); in lpfc_issue_els_npiv_logo()
11635 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_issue_els_npiv_logo()
11727 lpfc_debugfs_disc_trc(iocb->vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_resume_fabric_iocbs()
11729 iocb->vport->port_state, 0, 0); in lpfc_resume_fabric_iocbs()
11892 lpfc_debugfs_disc_trc(iocb->vport, LPFC_DISC_TRC_ELS_CMD, in lpfc_issue_fabric_iocb()
11894 iocb->vport->port_state, 0, 0); in lpfc_issue_fabric_iocb()
11924 static void lpfc_fabric_abort_vport(struct lpfc_vport *vport) in lpfc_fabric_abort_vport() argument
11927 struct lpfc_hba *phba = vport->phba; in lpfc_fabric_abort_vport()
11934 if (piocb->vport != vport) in lpfc_fabric_abort_vport()
12016 lpfc_sli4_vport_delete_els_xri_aborted(struct lpfc_vport *vport) in lpfc_sli4_vport_delete_els_xri_aborted() argument
12018 struct lpfc_hba *phba = vport->phba; in lpfc_sli4_vport_delete_els_xri_aborted()
12026 if (sglq_entry->ndlp && sglq_entry->ndlp->vport == vport) { in lpfc_sli4_vport_delete_els_xri_aborted()
12035 if (test_bit(FC_UNLOADING, &vport->load_flag) && in lpfc_sli4_vport_delete_els_xri_aborted()
12123 lpfc_sli_abts_recover_port(struct lpfc_vport *vport, in lpfc_sli_abts_recover_port() argument
12130 shost = lpfc_shost_from_vport(vport); in lpfc_sli_abts_recover_port()
12131 phba = vport->phba; in lpfc_sli_abts_recover_port()
12143 vport->vpi, ndlp->nlp_rpi, ndlp->nlp_state, in lpfc_sli_abts_recover_port()
12153 lpfc_unreg_rpi(vport, ndlp); in lpfc_sli_abts_recover_port()
12156 static void lpfc_init_cs_ctl_bitmap(struct lpfc_vport *vport) in lpfc_init_cs_ctl_bitmap() argument
12158 bitmap_zero(vport->vmid_priority_range, LPFC_VMID_MAX_PRIORITY_RANGE); in lpfc_init_cs_ctl_bitmap()
12162 lpfc_vmid_set_cs_ctl_range(struct lpfc_vport *vport, u32 min, u32 max) in lpfc_vmid_set_cs_ctl_range() argument
12170 set_bit(i, vport->vmid_priority_range); in lpfc_vmid_set_cs_ctl_range()
12173 static void lpfc_vmid_put_cs_ctl(struct lpfc_vport *vport, u32 ctcl_vmid) in lpfc_vmid_put_cs_ctl() argument
12175 set_bit(ctcl_vmid, vport->vmid_priority_range); in lpfc_vmid_put_cs_ctl()
12178 u32 lpfc_vmid_get_cs_ctl(struct lpfc_vport *vport) in lpfc_vmid_get_cs_ctl() argument
12182 i = find_first_bit(vport->vmid_priority_range, in lpfc_vmid_get_cs_ctl()
12188 clear_bit(i, vport->vmid_priority_range); in lpfc_vmid_get_cs_ctl()
12198 struct lpfc_vport *vport = cmdiocb->vport; in lpfc_cmpl_els_qfpa() local
12217 lpfc_printf_vlog(vport, KERN_WARNING, LOG_SLI, in lpfc_cmpl_els_qfpa()
12223 lpfc_printf_vlog(vport, KERN_ERR, LOG_SLI, in lpfc_cmpl_els_qfpa()
12229 if (!vport->qfpa_res) { in lpfc_cmpl_els_qfpa()
12230 max_desc = FCELSSIZE / sizeof(*vport->qfpa_res); in lpfc_cmpl_els_qfpa()
12231 vport->qfpa_res = kcalloc(max_desc, sizeof(*vport->qfpa_res), in lpfc_cmpl_els_qfpa()
12233 if (!vport->qfpa_res) in lpfc_cmpl_els_qfpa()
12239 memcpy(vport->qfpa_res, pcmd, len + 8); in lpfc_cmpl_els_qfpa()
12243 vmid_range = vport->vmid_priority.vmid_range; in lpfc_cmpl_els_qfpa()
12248 kfree(vport->qfpa_res); in lpfc_cmpl_els_qfpa()
12251 vport->vmid_priority.vmid_range = vmid_range; in lpfc_cmpl_els_qfpa()
12253 vport->vmid_priority.num_descriptors = len; in lpfc_cmpl_els_qfpa()
12256 lpfc_printf_vlog(vport, KERN_DEBUG, LOG_ELS, in lpfc_cmpl_els_qfpa()
12266 vport->vmid_flag |= LPFC_VMID_QOS_ENABLED; in lpfc_cmpl_els_qfpa()
12274 lpfc_init_cs_ctl_bitmap(vport); in lpfc_cmpl_els_qfpa()
12275 for (i = 0; i < vport->vmid_priority.num_descriptors; i++) { in lpfc_cmpl_els_qfpa()
12276 lpfc_vmid_set_cs_ctl_range(vport, in lpfc_cmpl_els_qfpa()
12277 vport->vmid_priority.vmid_range[i].low, in lpfc_cmpl_els_qfpa()
12278 vport->vmid_priority.vmid_range[i].high); in lpfc_cmpl_els_qfpa()
12281 vport->vmid_flag |= LPFC_VMID_QFPA_CMPL; in lpfc_cmpl_els_qfpa()
12287 int lpfc_issue_els_qfpa(struct lpfc_vport *vport) in lpfc_issue_els_qfpa() argument
12289 struct lpfc_hba *phba = vport->phba; in lpfc_issue_els_qfpa()
12299 elsiocb = lpfc_prep_els_iocb(vport, 1, LPFC_QFPA_SIZE, 2, ndlp, in lpfc_issue_els_qfpa()
12313 lpfc_els_free_iocb(vport->phba, elsiocb); in lpfc_issue_els_qfpa()
12323 vport->vmid_flag &= ~LPFC_VMID_QOS_ENABLED; in lpfc_issue_els_qfpa()
12328 lpfc_vmid_uvem(struct lpfc_vport *vport, in lpfc_vmid_uvem() argument
12340 ndlp = lpfc_findnode_did(vport, Fabric_DID); in lpfc_vmid_uvem()
12347 elsiocb = lpfc_prep_els_iocb(vport, 1, LPFC_UVEM_SIZE, 2, in lpfc_vmid_uvem()
12352 lpfc_printf_vlog(vport, KERN_DEBUG, LOG_ELS, in lpfc_vmid_uvem()
12361 if (!memchr_inv(vport->lpfc_vmid_host_uuid, 0, in lpfc_vmid_uvem()
12362 sizeof(vport->lpfc_vmid_host_uuid))) in lpfc_vmid_uvem()
12363 memcpy(vport->lpfc_vmid_host_uuid, vmid->host_vmid, in lpfc_vmid_uvem()
12364 sizeof(vport->lpfc_vmid_host_uuid)); in lpfc_vmid_uvem()
12373 memcpy(vem_id_desc->vem_id, vport->lpfc_vmid_host_uuid, in lpfc_vmid_uvem()
12382 bf_set(lpfc_instantiated_nport_id, inst_desc, vport->fc_myDID); in lpfc_vmid_uvem()
12389 lpfc_vmid_put_cs_ctl(vport, vmid->un.cs_ctl_vmid); in lpfc_vmid_uvem()
12397 lpfc_els_free_iocb(vport->phba, elsiocb); in lpfc_vmid_uvem()
12401 ret = lpfc_sli_issue_iocb(vport->phba, LPFC_ELS_RING, elsiocb, 0); in lpfc_vmid_uvem()
12403 lpfc_els_free_iocb(vport->phba, elsiocb); in lpfc_vmid_uvem()
12418 struct lpfc_vport *vport = icmdiocb->vport; in lpfc_cmpl_els_uvem() local
12440 lpfc_printf_vlog(vport, KERN_WARNING, LOG_SLI, in lpfc_cmpl_els_uvem()
12445 lpfc_printf_vlog(vport, KERN_WARNING, LOG_SLI, in lpfc_cmpl_els_uvem()
12452 vport->vmid_flag |= LPFC_VMID_IN_USE; in lpfc_cmpl_els_uvem()
12457 write_lock(&vport->vmid_lock); in lpfc_cmpl_els_uvem()
12460 write_unlock(&vport->vmid_lock); in lpfc_cmpl_els_uvem()