Lines Matching refs:ndlp

56 				struct lpfc_nodelist *ndlp, uint8_t retry);
165 struct lpfc_nodelist *ndlp, u32 did, in lpfc_prep_els_iocb() argument
297 vport->port_state, ndlp->nlp_rpi, in lpfc_prep_els_iocb()
305 elscmd, ndlp->nlp_DID, elsiocb->iotag, in lpfc_prep_els_iocb()
307 ndlp->nlp_rpi, vport->fc_flag); in lpfc_prep_els_iocb()
348 struct lpfc_nodelist *ndlp; in lpfc_issue_fabric_reglogin() local
354 ndlp = lpfc_findnode_did(vport, Fabric_DID); in lpfc_issue_fabric_reglogin()
355 if (!ndlp) { in lpfc_issue_fabric_reglogin()
383 ndlp->nlp_rpi); in lpfc_issue_fabric_reglogin()
394 mbox->ctx_ndlp = lpfc_nlp_get(ndlp); in lpfc_issue_fabric_reglogin()
412 lpfc_nlp_put(ndlp); in lpfc_issue_fabric_reglogin()
439 struct lpfc_nodelist *ndlp; in lpfc_issue_reg_vfi() local
447 ndlp = lpfc_findnode_did(vport, Fabric_DID); in lpfc_issue_reg_vfi()
448 if (!ndlp) { in lpfc_issue_reg_vfi()
624 lpfc_cmpl_els_flogi_fabric(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, in lpfc_cmpl_els_flogi_fabric() argument
651 memcpy(&ndlp->nlp_portname, &sp->portName, sizeof(struct lpfc_name)); in lpfc_cmpl_els_flogi_fabric()
652 memcpy(&ndlp->nlp_nodename, &sp->nodeName, sizeof(struct lpfc_name)); in lpfc_cmpl_els_flogi_fabric()
653 ndlp->nlp_class_sup = 0; in lpfc_cmpl_els_flogi_fabric()
655 ndlp->nlp_class_sup |= FC_COS_CLASS1; in lpfc_cmpl_els_flogi_fabric()
657 ndlp->nlp_class_sup |= FC_COS_CLASS2; in lpfc_cmpl_els_flogi_fabric()
659 ndlp->nlp_class_sup |= FC_COS_CLASS3; in lpfc_cmpl_els_flogi_fabric()
661 ndlp->nlp_class_sup |= FC_COS_CLASS4; in lpfc_cmpl_els_flogi_fabric()
662 ndlp->nlp_maxframe = ((sp->cmn.bbRcvSizeMsb & 0x0F) << 8) | in lpfc_cmpl_els_flogi_fabric()
765 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); in lpfc_cmpl_els_flogi_fabric()
766 lpfc_register_new_vport(phba, vport, ndlp); in lpfc_cmpl_els_flogi_fabric()
771 lpfc_nlp_set_state(vport, ndlp, NLP_STE_REG_LOGIN_ISSUE); in lpfc_cmpl_els_flogi_fabric()
774 lpfc_register_new_vport(phba, vport, ndlp); in lpfc_cmpl_els_flogi_fabric()
778 ndlp->nlp_type |= NLP_FABRIC; in lpfc_cmpl_els_flogi_fabric()
779 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); in lpfc_cmpl_els_flogi_fabric()
817 lpfc_cmpl_els_flogi_nport(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, in lpfc_cmpl_els_flogi_nport() argument
865 if (!(ndlp->fc4_xpt_flags & (SCSI_XPT_REGD | NVME_XPT_REGD))) in lpfc_cmpl_els_flogi_nport()
866 lpfc_nlp_put(ndlp); in lpfc_cmpl_els_flogi_nport()
868 ndlp = lpfc_findnode_did(vport, PT2PT_RemoteID); in lpfc_cmpl_els_flogi_nport()
869 if (!ndlp) { in lpfc_cmpl_els_flogi_nport()
874 ndlp = lpfc_nlp_init(vport, PT2PT_RemoteID); in lpfc_cmpl_els_flogi_nport()
875 if (!ndlp) in lpfc_cmpl_els_flogi_nport()
879 memcpy(&ndlp->nlp_portname, &sp->portName, in lpfc_cmpl_els_flogi_nport()
881 memcpy(&ndlp->nlp_nodename, &sp->nodeName, in lpfc_cmpl_els_flogi_nport()
884 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); in lpfc_cmpl_els_flogi_nport()
885 spin_lock_irq(&ndlp->lock); in lpfc_cmpl_els_flogi_nport()
886 ndlp->nlp_flag |= NLP_NPR_2B_DISC; in lpfc_cmpl_els_flogi_nport()
887 spin_unlock_irq(&ndlp->lock); in lpfc_cmpl_els_flogi_nport()
907 if (!(ndlp->fc4_xpt_flags & (SCSI_XPT_REGD | NVME_XPT_REGD))) in lpfc_cmpl_els_flogi_nport()
908 lpfc_nlp_put(ndlp); in lpfc_cmpl_els_flogi_nport()
948 struct lpfc_nodelist *ndlp = cmdiocb->ndlp; in lpfc_cmpl_els_flogi() local
962 if (!(ndlp->fc4_xpt_flags & SCSI_XPT_REGD)) in lpfc_cmpl_els_flogi()
963 lpfc_nlp_put(ndlp); in lpfc_cmpl_els_flogi()
1031 lpfc_check_nlp_post_devloss(vport, ndlp); in lpfc_cmpl_els_flogi()
1040 if (!(ndlp->nlp_flag & NLP_IN_DEV_LOSS) && in lpfc_cmpl_els_flogi()
1041 !(ndlp->fc4_xpt_flags & SCSI_XPT_REGD)) in lpfc_cmpl_els_flogi()
1042 lpfc_nlp_put(ndlp); in lpfc_cmpl_els_flogi()
1048 tmo, kref_read(&ndlp->kref)); in lpfc_cmpl_els_flogi()
1120 sp->cmn.priority_tagging, kref_read(&ndlp->kref)); in lpfc_cmpl_els_flogi()
1134 lpfc_check_nlp_post_devloss(vport, ndlp); in lpfc_cmpl_els_flogi()
1141 rc = lpfc_cmpl_els_flogi_fabric(vport, ndlp, sp, in lpfc_cmpl_els_flogi()
1144 rc = lpfc_cmpl_els_flogi_nport(vport, ndlp, sp); in lpfc_cmpl_els_flogi()
1170 lpfc_nlp_put(ndlp); in lpfc_cmpl_els_flogi()
1229 lpfc_nlp_put(ndlp); in lpfc_cmpl_els_flogi()
1289 lpfc_issue_els_flogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, in lpfc_issue_els_flogi() argument
1304 elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, retry, ndlp, in lpfc_issue_els_flogi()
1305 ndlp->nlp_DID, ELS_CMD_FLOGI); in lpfc_issue_els_flogi()
1389 elsiocb->ndlp = lpfc_nlp_get(ndlp); in lpfc_issue_els_flogi()
1390 if (!elsiocb->ndlp) { in lpfc_issue_els_flogi()
1402 lpfc_nlp_put(ndlp); in lpfc_issue_els_flogi()
1412 ndlp = lpfc_findnode_did(vport, 0); in lpfc_issue_els_flogi()
1413 if (!ndlp) in lpfc_issue_els_flogi()
1443 ndlp, NULL); in lpfc_issue_els_flogi()
1451 lpfc_nlp_put(ndlp); in lpfc_issue_els_flogi()
1476 struct lpfc_nodelist *ndlp; in lpfc_els_abort_flogi() local
1496 ndlp = iocb->ndlp; in lpfc_els_abort_flogi()
1497 if (ndlp && ndlp->nlp_DID == Fabric_DID) { in lpfc_els_abort_flogi()
1534 struct lpfc_nodelist *ndlp; in lpfc_initial_flogi() local
1540 ndlp = lpfc_findnode_did(vport, Fabric_DID); in lpfc_initial_flogi()
1541 if (!ndlp) { in lpfc_initial_flogi()
1543 ndlp = lpfc_nlp_init(vport, Fabric_DID); in lpfc_initial_flogi()
1544 if (!ndlp) in lpfc_initial_flogi()
1547 ndlp->nlp_type |= NLP_FABRIC; in lpfc_initial_flogi()
1550 lpfc_enqueue_node(vport, ndlp); in lpfc_initial_flogi()
1555 if (lpfc_issue_els_flogi(vport, ndlp, 0)) { in lpfc_initial_flogi()
1560 if (!(ndlp->fc4_xpt_flags & (SCSI_XPT_REGD | NVME_XPT_REGD)) && in lpfc_initial_flogi()
1561 !(ndlp->nlp_flag & NLP_IN_DEV_LOSS)) in lpfc_initial_flogi()
1562 lpfc_nlp_put(ndlp); in lpfc_initial_flogi()
1587 struct lpfc_nodelist *ndlp; in lpfc_initial_fdisc() local
1590 ndlp = lpfc_findnode_did(vport, Fabric_DID); in lpfc_initial_fdisc()
1591 if (!ndlp) { in lpfc_initial_fdisc()
1593 ndlp = lpfc_nlp_init(vport, Fabric_DID); in lpfc_initial_fdisc()
1594 if (!ndlp) in lpfc_initial_fdisc()
1598 ndlp->nlp_type |= NLP_FABRIC; in lpfc_initial_fdisc()
1601 lpfc_enqueue_node(vport, ndlp); in lpfc_initial_fdisc()
1604 if (lpfc_issue_els_fdisc(vport, ndlp, 0)) { in lpfc_initial_fdisc()
1609 if (!(ndlp->fc4_xpt_flags & (SCSI_XPT_REGD | NVME_XPT_REGD)) && in lpfc_initial_fdisc()
1610 !(ndlp->nlp_flag & NLP_IN_DEV_LOSS)) in lpfc_initial_fdisc()
1611 lpfc_nlp_put(ndlp); in lpfc_initial_fdisc()
1681 struct lpfc_nodelist *ndlp) in lpfc_plogi_confirm_nport() argument
1683 struct lpfc_vport *vport = ndlp->vport; in lpfc_plogi_confirm_nport()
1697 if (ndlp->nlp_type & NLP_FABRIC) in lpfc_plogi_confirm_nport()
1698 return ndlp; in lpfc_plogi_confirm_nport()
1709 if (!new_ndlp || (new_ndlp == ndlp)) in lpfc_plogi_confirm_nport()
1710 return ndlp; in lpfc_plogi_confirm_nport()
1729 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_fc4_type, in lpfc_plogi_confirm_nport()
1747 new_ndlp->nlp_fc4_type = ndlp->nlp_fc4_type; in lpfc_plogi_confirm_nport()
1751 new_ndlp->nlp_DID = ndlp->nlp_DID; in lpfc_plogi_confirm_nport()
1752 new_ndlp->nlp_prev_state = ndlp->nlp_prev_state; in lpfc_plogi_confirm_nport()
1755 ndlp->active_rrqs_xri_bitmap, in lpfc_plogi_confirm_nport()
1759 spin_lock_irq(&ndlp->lock); in lpfc_plogi_confirm_nport()
1762 keep_nlp_flag = ndlp->nlp_flag; in lpfc_plogi_confirm_nport()
1763 new_ndlp->nlp_flag = ndlp->nlp_flag; in lpfc_plogi_confirm_nport()
1786 ndlp->nlp_flag = keep_new_nlp_flag; in lpfc_plogi_confirm_nport()
1790 ndlp->nlp_flag |= NLP_UNREG_INP; in lpfc_plogi_confirm_nport()
1792 ndlp->nlp_flag &= ~NLP_UNREG_INP; in lpfc_plogi_confirm_nport()
1796 ndlp->nlp_flag |= NLP_RPI_REGISTERED; in lpfc_plogi_confirm_nport()
1798 ndlp->nlp_flag &= ~NLP_RPI_REGISTERED; in lpfc_plogi_confirm_nport()
1805 ndlp->nlp_flag |= NLP_DROPPED; in lpfc_plogi_confirm_nport()
1807 ndlp->nlp_flag &= ~NLP_DROPPED; in lpfc_plogi_confirm_nport()
1810 spin_unlock_irq(&ndlp->lock); in lpfc_plogi_confirm_nport()
1814 lpfc_nlp_set_state(vport, new_ndlp, ndlp->nlp_state); in lpfc_plogi_confirm_nport()
1818 new_ndlp->nrport = ndlp->nrport; in lpfc_plogi_confirm_nport()
1821 if (memcmp(&ndlp->nlp_portname, name, sizeof(struct lpfc_name)) == 0) { in lpfc_plogi_confirm_nport()
1834 ndlp->nlp_DID = keepDID; in lpfc_plogi_confirm_nport()
1835 ndlp->nlp_fc4_type = keep_nlp_fc4_type; in lpfc_plogi_confirm_nport()
1836 lpfc_nlp_set_state(vport, ndlp, keep_nlp_state); in lpfc_plogi_confirm_nport()
1839 memcpy(ndlp->active_rrqs_xri_bitmap, in lpfc_plogi_confirm_nport()
1848 lpfc_unreg_rpi(vport, ndlp); in lpfc_plogi_confirm_nport()
1853 ndlp->nlp_DID = keepDID; in lpfc_plogi_confirm_nport()
1854 ndlp->nlp_fc4_type = keep_nlp_fc4_type; in lpfc_plogi_confirm_nport()
1858 memcpy(ndlp->active_rrqs_xri_bitmap, in lpfc_plogi_confirm_nport()
1865 if ((ndlp->nlp_state == NLP_STE_UNMAPPED_NODE) || in lpfc_plogi_confirm_nport()
1866 (ndlp->nlp_state == NLP_STE_MAPPED_NODE)) in lpfc_plogi_confirm_nport()
1868 lpfc_nlp_set_state(vport, ndlp, keep_nlp_state); in lpfc_plogi_confirm_nport()
1869 ndlp->nrport = keep_nrport; in lpfc_plogi_confirm_nport()
1876 if (!ndlp->rport && (ndlp->nlp_state == NLP_STE_NPR_NODE)) in lpfc_plogi_confirm_nport()
1877 lpfc_disc_state_machine(vport, ndlp, NULL, NLP_EVT_DEVICE_RM); in lpfc_plogi_confirm_nport()
1941 struct lpfc_nodelist *ndlp = cmdiocb->ndlp; in lpfc_cmpl_els_rrq() local
1960 ndlp->nlp_DID, ulp_status, ulp_word4, in lpfc_cmpl_els_rrq()
1973 ndlp->nlp_DID, ulp_status, in lpfc_cmpl_els_rrq()
1979 lpfc_nlp_put(ndlp); in lpfc_cmpl_els_rrq()
2009 struct lpfc_nodelist *ndlp, *free_ndlp; in lpfc_cmpl_els_plogi() local
2034 ndlp = lpfc_findnode_did(vport, did); in lpfc_cmpl_els_plogi()
2035 if (!ndlp) { in lpfc_cmpl_els_plogi()
2046 spin_lock_irq(&ndlp->lock); in lpfc_cmpl_els_plogi()
2047 disc = (ndlp->nlp_flag & NLP_NPR_2B_DISC); in lpfc_cmpl_els_plogi()
2048 ndlp->nlp_flag &= ~NLP_NPR_2B_DISC; in lpfc_cmpl_els_plogi()
2049 spin_unlock_irq(&ndlp->lock); in lpfc_cmpl_els_plogi()
2055 ndlp->nlp_DID, ndlp->nlp_fc4_type, in lpfc_cmpl_els_plogi()
2061 spin_lock_irq(&ndlp->lock); in lpfc_cmpl_els_plogi()
2062 ndlp->nlp_flag |= NLP_NPR_2B_DISC; in lpfc_cmpl_els_plogi()
2063 spin_unlock_irq(&ndlp->lock); in lpfc_cmpl_els_plogi()
2072 spin_lock_irq(&ndlp->lock); in lpfc_cmpl_els_plogi()
2073 ndlp->nlp_flag |= NLP_NPR_2B_DISC; in lpfc_cmpl_els_plogi()
2074 spin_unlock_irq(&ndlp->lock); in lpfc_cmpl_els_plogi()
2086 ndlp->nlp_DID, ulp_status, in lpfc_cmpl_els_plogi()
2091 lpfc_disc_state_machine(vport, ndlp, cmdiocb, in lpfc_cmpl_els_plogi()
2097 spin_lock_irq(&ndlp->lock); in lpfc_cmpl_els_plogi()
2098 if ((ndlp->nlp_flag & (NLP_ACC_REGLOGIN | NLP_RCV_PLOGI)) && in lpfc_cmpl_els_plogi()
2099 ndlp->nlp_state == NLP_STE_REG_LOGIN_ISSUE) { in lpfc_cmpl_els_plogi()
2100 spin_unlock_irq(&ndlp->lock); in lpfc_cmpl_els_plogi()
2108 if (!(ndlp->fc4_xpt_flags & (SCSI_XPT_REGD | NVME_XPT_REGD))) { in lpfc_cmpl_els_plogi()
2109 ndlp->nlp_flag &= ~NLP_NPR_2B_DISC; in lpfc_cmpl_els_plogi()
2110 if (!(ndlp->nlp_flag & NLP_IN_DEV_LOSS)) in lpfc_cmpl_els_plogi()
2113 spin_unlock_irq(&ndlp->lock); in lpfc_cmpl_els_plogi()
2116 lpfc_disc_state_machine(vport, ndlp, cmdiocb, in lpfc_cmpl_els_plogi()
2122 ndlp = lpfc_plogi_confirm_nport(phba, prsp->virt, ndlp); in lpfc_cmpl_els_plogi()
2127 ndlp->vmid_support = 0; in lpfc_cmpl_els_plogi()
2135 ndlp->nlp_DID); in lpfc_cmpl_els_plogi()
2137 ndlp->vmid_support = 1; in lpfc_cmpl_els_plogi()
2140 lpfc_disc_state_machine(vport, ndlp, cmdiocb, in lpfc_cmpl_els_plogi()
2161 ndlp->nlp_DID, kref_read(&ndlp->kref), 0); in lpfc_cmpl_els_plogi()
2165 free_ndlp = cmdiocb->ndlp; in lpfc_cmpl_els_plogi()
2197 struct lpfc_nodelist *ndlp; in lpfc_issue_els_plogi() local
2203 ndlp = lpfc_findnode_did(vport, did); in lpfc_issue_els_plogi()
2204 if (!ndlp) in lpfc_issue_els_plogi()
2211 if ((ndlp->nlp_flag & (NLP_IGNR_REG_CMPL | NLP_UNREG_INP)) && in lpfc_issue_els_plogi()
2212 ((ndlp->nlp_DID & Fabric_DID_MASK) != Fabric_DID_MASK) && in lpfc_issue_els_plogi()
2218 ndlp->nlp_defer_did, ndlp->nlp_DID, in lpfc_issue_els_plogi()
2219 ndlp->nlp_rpi, ndlp->nlp_flag, ndlp); in lpfc_issue_els_plogi()
2222 if (ndlp->nlp_defer_did == NLP_EVT_NOTHING_PENDING) in lpfc_issue_els_plogi()
2223 ndlp->nlp_defer_did = did; in lpfc_issue_els_plogi()
2228 elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, retry, ndlp, did, in lpfc_issue_els_plogi()
2259 ndlp->vmid_support = 0; in lpfc_issue_els_plogi()
2284 did, kref_read(&ndlp->kref), 0); in lpfc_issue_els_plogi()
2285 elsiocb->ndlp = lpfc_nlp_get(ndlp); in lpfc_issue_els_plogi()
2286 if (!elsiocb->ndlp) { in lpfc_issue_els_plogi()
2294 lpfc_nlp_put(ndlp); in lpfc_issue_els_plogi()
2319 struct lpfc_nodelist *ndlp; in lpfc_cmpl_els_prli() local
2329 ndlp = cmdiocb->ndlp; in lpfc_cmpl_els_prli()
2334 spin_lock_irq(&ndlp->lock); in lpfc_cmpl_els_prli()
2335 ndlp->nlp_flag &= ~NLP_PRLI_SND; in lpfc_cmpl_els_prli()
2339 ndlp->fc4_prli_sent--; in lpfc_cmpl_els_prli()
2340 spin_unlock_irq(&ndlp->lock); in lpfc_cmpl_els_prli()
2345 ndlp->nlp_DID); in lpfc_cmpl_els_prli()
2351 ndlp->nlp_DID, ulp_status, ulp_word4, in lpfc_cmpl_els_prli()
2352 vport->num_disc_nodes, ndlp->fc4_prli_sent); in lpfc_cmpl_els_prli()
2381 ndlp->nlp_DID, ulp_status, in lpfc_cmpl_els_prli()
2382 ulp_word4, ndlp->nlp_state, in lpfc_cmpl_els_prli()
2383 ndlp->fc4_prli_sent, ndlp->nlp_flag); in lpfc_cmpl_els_prli()
2387 lpfc_disc_state_machine(vport, ndlp, cmdiocb, in lpfc_cmpl_els_prli()
2394 if ((ndlp->nlp_state >= NLP_STE_PLOGI_ISSUE && in lpfc_cmpl_els_prli()
2395 ndlp->nlp_state <= NLP_STE_REG_LOGIN_ISSUE) || in lpfc_cmpl_els_prli()
2396 (ndlp->nlp_state == NLP_STE_NPR_NODE && in lpfc_cmpl_els_prli()
2397 ndlp->nlp_flag & NLP_DELAY_TMO)) { in lpfc_cmpl_els_prli()
2401 ndlp->nlp_DID, ndlp->nlp_state, in lpfc_cmpl_els_prli()
2402 ndlp->nlp_flag); in lpfc_cmpl_els_prli()
2418 spin_lock_irq(&ndlp->lock); in lpfc_cmpl_els_prli()
2419 if (!(ndlp->fc4_xpt_flags & (SCSI_XPT_REGD | NVME_XPT_REGD)) && in lpfc_cmpl_els_prli()
2420 !ndlp->fc4_prli_sent) { in lpfc_cmpl_els_prli()
2421 ndlp->nlp_flag &= ~NLP_NPR_2B_DISC; in lpfc_cmpl_els_prli()
2422 if (!(ndlp->nlp_flag & NLP_IN_DEV_LOSS)) in lpfc_cmpl_els_prli()
2425 spin_unlock_irq(&ndlp->lock); in lpfc_cmpl_els_prli()
2428 lpfc_disc_state_machine(vport, ndlp, cmdiocb, in lpfc_cmpl_els_prli()
2436 lpfc_disc_state_machine(vport, ndlp, cmdiocb, in lpfc_cmpl_els_prli()
2442 lpfc_nlp_put(ndlp); in lpfc_cmpl_els_prli()
2467 lpfc_issue_els_prli(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, in lpfc_issue_els_prli() argument
2488 ndlp->nlp_fc4_type |= NLP_FC4_NVME; in lpfc_issue_els_prli()
2489 local_nlp_type = ndlp->nlp_fc4_type; in lpfc_issue_els_prli()
2494 ndlp->nlp_type &= ~(NLP_FCP_TARGET | NLP_FCP_INITIATOR); in lpfc_issue_els_prli()
2495 ndlp->nlp_type &= ~(NLP_NVME_TARGET | NLP_NVME_INITIATOR); in lpfc_issue_els_prli()
2496 ndlp->nlp_fcp_info &= ~NLP_FCP_2_DEVICE; in lpfc_issue_els_prli()
2497 ndlp->nlp_flag &= ~(NLP_FIRSTBURST | NLP_NPR_2B_DISC); in lpfc_issue_els_prli()
2498 ndlp->nvme_fb_size = 0; in lpfc_issue_els_prli()
2512 ndlp->nlp_fc4_type, ndlp->nlp_DID); in lpfc_issue_els_prli()
2520 ndlp->nlp_fc4_type == NLP_FC4_NVME) { in lpfc_issue_els_prli()
2523 ndlp->nlp_type); in lpfc_issue_els_prli()
2524 lpfc_disc_state_machine(vport, ndlp, NULL, NLP_EVT_DEVICE_RM); in lpfc_issue_els_prli()
2528 elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, retry, ndlp, in lpfc_issue_els_prli()
2529 ndlp->nlp_DID, elscmd); in lpfc_issue_els_prli()
2610 ndlp->nlp_DID, kref_read(&ndlp->kref), 0); in lpfc_issue_els_prli()
2611 elsiocb->ndlp = lpfc_nlp_get(ndlp); in lpfc_issue_els_prli()
2612 if (!elsiocb->ndlp) { in lpfc_issue_els_prli()
2620 lpfc_nlp_put(ndlp); in lpfc_issue_els_prli()
2628 spin_lock_irq(&ndlp->lock); in lpfc_issue_els_prli()
2629 ndlp->nlp_flag |= NLP_PRLI_SND; in lpfc_issue_els_prli()
2631 ndlp->fc4_prli_sent++; in lpfc_issue_els_prli()
2632 spin_unlock_irq(&ndlp->lock); in lpfc_issue_els_prli()
2791 struct lpfc_nodelist *ndlp; in lpfc_cmpl_els_adisc() local
2799 ndlp = cmdiocb->ndlp; in lpfc_cmpl_els_adisc()
2814 ndlp->nlp_DID); in lpfc_cmpl_els_adisc()
2819 spin_lock_irq(&ndlp->lock); in lpfc_cmpl_els_adisc()
2820 disc = (ndlp->nlp_flag & NLP_NPR_2B_DISC); in lpfc_cmpl_els_adisc()
2821 ndlp->nlp_flag &= ~(NLP_ADISC_SND | NLP_NPR_2B_DISC); in lpfc_cmpl_els_adisc()
2822 spin_unlock_irq(&ndlp->lock); in lpfc_cmpl_els_adisc()
2827 ndlp->nlp_DID, ulp_status, ulp_word4, in lpfc_cmpl_els_adisc()
2831 spin_lock_irq(&ndlp->lock); in lpfc_cmpl_els_adisc()
2832 ndlp->nlp_flag |= NLP_NPR_2B_DISC; in lpfc_cmpl_els_adisc()
2833 spin_unlock_irq(&ndlp->lock); in lpfc_cmpl_els_adisc()
2842 spin_lock_irq(&ndlp->lock); in lpfc_cmpl_els_adisc()
2843 ndlp->nlp_flag |= NLP_NPR_2B_DISC; in lpfc_cmpl_els_adisc()
2844 spin_unlock_irq(&ndlp->lock); in lpfc_cmpl_els_adisc()
2852 ndlp->nlp_DID, ulp_status, in lpfc_cmpl_els_adisc()
2854 lpfc_disc_state_machine(vport, ndlp, cmdiocb, in lpfc_cmpl_els_adisc()
2861 spin_lock_irq(&ndlp->lock); in lpfc_cmpl_els_adisc()
2862 if (!(ndlp->fc4_xpt_flags & (SCSI_XPT_REGD | NVME_XPT_REGD))) { in lpfc_cmpl_els_adisc()
2863 ndlp->nlp_flag &= ~NLP_NPR_2B_DISC; in lpfc_cmpl_els_adisc()
2864 if (!(ndlp->nlp_flag & NLP_IN_DEV_LOSS)) in lpfc_cmpl_els_adisc()
2867 spin_unlock_irq(&ndlp->lock); in lpfc_cmpl_els_adisc()
2870 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()
2882 lpfc_nlp_put(ndlp); in lpfc_cmpl_els_adisc()
2906 lpfc_issue_els_adisc(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, in lpfc_issue_els_adisc() argument
2917 elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, retry, ndlp, in lpfc_issue_els_adisc()
2918 ndlp->nlp_DID, ELS_CMD_ADISC); in lpfc_issue_els_adisc()
2937 spin_lock_irq(&ndlp->lock); in lpfc_issue_els_adisc()
2938 ndlp->nlp_flag |= NLP_ADISC_SND; in lpfc_issue_els_adisc()
2939 spin_unlock_irq(&ndlp->lock); in lpfc_issue_els_adisc()
2940 elsiocb->ndlp = lpfc_nlp_get(ndlp); in lpfc_issue_els_adisc()
2941 if (!elsiocb->ndlp) { in lpfc_issue_els_adisc()
2948 ndlp->nlp_DID, kref_read(&ndlp->kref), 0); in lpfc_issue_els_adisc()
2953 lpfc_nlp_put(ndlp); in lpfc_issue_els_adisc()
2960 spin_lock_irq(&ndlp->lock); in lpfc_issue_els_adisc()
2961 ndlp->nlp_flag &= ~NLP_ADISC_SND; in lpfc_issue_els_adisc()
2962 spin_unlock_irq(&ndlp->lock); in lpfc_issue_els_adisc()
2981 struct lpfc_nodelist *ndlp = cmdiocb->ndlp; in lpfc_cmpl_els_logo() local
2982 struct lpfc_vport *vport = ndlp->vport; in lpfc_cmpl_els_logo()
3004 spin_lock_irq(&ndlp->lock); in lpfc_cmpl_els_logo()
3005 ndlp->nlp_flag &= ~NLP_LOGO_SND; in lpfc_cmpl_els_logo()
3006 if (ndlp->save_flags & NLP_WAIT_FOR_LOGO) { in lpfc_cmpl_els_logo()
3008 ndlp->save_flags &= ~NLP_WAIT_FOR_LOGO; in lpfc_cmpl_els_logo()
3010 spin_unlock_irq(&ndlp->lock); in lpfc_cmpl_els_logo()
3015 ndlp->nlp_DID); in lpfc_cmpl_els_logo()
3021 ndlp->nlp_DID, kref_read(&ndlp->kref), ndlp->nlp_flag, in lpfc_cmpl_els_logo()
3040 ndlp->nlp_DID, ulp_status, in lpfc_cmpl_els_logo()
3048 lpfc_disc_state_machine(vport, ndlp, cmdiocb, NLP_EVT_CMPL_LOGO); in lpfc_cmpl_els_logo()
3056 if (ndlp->nlp_flag & NLP_TARGET_REMOVE) { in lpfc_cmpl_els_logo()
3057 spin_lock_irq(&ndlp->lock); in lpfc_cmpl_els_logo()
3059 ndlp->nlp_flag |= NLP_RELEASE_RPI; in lpfc_cmpl_els_logo()
3060 ndlp->nlp_flag &= ~NLP_NPR_2B_DISC; in lpfc_cmpl_els_logo()
3061 spin_unlock_irq(&ndlp->lock); in lpfc_cmpl_els_logo()
3062 lpfc_disc_state_machine(vport, ndlp, cmdiocb, in lpfc_cmpl_els_logo()
3074 if (wake_up_waiter && ndlp->logo_waitq) in lpfc_cmpl_els_logo()
3075 wake_up(ndlp->logo_waitq); in lpfc_cmpl_els_logo()
3081 if (ndlp->nlp_type & (NLP_FCP_TARGET | NLP_NVME_TARGET) && in lpfc_cmpl_els_logo()
3083 lpfc_cancel_retry_delay_tmo(vport, ndlp); in lpfc_cmpl_els_logo()
3084 spin_lock_irqsave(&ndlp->lock, flags); in lpfc_cmpl_els_logo()
3085 ndlp->nlp_flag |= NLP_NPR_2B_DISC; in lpfc_cmpl_els_logo()
3086 spin_unlock_irqrestore(&ndlp->lock, flags); in lpfc_cmpl_els_logo()
3091 ndlp->nlp_DID, ulp_status, in lpfc_cmpl_els_logo()
3096 lpfc_nlp_put(ndlp); in lpfc_cmpl_els_logo()
3107 if (!(ndlp->fc4_xpt_flags & (SCSI_XPT_REGD | NVME_XPT_REGD))) { in lpfc_cmpl_els_logo()
3108 spin_lock_irq(&ndlp->lock); in lpfc_cmpl_els_logo()
3109 ndlp->nlp_flag &= ~NLP_NPR_2B_DISC; in lpfc_cmpl_els_logo()
3110 spin_unlock_irq(&ndlp->lock); in lpfc_cmpl_els_logo()
3111 lpfc_disc_state_machine(vport, ndlp, cmdiocb, in lpfc_cmpl_els_logo()
3117 lpfc_nlp_put(ndlp); in lpfc_cmpl_els_logo()
3142 lpfc_issue_els_logo(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, in lpfc_issue_els_logo() argument
3151 spin_lock_irq(&ndlp->lock); in lpfc_issue_els_logo()
3152 if (ndlp->nlp_flag & NLP_LOGO_SND) { in lpfc_issue_els_logo()
3153 spin_unlock_irq(&ndlp->lock); in lpfc_issue_els_logo()
3156 spin_unlock_irq(&ndlp->lock); in lpfc_issue_els_logo()
3159 elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, retry, ndlp, in lpfc_issue_els_logo()
3160 ndlp->nlp_DID, ELS_CMD_LOGO); in lpfc_issue_els_logo()
3175 spin_lock_irq(&ndlp->lock); in lpfc_issue_els_logo()
3176 ndlp->nlp_flag |= NLP_LOGO_SND; in lpfc_issue_els_logo()
3177 ndlp->nlp_flag &= ~NLP_ISSUE_LOGO; in lpfc_issue_els_logo()
3178 spin_unlock_irq(&ndlp->lock); in lpfc_issue_els_logo()
3179 elsiocb->ndlp = lpfc_nlp_get(ndlp); in lpfc_issue_els_logo()
3180 if (!elsiocb->ndlp) { in lpfc_issue_els_logo()
3187 ndlp->nlp_DID, kref_read(&ndlp->kref), 0); in lpfc_issue_els_logo()
3192 lpfc_nlp_put(ndlp); in lpfc_issue_els_logo()
3196 spin_lock_irq(&ndlp->lock); in lpfc_issue_els_logo()
3197 ndlp->nlp_prev_state = ndlp->nlp_state; in lpfc_issue_els_logo()
3198 spin_unlock_irq(&ndlp->lock); in lpfc_issue_els_logo()
3199 lpfc_nlp_set_state(vport, ndlp, NLP_STE_LOGO_ISSUE); in lpfc_issue_els_logo()
3203 spin_lock_irq(&ndlp->lock); in lpfc_issue_els_logo()
3204 ndlp->nlp_flag &= ~NLP_LOGO_SND; in lpfc_issue_els_logo()
3205 spin_unlock_irq(&ndlp->lock); in lpfc_issue_els_logo()
3258 free_ndlp = cmdiocb->ndlp; in lpfc_cmpl_els_cmd()
3367 struct lpfc_nodelist *ndlp = cmdiocb->ndlp; in lpfc_cmpl_els_disc_cmd() local
3465 lpfc_nlp_put(ndlp); in lpfc_cmpl_els_disc_cmd()
3497 struct lpfc_nodelist *ndlp; in lpfc_issue_els_scr() local
3501 ndlp = lpfc_findnode_did(vport, Fabric_Cntl_DID); in lpfc_issue_els_scr()
3502 if (!ndlp) { in lpfc_issue_els_scr()
3503 ndlp = lpfc_nlp_init(vport, Fabric_Cntl_DID); in lpfc_issue_els_scr()
3504 if (!ndlp) in lpfc_issue_els_scr()
3506 lpfc_enqueue_node(vport, ndlp); in lpfc_issue_els_scr()
3509 elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, retry, ndlp, in lpfc_issue_els_scr()
3510 ndlp->nlp_DID, ELS_CMD_SCR); in lpfc_issue_els_scr()
3515 rc = lpfc_reg_fab_ctrl_node(vport, ndlp); in lpfc_issue_els_scr()
3535 ndlp->nlp_DID, 0, 0); in lpfc_issue_els_scr()
3539 elsiocb->ndlp = lpfc_nlp_get(ndlp); in lpfc_issue_els_scr()
3540 if (!elsiocb->ndlp) { in lpfc_issue_els_scr()
3547 ndlp->nlp_DID, kref_read(&ndlp->kref), 0); in lpfc_issue_els_scr()
3552 lpfc_nlp_put(ndlp); in lpfc_issue_els_scr()
3584 struct lpfc_nodelist *ndlp; in lpfc_issue_els_rscn() local
3599 ndlp = lpfc_findnode_mapped(vport); in lpfc_issue_els_rscn()
3600 if (!ndlp) in lpfc_issue_els_rscn()
3605 ndlp = lpfc_findnode_did(vport, nportid); in lpfc_issue_els_rscn()
3606 if (!ndlp) { in lpfc_issue_els_rscn()
3608 ndlp = lpfc_nlp_init(vport, nportid); in lpfc_issue_els_rscn()
3609 if (!ndlp) in lpfc_issue_els_rscn()
3611 lpfc_enqueue_node(vport, ndlp); in lpfc_issue_els_rscn()
3615 elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, retry, ndlp, in lpfc_issue_els_rscn()
3616 ndlp->nlp_DID, ELS_CMD_RSCN_XMT); in lpfc_issue_els_rscn()
3636 elsiocb->ndlp = lpfc_nlp_get(ndlp); in lpfc_issue_els_rscn()
3637 if (!elsiocb->ndlp) { in lpfc_issue_els_rscn()
3644 ndlp->nlp_DID, 0, 0); in lpfc_issue_els_rscn()
3649 lpfc_nlp_put(ndlp); in lpfc_issue_els_rscn()
3688 struct lpfc_nodelist *ndlp; in lpfc_issue_els_farpr() local
3692 ndlp = lpfc_findnode_did(vport, nportid); in lpfc_issue_els_farpr()
3693 if (!ndlp) { in lpfc_issue_els_farpr()
3694 ndlp = lpfc_nlp_init(vport, nportid); in lpfc_issue_els_farpr()
3695 if (!ndlp) in lpfc_issue_els_farpr()
3697 lpfc_enqueue_node(vport, ndlp); in lpfc_issue_els_farpr()
3700 elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, retry, ndlp, in lpfc_issue_els_farpr()
3701 ndlp->nlp_DID, ELS_CMD_FARPR); in lpfc_issue_els_farpr()
3731 ndlp->nlp_DID, 0, 0); in lpfc_issue_els_farpr()
3735 elsiocb->ndlp = lpfc_nlp_get(ndlp); in lpfc_issue_els_farpr()
3736 if (!elsiocb->ndlp) { in lpfc_issue_els_farpr()
3748 lpfc_nlp_put(ndlp); in lpfc_issue_els_farpr()
3780 struct lpfc_nodelist *ndlp; in lpfc_issue_els_rdf() local
3786 ndlp = lpfc_findnode_did(vport, Fabric_Cntl_DID); in lpfc_issue_els_rdf()
3787 if (!ndlp) { in lpfc_issue_els_rdf()
3788 ndlp = lpfc_nlp_init(vport, Fabric_Cntl_DID); in lpfc_issue_els_rdf()
3789 if (!ndlp) in lpfc_issue_els_rdf()
3791 lpfc_enqueue_node(vport, ndlp); in lpfc_issue_els_rdf()
3798 elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, retry, ndlp, in lpfc_issue_els_rdf()
3799 ndlp->nlp_DID, ELS_CMD_RDF); in lpfc_issue_els_rdf()
3820 ndlp->nlp_DID, phba->cgn_reg_signal, in lpfc_issue_els_rdf()
3825 elsiocb->ndlp = lpfc_nlp_get(ndlp); in lpfc_issue_els_rdf()
3826 if (!elsiocb->ndlp) { in lpfc_issue_els_rdf()
3833 ndlp->nlp_DID, kref_read(&ndlp->kref), 0); in lpfc_issue_els_rdf()
3838 lpfc_nlp_put(ndlp); in lpfc_issue_els_rdf()
3860 struct lpfc_nodelist *ndlp) in lpfc_els_rcv_rdf() argument
3863 if (lpfc_els_rsp_acc(vport, ELS_CMD_RDF, cmdiocb, ndlp, NULL)) { in lpfc_els_rcv_rdf()
3866 ndlp->nlp_DID, vport->fc_myDID); in lpfc_els_rcv_rdf()
3991 struct lpfc_nodelist *ndlp; in lpfc_cmpl_els_edc() local
3994 ndlp = cmdiocb->ndlp; in lpfc_cmpl_els_edc()
4162 ndlp->nlp_DID, kref_read(&ndlp->kref), 0); in lpfc_cmpl_els_edc()
4164 lpfc_nlp_put(ndlp); in lpfc_cmpl_els_edc()
4278 struct lpfc_nodelist *ndlp; in lpfc_issue_els_edc() local
4286 ndlp = lpfc_findnode_did(vport, Fabric_DID); in lpfc_issue_els_edc()
4287 if (!ndlp || ndlp->nlp_state != NLP_STE_UNMAPPED_NODE) in lpfc_issue_els_edc()
4301 elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, retry, ndlp, in lpfc_issue_els_edc()
4302 ndlp->nlp_DID, ELS_CMD_EDC); in lpfc_issue_els_edc()
4326 ndlp->nlp_DID, phba->cgn_reg_signal, in lpfc_issue_els_edc()
4330 elsiocb->ndlp = lpfc_nlp_get(ndlp); in lpfc_issue_els_edc()
4331 if (!elsiocb->ndlp) { in lpfc_issue_els_edc()
4338 ndlp->nlp_DID, kref_read(&ndlp->kref), 0); in lpfc_issue_els_edc()
4346 lpfc_nlp_put(ndlp); in lpfc_issue_els_edc()
4429 struct lpfc_nodelist *ndlp = from_timer(ndlp, t, nlp_delayfunc); in lpfc_els_retry_delay() local
4430 struct lpfc_vport *vport = ndlp->vport; in lpfc_els_retry_delay()
4433 struct lpfc_work_evt *evtp = &ndlp->els_retry_evt; in lpfc_els_retry_delay()
4444 evtp->evt_arg1 = lpfc_nlp_get(ndlp); in lpfc_els_retry_delay()
4464 lpfc_els_retry_delay_handler(struct lpfc_nodelist *ndlp) in lpfc_els_retry_delay_handler() argument
4466 struct lpfc_vport *vport = ndlp->vport; in lpfc_els_retry_delay_handler()
4469 spin_lock_irq(&ndlp->lock); in lpfc_els_retry_delay_handler()
4470 cmd = ndlp->nlp_last_elscmd; in lpfc_els_retry_delay_handler()
4471 ndlp->nlp_last_elscmd = 0; in lpfc_els_retry_delay_handler()
4473 if (!(ndlp->nlp_flag & NLP_DELAY_TMO)) { in lpfc_els_retry_delay_handler()
4474 spin_unlock_irq(&ndlp->lock); in lpfc_els_retry_delay_handler()
4478 ndlp->nlp_flag &= ~NLP_DELAY_TMO; in lpfc_els_retry_delay_handler()
4479 spin_unlock_irq(&ndlp->lock); in lpfc_els_retry_delay_handler()
4485 del_timer_sync(&ndlp->nlp_delayfunc); in lpfc_els_retry_delay_handler()
4486 retry = ndlp->nlp_retry; in lpfc_els_retry_delay_handler()
4487 ndlp->nlp_retry = 0; in lpfc_els_retry_delay_handler()
4491 lpfc_issue_els_flogi(vport, ndlp, retry); in lpfc_els_retry_delay_handler()
4494 if (!lpfc_issue_els_plogi(vport, ndlp->nlp_DID, retry)) { in lpfc_els_retry_delay_handler()
4495 ndlp->nlp_prev_state = ndlp->nlp_state; in lpfc_els_retry_delay_handler()
4496 lpfc_nlp_set_state(vport, ndlp, NLP_STE_PLOGI_ISSUE); in lpfc_els_retry_delay_handler()
4500 if (!lpfc_issue_els_adisc(vport, ndlp, retry)) { in lpfc_els_retry_delay_handler()
4501 ndlp->nlp_prev_state = ndlp->nlp_state; in lpfc_els_retry_delay_handler()
4502 lpfc_nlp_set_state(vport, ndlp, NLP_STE_ADISC_ISSUE); in lpfc_els_retry_delay_handler()
4507 if (!lpfc_issue_els_prli(vport, ndlp, retry)) { in lpfc_els_retry_delay_handler()
4508 ndlp->nlp_prev_state = ndlp->nlp_state; in lpfc_els_retry_delay_handler()
4509 lpfc_nlp_set_state(vport, ndlp, NLP_STE_PRLI_ISSUE); in lpfc_els_retry_delay_handler()
4513 if (!lpfc_issue_els_logo(vport, ndlp, retry)) { in lpfc_els_retry_delay_handler()
4514 ndlp->nlp_prev_state = ndlp->nlp_state; in lpfc_els_retry_delay_handler()
4515 lpfc_nlp_set_state(vport, ndlp, NLP_STE_LOGO_ISSUE); in lpfc_els_retry_delay_handler()
4520 lpfc_issue_els_fdisc(vport, ndlp, retry); in lpfc_els_retry_delay_handler()
4609 struct lpfc_nodelist *ndlp = cmdiocb->ndlp; in lpfc_els_retry() local
4631 if (ndlp) in lpfc_els_retry()
4632 did = ndlp->nlp_DID; in lpfc_els_retry()
4636 ndlp = lpfc_findnode_did(vport, did); in lpfc_els_retry()
4637 if (!ndlp && (cmd != ELS_CMD_PLOGI)) in lpfc_els_retry()
4654 lpfc_set_rrq_active(phba, ndlp, in lpfc_els_retry()
4699 ndlp->nlp_state != NLP_STE_PRLI_ISSUE) { in lpfc_els_retry()
4728 if (ndlp && in lpfc_els_retry()
4729 ndlp->nlp_state != NLP_STE_PLOGI_ISSUE) in lpfc_els_retry()
4998 if (ndlp && delay) { in lpfc_els_retry()
5000 ndlp->nlp_retry = cmdiocb->retry; in lpfc_els_retry()
5003 mod_timer(&ndlp->nlp_delayfunc, in lpfc_els_retry()
5005 spin_lock_irq(&ndlp->lock); in lpfc_els_retry()
5006 ndlp->nlp_flag |= NLP_DELAY_TMO; in lpfc_els_retry()
5007 spin_unlock_irq(&ndlp->lock); in lpfc_els_retry()
5009 ndlp->nlp_prev_state = ndlp->nlp_state; in lpfc_els_retry()
5012 lpfc_nlp_set_state(vport, ndlp, in lpfc_els_retry()
5015 lpfc_nlp_set_state(vport, ndlp, in lpfc_els_retry()
5017 ndlp->nlp_last_elscmd = cmd; in lpfc_els_retry()
5023 lpfc_issue_els_flogi(vport, ndlp, cmdiocb->retry); in lpfc_els_retry()
5026 lpfc_issue_els_fdisc(vport, ndlp, cmdiocb->retry); in lpfc_els_retry()
5029 if (ndlp) { in lpfc_els_retry()
5030 ndlp->nlp_prev_state = ndlp->nlp_state; in lpfc_els_retry()
5031 lpfc_nlp_set_state(vport, ndlp, in lpfc_els_retry()
5037 ndlp->nlp_prev_state = ndlp->nlp_state; in lpfc_els_retry()
5038 lpfc_nlp_set_state(vport, ndlp, NLP_STE_ADISC_ISSUE); in lpfc_els_retry()
5039 lpfc_issue_els_adisc(vport, ndlp, cmdiocb->retry); in lpfc_els_retry()
5043 ndlp->nlp_prev_state = ndlp->nlp_state; in lpfc_els_retry()
5044 lpfc_nlp_set_state(vport, ndlp, NLP_STE_PRLI_ISSUE); in lpfc_els_retry()
5045 lpfc_issue_els_prli(vport, ndlp, cmdiocb->retry); in lpfc_els_retry()
5048 ndlp->nlp_prev_state = ndlp->nlp_state; in lpfc_els_retry()
5049 lpfc_nlp_set_state(vport, ndlp, NLP_STE_LOGO_ISSUE); in lpfc_els_retry()
5050 lpfc_issue_els_logo(vport, ndlp, cmdiocb->retry); in lpfc_els_retry()
5157 elsiocb->ndlp = NULL; in lpfc_els_free_iocb()
5218 struct lpfc_nodelist *ndlp = cmdiocb->ndlp; in lpfc_cmpl_els_logo_acc() local
5227 ulp_status, ulp_word4, ndlp->nlp_DID); in lpfc_cmpl_els_logo_acc()
5232 ndlp->nlp_DID, kref_read(&ndlp->kref), ndlp->nlp_flag, in lpfc_cmpl_els_logo_acc()
5233 ndlp->nlp_state, ndlp->nlp_rpi); in lpfc_cmpl_els_logo_acc()
5240 if (ndlp->nlp_type & NLP_FABRIC && in lpfc_cmpl_els_logo_acc()
5241 ((ndlp->nlp_DID & WELL_KNOWN_DID_MASK) != WELL_KNOWN_DID_MASK)) in lpfc_cmpl_els_logo_acc()
5244 if (ndlp->nlp_state == NLP_STE_NPR_NODE) { in lpfc_cmpl_els_logo_acc()
5249 if ((ndlp->nlp_flag & NLP_DELAY_TMO) && in lpfc_cmpl_els_logo_acc()
5250 (ndlp->nlp_last_elscmd == ELS_CMD_PLOGI)) in lpfc_cmpl_els_logo_acc()
5253 if (ndlp->nlp_flag & NLP_RPI_REGISTERED) in lpfc_cmpl_els_logo_acc()
5254 lpfc_unreg_rpi(vport, ndlp); in lpfc_cmpl_els_logo_acc()
5263 lpfc_nlp_put(ndlp); in lpfc_cmpl_els_logo_acc()
5281 struct lpfc_nodelist *ndlp = pmb->ctx_ndlp; in lpfc_mbx_cmpl_dflt_rpi() local
5285 if (ndlp) { in lpfc_mbx_cmpl_dflt_rpi()
5286 lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_NODE, in lpfc_mbx_cmpl_dflt_rpi()
5289 ndlp->nlp_rpi, ndlp->nlp_DID, ndlp->nlp_flag, in lpfc_mbx_cmpl_dflt_rpi()
5290 kref_read(&ndlp->kref), ndlp, mbx_cmd, in lpfc_mbx_cmpl_dflt_rpi()
5298 spin_lock_irq(&ndlp->lock); in lpfc_mbx_cmpl_dflt_rpi()
5299 ndlp->nlp_flag &= ~NLP_REG_LOGIN_SEND; in lpfc_mbx_cmpl_dflt_rpi()
5301 ndlp->nlp_flag &= ~NLP_UNREG_INP; in lpfc_mbx_cmpl_dflt_rpi()
5302 spin_unlock_irq(&ndlp->lock); in lpfc_mbx_cmpl_dflt_rpi()
5303 lpfc_nlp_put(ndlp); in lpfc_mbx_cmpl_dflt_rpi()
5304 lpfc_drop_node(ndlp->vport, ndlp); in lpfc_mbx_cmpl_dflt_rpi()
5327 struct lpfc_nodelist *ndlp = cmdiocb->ndlp; in lpfc_cmpl_els_rsp() local
5328 struct lpfc_vport *vport = ndlp ? ndlp->vport : NULL; in lpfc_cmpl_els_rsp()
5356 if (!ndlp || lpfc_els_chk_latt(vport)) { in lpfc_cmpl_els_rsp()
5370 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state, in lpfc_cmpl_els_rsp()
5371 ndlp->nlp_rpi, kref_read(&ndlp->kref), mbox, ndlp); in lpfc_cmpl_els_rsp()
5374 && (ndlp->nlp_flag & NLP_ACC_REGLOGIN)) { in lpfc_cmpl_els_rsp()
5375 if (!lpfc_unreg_rpi(vport, ndlp) && in lpfc_cmpl_els_rsp()
5377 if (ndlp->nlp_state == NLP_STE_PLOGI_ISSUE || in lpfc_cmpl_els_rsp()
5378 ndlp->nlp_state == in lpfc_cmpl_els_rsp()
5385 ndlp->nlp_DID, in lpfc_cmpl_els_rsp()
5386 ndlp->nlp_state, in lpfc_cmpl_els_rsp()
5387 ndlp->nlp_rpi, in lpfc_cmpl_els_rsp()
5388 ndlp->nlp_flag); in lpfc_cmpl_els_rsp()
5396 mbox->ctx_ndlp = lpfc_nlp_get(ndlp); in lpfc_cmpl_els_rsp()
5401 if (ndlp->nlp_flag & NLP_RM_DFLT_RPI) { in lpfc_cmpl_els_rsp()
5407 ndlp->nlp_prev_state = ndlp->nlp_state; in lpfc_cmpl_els_rsp()
5408 lpfc_nlp_set_state(vport, ndlp, in lpfc_cmpl_els_rsp()
5412 ndlp->nlp_flag |= NLP_REG_LOGIN_SEND; in lpfc_cmpl_els_rsp()
5420 lpfc_nlp_put(ndlp); in lpfc_cmpl_els_rsp()
5421 ndlp->nlp_flag &= ~NLP_REG_LOGIN_SEND; in lpfc_cmpl_els_rsp()
5427 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state, in lpfc_cmpl_els_rsp()
5428 ndlp->nlp_rpi); in lpfc_cmpl_els_rsp()
5434 if (ndlp && shost) { in lpfc_cmpl_els_rsp()
5435 spin_lock_irq(&ndlp->lock); in lpfc_cmpl_els_rsp()
5437 ndlp->nlp_flag &= ~NLP_ACC_REGLOGIN; in lpfc_cmpl_els_rsp()
5438 ndlp->nlp_flag &= ~NLP_RM_DFLT_RPI; in lpfc_cmpl_els_rsp()
5439 spin_unlock_irq(&ndlp->lock); in lpfc_cmpl_els_rsp()
5447 !(ndlp->fc4_xpt_flags & SCSI_XPT_REGD)) { in lpfc_cmpl_els_rsp()
5448 if (ndlp->nlp_flag & NLP_RELEASE_RPI) { in lpfc_cmpl_els_rsp()
5449 if (ndlp->nlp_state != NLP_STE_PLOGI_ISSUE && in lpfc_cmpl_els_rsp()
5450 ndlp->nlp_state != NLP_STE_REG_LOGIN_ISSUE) { in lpfc_cmpl_els_rsp()
5451 lpfc_sli4_free_rpi(phba, ndlp->nlp_rpi); in lpfc_cmpl_els_rsp()
5452 spin_lock_irq(&ndlp->lock); in lpfc_cmpl_els_rsp()
5453 ndlp->nlp_rpi = LPFC_RPI_ALLOC_ERROR; in lpfc_cmpl_els_rsp()
5454 ndlp->nlp_flag &= ~NLP_RELEASE_RPI; in lpfc_cmpl_els_rsp()
5455 spin_unlock_irq(&ndlp->lock); in lpfc_cmpl_els_rsp()
5457 lpfc_drop_node(vport, ndlp); in lpfc_cmpl_els_rsp()
5458 } else if (ndlp->nlp_state != NLP_STE_PLOGI_ISSUE && in lpfc_cmpl_els_rsp()
5459 ndlp->nlp_state != NLP_STE_REG_LOGIN_ISSUE && in lpfc_cmpl_els_rsp()
5460 ndlp->nlp_state != NLP_STE_PRLI_ISSUE) { in lpfc_cmpl_els_rsp()
5468 lpfc_drop_node(vport, ndlp); in lpfc_cmpl_els_rsp()
5474 lpfc_nlp_put(ndlp); in lpfc_cmpl_els_rsp()
5505 struct lpfc_iocbq *oldiocb, struct lpfc_nodelist *ndlp, in lpfc_els_rsp_acc() argument
5525 ndlp, ndlp->nlp_DID, ELS_CMD_ACC); in lpfc_els_rsp_acc()
5527 spin_lock_irq(&ndlp->lock); in lpfc_els_rsp_acc()
5528 ndlp->nlp_flag &= ~NLP_LOGO_ACC; in lpfc_els_rsp_acc()
5529 spin_unlock_irq(&ndlp->lock); in lpfc_els_rsp_acc()
5558 ndlp->nlp_DID, ndlp->nlp_flag, 0); in lpfc_els_rsp_acc()
5564 ndlp, ndlp->nlp_DID, ELS_CMD_ACC); in lpfc_els_rsp_acc()
5637 ndlp->nlp_DID, ndlp->nlp_flag, 0); in lpfc_els_rsp_acc()
5642 ndlp, ndlp->nlp_DID, ELS_CMD_PRLO); in lpfc_els_rsp_acc()
5675 ndlp->nlp_DID, ndlp->nlp_flag, 0); in lpfc_els_rsp_acc()
5680 ndlp, ndlp->nlp_DID, ELS_CMD_ACC); in lpfc_els_rsp_acc()
5719 if (ndlp->nlp_flag & NLP_LOGO_ACC) { in lpfc_els_rsp_acc()
5720 spin_lock_irq(&ndlp->lock); in lpfc_els_rsp_acc()
5721 if (!(ndlp->nlp_flag & NLP_RPI_REGISTERED || in lpfc_els_rsp_acc()
5722 ndlp->nlp_flag & NLP_REG_LOGIN_SEND)) in lpfc_els_rsp_acc()
5723 ndlp->nlp_flag &= ~NLP_LOGO_ACC; in lpfc_els_rsp_acc()
5724 spin_unlock_irq(&ndlp->lock); in lpfc_els_rsp_acc()
5731 elsiocb->ndlp = lpfc_nlp_get(ndlp); in lpfc_els_rsp_acc()
5732 if (!elsiocb->ndlp) { in lpfc_els_rsp_acc()
5740 lpfc_nlp_put(ndlp); in lpfc_els_rsp_acc()
5750 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state, in lpfc_els_rsp_acc()
5751 ndlp->nlp_rpi, vport->fc_flag, kref_read(&ndlp->kref)); in lpfc_els_rsp_acc()
5779 struct lpfc_iocbq *oldiocb, struct lpfc_nodelist *ndlp, in lpfc_els_rsp_reject() argument
5792 elsiocb = lpfc_prep_els_iocb(vport, 0, cmdsize, oldiocb->retry, ndlp, in lpfc_els_rsp_reject()
5793 ndlp->nlp_DID, ELS_CMD_LS_RJT); in lpfc_els_rsp_reject()
5825 get_job_ulpcontext(phba, elsiocb), ndlp->nlp_DID, in lpfc_els_rsp_reject()
5826 ndlp->nlp_flag, ndlp->nlp_state, ndlp->nlp_rpi); in lpfc_els_rsp_reject()
5829 ndlp->nlp_DID, ndlp->nlp_flag, rejectError); in lpfc_els_rsp_reject()
5833 elsiocb->ndlp = lpfc_nlp_get(ndlp); in lpfc_els_rsp_reject()
5834 if (!elsiocb->ndlp) { in lpfc_els_rsp_reject()
5845 !(ndlp->fc4_xpt_flags & SCSI_XPT_REGD)) { in lpfc_els_rsp_reject()
5846 spin_lock_irq(&ndlp->lock); in lpfc_els_rsp_reject()
5847 ndlp->nlp_flag |= NLP_RELEASE_RPI; in lpfc_els_rsp_reject()
5848 spin_unlock_irq(&ndlp->lock); in lpfc_els_rsp_reject()
5854 lpfc_nlp_put(ndlp); in lpfc_els_rsp_reject()
5877 struct lpfc_nodelist *ndlp) in lpfc_issue_els_edc_rsp() argument
5896 ndlp, ndlp->nlp_DID, ELS_CMD_ACC); in lpfc_issue_els_edc_rsp()
5932 ndlp->nlp_DID, ndlp->nlp_flag, in lpfc_issue_els_edc_rsp()
5933 kref_read(&ndlp->kref)); in lpfc_issue_els_edc_rsp()
5937 elsiocb->ndlp = lpfc_nlp_get(ndlp); in lpfc_issue_els_edc_rsp()
5938 if (!elsiocb->ndlp) { in lpfc_issue_els_edc_rsp()
5946 lpfc_nlp_put(ndlp); in lpfc_issue_els_edc_rsp()
5956 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state, in lpfc_issue_els_edc_rsp()
5957 ndlp->nlp_rpi, vport->fc_flag); in lpfc_issue_els_edc_rsp()
5983 struct lpfc_nodelist *ndlp) in lpfc_els_rsp_adisc_acc() argument
5996 elsiocb = lpfc_prep_els_iocb(vport, 0, cmdsize, oldiocb->retry, ndlp, in lpfc_els_rsp_adisc_acc()
5997 ndlp->nlp_DID, ELS_CMD_ACC); in lpfc_els_rsp_adisc_acc()
6024 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state, in lpfc_els_rsp_adisc_acc()
6025 ndlp->nlp_rpi); in lpfc_els_rsp_adisc_acc()
6039 ndlp->nlp_DID, ndlp->nlp_flag, kref_read(&ndlp->kref)); in lpfc_els_rsp_adisc_acc()
6043 elsiocb->ndlp = lpfc_nlp_get(ndlp); in lpfc_els_rsp_adisc_acc()
6044 if (!elsiocb->ndlp) { in lpfc_els_rsp_adisc_acc()
6052 lpfc_nlp_put(ndlp); in lpfc_els_rsp_adisc_acc()
6080 struct lpfc_nodelist *ndlp) in lpfc_els_rsp_prli_acc() argument
6120 elsiocb = lpfc_prep_els_iocb(vport, 0, cmdsize, oldiocb->retry, ndlp, in lpfc_els_rsp_prli_acc()
6121 ndlp->nlp_DID, elsrspcmd); in lpfc_els_rsp_prli_acc()
6146 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state, in lpfc_els_rsp_prli_acc()
6147 ndlp->nlp_rpi); in lpfc_els_rsp_prli_acc()
6164 if ((ndlp->nlp_type & NLP_FCP_TARGET) && in lpfc_els_rsp_prli_acc()
6173 if (ndlp->nlp_type & NLP_FCP_TARGET) in lpfc_els_rsp_prli_acc()
6218 npr_nvme->word5, ndlp->nlp_flag, in lpfc_els_rsp_prli_acc()
6219 ndlp->nlp_fcp_info, ndlp->nlp_type); in lpfc_els_rsp_prli_acc()
6226 prli_fc4_req, ndlp->nlp_fc4_type, in lpfc_els_rsp_prli_acc()
6227 ndlp->nlp_DID); in lpfc_els_rsp_prli_acc()
6231 ndlp->nlp_DID, ndlp->nlp_flag, kref_read(&ndlp->kref)); in lpfc_els_rsp_prli_acc()
6235 elsiocb->ndlp = lpfc_nlp_get(ndlp); in lpfc_els_rsp_prli_acc()
6236 if (!elsiocb->ndlp) { in lpfc_els_rsp_prli_acc()
6244 lpfc_nlp_put(ndlp); in lpfc_els_rsp_prli_acc()
6273 struct lpfc_iocbq *oldiocb, struct lpfc_nodelist *ndlp) in lpfc_els_rsp_rnid_acc() argument
6290 elsiocb = lpfc_prep_els_iocb(vport, 0, cmdsize, oldiocb->retry, ndlp, in lpfc_els_rsp_rnid_acc()
6291 ndlp->nlp_DID, ELS_CMD_ACC); in lpfc_els_rsp_rnid_acc()
6345 ndlp->nlp_DID, ndlp->nlp_flag, kref_read(&ndlp->kref)); in lpfc_els_rsp_rnid_acc()
6349 elsiocb->ndlp = lpfc_nlp_get(ndlp); in lpfc_els_rsp_rnid_acc()
6350 if (!elsiocb->ndlp) { in lpfc_els_rsp_rnid_acc()
6358 lpfc_nlp_put(ndlp); in lpfc_els_rsp_rnid_acc()
6375 struct lpfc_iocbq *iocb, struct lpfc_nodelist *ndlp) in lpfc_els_clear_rrq() argument
6402 ndlp->nlp_DID, ndlp->nlp_flag, rrq->rrq_exchg); in lpfc_els_clear_rrq()
6407 prrq = lpfc_get_active_rrq(vport, xri, ndlp->nlp_DID); in lpfc_els_clear_rrq()
6426 struct lpfc_iocbq *oldiocb, struct lpfc_nodelist *ndlp) in lpfc_els_rsp_echo_acc() argument
6447 elsiocb = lpfc_prep_els_iocb(vport, 0, cmdsize, oldiocb->retry, ndlp, in lpfc_els_rsp_echo_acc()
6448 ndlp->nlp_DID, ELS_CMD_ACC); in lpfc_els_rsp_echo_acc()
6479 ndlp->nlp_DID, ndlp->nlp_flag, kref_read(&ndlp->kref)); in lpfc_els_rsp_echo_acc()
6483 elsiocb->ndlp = lpfc_nlp_get(ndlp); in lpfc_els_rsp_echo_acc()
6484 if (!elsiocb->ndlp) { in lpfc_els_rsp_echo_acc()
6492 lpfc_nlp_put(ndlp); in lpfc_els_rsp_echo_acc()
6522 struct lpfc_nodelist *ndlp, *next_ndlp; in lpfc_els_disc_adisc() local
6526 list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, nlp_listp) { in lpfc_els_disc_adisc()
6528 if (ndlp->nlp_state != NLP_STE_NPR_NODE || in lpfc_els_disc_adisc()
6529 !(ndlp->nlp_flag & NLP_NPR_ADISC)) in lpfc_els_disc_adisc()
6532 spin_lock_irq(&ndlp->lock); in lpfc_els_disc_adisc()
6533 ndlp->nlp_flag &= ~NLP_NPR_ADISC; in lpfc_els_disc_adisc()
6534 spin_unlock_irq(&ndlp->lock); in lpfc_els_disc_adisc()
6536 if (!(ndlp->nlp_flag & NLP_NPR_2B_DISC)) { in lpfc_els_disc_adisc()
6544 lpfc_nlp_unreg_node(vport, ndlp); in lpfc_els_disc_adisc()
6545 lpfc_unreg_rpi(vport, ndlp); in lpfc_els_disc_adisc()
6549 ndlp->nlp_prev_state = ndlp->nlp_state; in lpfc_els_disc_adisc()
6550 lpfc_nlp_set_state(vport, ndlp, NLP_STE_ADISC_ISSUE); in lpfc_els_disc_adisc()
6551 lpfc_issue_els_adisc(vport, ndlp, 0); in lpfc_els_disc_adisc()
6594 struct lpfc_nodelist *ndlp, *next_ndlp; in lpfc_els_disc_plogi() local
6598 list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, nlp_listp) { in lpfc_els_disc_plogi()
6599 if (ndlp->nlp_state == NLP_STE_NPR_NODE && in lpfc_els_disc_plogi()
6600 (ndlp->nlp_flag & NLP_NPR_2B_DISC) != 0 && in lpfc_els_disc_plogi()
6601 (ndlp->nlp_flag & NLP_DELAY_TMO) == 0 && in lpfc_els_disc_plogi()
6602 (ndlp->nlp_flag & NLP_NPR_ADISC) == 0) { in lpfc_els_disc_plogi()
6603 ndlp->nlp_prev_state = ndlp->nlp_state; in lpfc_els_disc_plogi()
6604 lpfc_nlp_set_state(vport, ndlp, NLP_STE_PLOGI_ISSUE); in lpfc_els_disc_plogi()
6605 lpfc_issue_els_plogi(vport, ndlp->nlp_DID, 0); in lpfc_els_disc_plogi()
7036 struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) in lpfc_rdp_res_attach_port_names() argument
7047 memcpy(desc->port_names.wwnn, &ndlp->nlp_nodename, in lpfc_rdp_res_attach_port_names()
7050 memcpy(desc->port_names.wwpn, &ndlp->nlp_portname, in lpfc_rdp_res_attach_port_names()
7062 struct lpfc_nodelist *ndlp = rdp_context->ndlp; in lpfc_els_rdp_cmpl() local
7063 struct lpfc_vport *vport = ndlp->vport; in lpfc_els_rdp_cmpl()
7083 lpfc_max_els_tries, rdp_context->ndlp, in lpfc_els_rdp_cmpl()
7084 rdp_context->ndlp->nlp_DID, ELS_CMD_ACC); in lpfc_els_rdp_cmpl()
7106 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state, in lpfc_els_rdp_cmpl()
7107 ndlp->nlp_rpi); in lpfc_els_rdp_cmpl()
7133 (len + pcmd), vport, ndlp); in lpfc_els_rdp_cmpl()
7166 elsiocb->ndlp = lpfc_nlp_get(ndlp); in lpfc_els_rdp_cmpl()
7167 if (!elsiocb->ndlp) { in lpfc_els_rdp_cmpl()
7175 lpfc_nlp_put(ndlp); in lpfc_els_rdp_cmpl()
7183 ndlp, ndlp->nlp_DID, ELS_CMD_LS_RJT); in lpfc_els_rdp_cmpl()
7209 elsiocb->ndlp = lpfc_nlp_get(ndlp); in lpfc_els_rdp_cmpl()
7210 if (!elsiocb->ndlp) { in lpfc_els_rdp_cmpl()
7218 lpfc_nlp_put(ndlp); in lpfc_els_rdp_cmpl()
7225 lpfc_nlp_put(ndlp); in lpfc_els_rdp_cmpl()
7244 mbox->vport = rdp_context->ndlp->vport; in lpfc_get_rdp_info()
7407 struct lpfc_nodelist *ndlp) in lpfc_els_rcv_rdp() argument
7457 rdp_context->ndlp = lpfc_nlp_get(ndlp); in lpfc_els_rcv_rdp()
7458 if (!rdp_context->ndlp) { in lpfc_els_rcv_rdp()
7469 lpfc_printf_vlog(ndlp->vport, KERN_WARNING, LOG_ELS, in lpfc_els_rcv_rdp()
7473 lpfc_nlp_put(ndlp); in lpfc_els_rcv_rdp()
7486 lpfc_els_rsp_reject(vport, stat.un.lsRjtError, cmdiocb, ndlp, NULL); in lpfc_els_rcv_rdp()
7499 struct lpfc_nodelist *ndlp; in lpfc_els_lcb_rsp() local
7509 ndlp = lcb_context->ndlp; in lpfc_els_lcb_rsp()
7534 lpfc_max_els_tries, ndlp, in lpfc_els_lcb_rsp()
7535 ndlp->nlp_DID, ELS_CMD_ACC); in lpfc_els_lcb_rsp()
7538 lpfc_nlp_put(ndlp); in lpfc_els_lcb_rsp()
7568 elsiocb->ndlp = lpfc_nlp_get(ndlp); in lpfc_els_lcb_rsp()
7569 if (!elsiocb->ndlp) { in lpfc_els_lcb_rsp()
7577 lpfc_nlp_put(ndlp); in lpfc_els_lcb_rsp()
7586 lpfc_max_els_tries, ndlp, in lpfc_els_lcb_rsp()
7587 ndlp->nlp_DID, ELS_CMD_LS_RJT); in lpfc_els_lcb_rsp()
7588 lpfc_nlp_put(ndlp); in lpfc_els_lcb_rsp()
7614 elsiocb->ndlp = lpfc_nlp_get(ndlp); in lpfc_els_lcb_rsp()
7615 if (!elsiocb->ndlp) { in lpfc_els_lcb_rsp()
7623 lpfc_nlp_put(ndlp); in lpfc_els_lcb_rsp()
7717 struct lpfc_nodelist *ndlp) in lpfc_els_rcv_lcb() argument
7769 lcb_context->ndlp = lpfc_nlp_get(ndlp); in lpfc_els_rcv_lcb()
7770 if (!lcb_context->ndlp) { in lpfc_els_rcv_lcb()
7776 lpfc_printf_vlog(ndlp->vport, KERN_ERR, LOG_TRACE_EVENT, in lpfc_els_rcv_lcb()
7778 lpfc_nlp_put(ndlp); in lpfc_els_rcv_lcb()
7789 lpfc_els_rsp_reject(vport, stat.un.lsRjtError, cmdiocb, ndlp, NULL); in lpfc_els_rcv_lcb()
7924 struct lpfc_nodelist *ndlp = NULL, *n; in lpfc_rscn_recovery_check() local
7927 list_for_each_entry_safe(ndlp, n, &vport->fc_nodes, nlp_listp) { in lpfc_rscn_recovery_check()
7928 if ((ndlp->nlp_state == NLP_STE_UNUSED_NODE) || in lpfc_rscn_recovery_check()
7929 !lpfc_rscn_payload_check(vport, ndlp->nlp_DID)) in lpfc_rscn_recovery_check()
7939 switch (ndlp->nlp_state) { in lpfc_rscn_recovery_check()
7948 lpfc_disc_state_machine(vport, ndlp, NULL, in lpfc_rscn_recovery_check()
7950 lpfc_cancel_retry_delay_tmo(vport, ndlp); in lpfc_rscn_recovery_check()
8022 struct lpfc_nodelist *ndlp) in lpfc_els_rcv_rscn() argument
8057 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL); in lpfc_els_rcv_rscn()
8062 if (ndlp->nlp_fc4_type & NLP_FC4_NVME && in lpfc_els_rcv_rscn()
8063 ndlp->nlp_type & (NLP_NVME_TARGET | NLP_NVME_DISCOVERY)) in lpfc_els_rcv_rscn()
8064 lpfc_nvme_rescan_port(vport, ndlp); in lpfc_els_rcv_rscn()
8074 ndlp->nlp_DID, vport->port_state, ndlp->nlp_flag); in lpfc_els_rcv_rscn()
8076 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL); in lpfc_els_rcv_rscn()
8104 ndlp->nlp_DID, vport->port_state, in lpfc_els_rcv_rscn()
8105 ndlp->nlp_flag); in lpfc_els_rcv_rscn()
8108 ndlp, NULL); in lpfc_els_rcv_rscn()
8126 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL); in lpfc_els_rcv_rscn()
8140 ndlp->nlp_DID, vport->port_state, ndlp->nlp_flag); in lpfc_els_rcv_rscn()
8192 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL); in lpfc_els_rcv_rscn()
8199 ndlp->nlp_DID, vport->port_state, ndlp->nlp_flag); in lpfc_els_rcv_rscn()
8214 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL); in lpfc_els_rcv_rscn()
8239 struct lpfc_nodelist *ndlp; in lpfc_els_handle_rscn() local
8262 ndlp = lpfc_findnode_did(vport, NameServer_DID); in lpfc_els_handle_rscn()
8263 if (ndlp && ndlp->nlp_state == NLP_STE_UNMAPPED_NODE) { in lpfc_els_handle_rscn()
8280 if (ndlp) { in lpfc_els_handle_rscn()
8281 ndlp->nlp_prev_state = NLP_STE_UNUSED_NODE; in lpfc_els_handle_rscn()
8282 lpfc_nlp_set_state(vport, ndlp, NLP_STE_PLOGI_ISSUE); in lpfc_els_handle_rscn()
8284 ndlp = lpfc_nlp_init(vport, NameServer_DID); in lpfc_els_handle_rscn()
8285 if (!ndlp) { in lpfc_els_handle_rscn()
8289 ndlp->nlp_prev_state = ndlp->nlp_state; in lpfc_els_handle_rscn()
8290 lpfc_nlp_set_state(vport, ndlp, NLP_STE_PLOGI_ISSUE); in lpfc_els_handle_rscn()
8292 ndlp->nlp_type |= NLP_FABRIC; in lpfc_els_handle_rscn()
8331 struct lpfc_nodelist *ndlp) in lpfc_els_rcv_flogi() argument
8368 (void) lpfc_check_sparm(vport, ndlp, sp, CLASS3, 1); in lpfc_els_rcv_flogi()
8478 lpfc_els_rsp_acc(vport, ELS_CMD_FLOGI, cmdiocb, ndlp, NULL); in lpfc_els_rcv_flogi()
8504 struct lpfc_nodelist *ndlp) in lpfc_els_rcv_rnid() argument
8523 lpfc_els_rsp_rnid_acc(vport, rn->Format, cmdiocb, ndlp); in lpfc_els_rcv_rnid()
8531 lpfc_els_rsp_reject(vport, stat.un.lsRjtError, cmdiocb, ndlp, in lpfc_els_rcv_rnid()
8548 struct lpfc_nodelist *ndlp) in lpfc_els_rcv_echo() argument
8557 lpfc_els_rsp_echo_acc(vport, pcmd, cmdiocb, ndlp); in lpfc_els_rcv_echo()
8576 struct lpfc_nodelist *ndlp) in lpfc_els_rcv_lirr() argument
8585 lpfc_els_rsp_reject(vport, stat.un.lsRjtError, cmdiocb, ndlp, NULL); in lpfc_els_rcv_lirr()
8607 struct lpfc_nodelist *ndlp) in lpfc_els_rcv_rrq() argument
8609 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL); in lpfc_els_rcv_rrq()
8611 lpfc_els_clear_rrq(vport, cmdiocb, ndlp); in lpfc_els_rcv_rrq()
8643 struct lpfc_nodelist *ndlp; in lpfc_els_rsp_rls_acc() local
8651 ndlp = pmb->ctx_ndlp; in lpfc_els_rsp_rls_acc()
8664 lpfc_max_els_tries, ndlp, in lpfc_els_rsp_rls_acc()
8665 ndlp->nlp_DID, ELS_CMD_ACC); in lpfc_els_rsp_rls_acc()
8668 lpfc_nlp_put(ndlp); in lpfc_els_rsp_rls_acc()
8700 lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_ELS, in lpfc_els_rsp_rls_acc()
8704 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state, in lpfc_els_rsp_rls_acc()
8705 ndlp->nlp_rpi); in lpfc_els_rsp_rls_acc()
8708 elsiocb->ndlp = lpfc_nlp_get(ndlp); in lpfc_els_rsp_rls_acc()
8709 if (!elsiocb->ndlp) { in lpfc_els_rsp_rls_acc()
8717 lpfc_nlp_put(ndlp); in lpfc_els_rsp_rls_acc()
8742 struct lpfc_nodelist *ndlp) in lpfc_els_rcv_rls() argument
8750 if ((ndlp->nlp_state != NLP_STE_UNMAPPED_NODE) && in lpfc_els_rcv_rls()
8751 (ndlp->nlp_state != NLP_STE_MAPPED_NODE)) in lpfc_els_rcv_rls()
8760 mbox->ctx_ndlp = lpfc_nlp_get(ndlp); in lpfc_els_rcv_rls()
8772 lpfc_nlp_put(ndlp); in lpfc_els_rcv_rls()
8782 lpfc_els_rsp_reject(vport, stat.un.lsRjtError, cmdiocb, ndlp, NULL); in lpfc_els_rcv_rls()
8809 struct lpfc_nodelist *ndlp) in lpfc_els_rcv_rtv() argument
8822 if ((ndlp->nlp_state != NLP_STE_UNMAPPED_NODE) && in lpfc_els_rcv_rtv()
8823 (ndlp->nlp_state != NLP_STE_MAPPED_NODE)) in lpfc_els_rcv_rtv()
8829 lpfc_max_els_tries, ndlp, in lpfc_els_rcv_rtv()
8830 ndlp->nlp_DID, ELS_CMD_ACC); in lpfc_els_rcv_rtv()
8863 lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_ELS, in lpfc_els_rcv_rtv()
8868 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state, in lpfc_els_rcv_rtv()
8869 ndlp->nlp_rpi, in lpfc_els_rcv_rtv()
8873 elsiocb->ndlp = lpfc_nlp_get(ndlp); in lpfc_els_rcv_rtv()
8874 if (!elsiocb->ndlp) { in lpfc_els_rcv_rtv()
8882 lpfc_nlp_put(ndlp); in lpfc_els_rcv_rtv()
8892 lpfc_els_rsp_reject(vport, stat.un.lsRjtError, cmdiocb, ndlp, NULL); in lpfc_els_rcv_rtv()
8910 lpfc_issue_els_rrq(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, in lpfc_issue_els_rrq() argument
8920 if (!ndlp) in lpfc_issue_els_rrq()
8925 elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, 0, ndlp, did, in lpfc_issue_els_rrq()
8950 elsiocb->ndlp = lpfc_nlp_get(ndlp); in lpfc_issue_els_rrq()
8951 if (!elsiocb->ndlp) in lpfc_issue_els_rrq()
8956 lpfc_nlp_put(ndlp); in lpfc_issue_els_rrq()
8981 struct lpfc_nodelist *ndlp = lpfc_findnode_did(rrq->vport, in lpfc_send_rrq() local
8983 if (!ndlp) in lpfc_send_rrq()
8986 if (lpfc_test_rrq_active(phba, ndlp, rrq->xritag)) in lpfc_send_rrq()
8987 return lpfc_issue_els_rrq(rrq->vport, ndlp, in lpfc_send_rrq()
9014 struct lpfc_iocbq *oldiocb, struct lpfc_nodelist *ndlp) in lpfc_els_rsp_rpl_acc() argument
9025 elsiocb = lpfc_prep_els_iocb(vport, 0, cmdsize, oldiocb->retry, ndlp, in lpfc_els_rsp_rpl_acc()
9026 ndlp->nlp_DID, ELS_CMD_ACC); in lpfc_els_rsp_rpl_acc()
9065 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state, in lpfc_els_rsp_rpl_acc()
9066 ndlp->nlp_rpi); in lpfc_els_rsp_rpl_acc()
9069 elsiocb->ndlp = lpfc_nlp_get(ndlp); in lpfc_els_rsp_rpl_acc()
9070 if (!elsiocb->ndlp) { in lpfc_els_rsp_rpl_acc()
9078 lpfc_nlp_put(ndlp); in lpfc_els_rsp_rpl_acc()
9103 struct lpfc_nodelist *ndlp) in lpfc_els_rcv_rpl() argument
9112 if ((ndlp->nlp_state != NLP_STE_UNMAPPED_NODE) && in lpfc_els_rcv_rpl()
9113 (ndlp->nlp_state != NLP_STE_MAPPED_NODE)) { in lpfc_els_rcv_rpl()
9119 lpfc_els_rsp_reject(vport, stat.un.lsRjtError, cmdiocb, ndlp, in lpfc_els_rcv_rpl()
9138 lpfc_els_rsp_rpl_acc(vport, cmdsize, cmdiocb, ndlp); in lpfc_els_rcv_rpl()
9169 struct lpfc_nodelist *ndlp) in lpfc_els_rcv_farp() argument
9206 if ((ndlp->nlp_state == NLP_STE_UNMAPPED_NODE) || in lpfc_els_rcv_farp()
9207 (ndlp->nlp_state == NLP_STE_MAPPED_NODE)) { in lpfc_els_rcv_farp()
9210 ndlp->nlp_prev_state = ndlp->nlp_state; in lpfc_els_rcv_farp()
9211 lpfc_nlp_set_state(vport, ndlp, in lpfc_els_rcv_farp()
9213 lpfc_issue_els_plogi(vport, ndlp->nlp_DID, 0); in lpfc_els_rcv_farp()
9240 struct lpfc_nodelist *ndlp) in lpfc_els_rcv_farpr() argument
9250 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL); in lpfc_els_rcv_farpr()
9321 struct lpfc_nodelist *ndlp) in lpfc_els_rcv_edc() argument
9436 lpfc_issue_els_edc_rsp(vport, cmdiocb, ndlp); in lpfc_els_rcv_edc()
9551 struct lpfc_nodelist *ndlp; in lpfc_els_timeout_handler() local
9552 ndlp = __lpfc_findnode_rpi(vport, ulp_context); in lpfc_els_timeout_handler()
9553 if (ndlp) in lpfc_els_timeout_handler()
9554 remote_ID = ndlp->nlp_DID; in lpfc_els_timeout_handler()
9792 struct lpfc_nodelist *ndlp; in lpfc_send_els_failure_event() local
9796 ndlp = cmdiocbp->ndlp; in lpfc_send_els_failure_event()
9797 if (!ndlp) in lpfc_send_els_failure_event()
9806 memcpy(lsrjt_event.header.wwpn, &ndlp->nlp_portname, in lpfc_send_els_failure_event()
9808 memcpy(lsrjt_event.header.wwnn, &ndlp->nlp_nodename, in lpfc_send_els_failure_event()
9829 memcpy(fabric_event.wwpn, &ndlp->nlp_portname, in lpfc_send_els_failure_event()
9831 memcpy(fabric_event.wwnn, &ndlp->nlp_nodename, in lpfc_send_els_failure_event()
9854 struct lpfc_nodelist *ndlp, in lpfc_send_els_event() argument
9901 memcpy(els_data->wwpn, &ndlp->nlp_portname, sizeof(struct lpfc_name)); in lpfc_send_els_event()
9902 memcpy(els_data->wwnn, &ndlp->nlp_nodename, sizeof(struct lpfc_name)); in lpfc_send_els_event()
10338 struct lpfc_nodelist *ndlp; in lpfc_els_unsol_buffer() local
10382 ndlp = lpfc_findnode_did(vport, did); in lpfc_els_unsol_buffer()
10383 if (!ndlp) { in lpfc_els_unsol_buffer()
10385 ndlp = lpfc_nlp_init(vport, did); in lpfc_els_unsol_buffer()
10386 if (!ndlp) in lpfc_els_unsol_buffer()
10388 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); in lpfc_els_unsol_buffer()
10391 ndlp->nlp_type |= NLP_FABRIC; in lpfc_els_unsol_buffer()
10392 } else if (ndlp->nlp_state == NLP_STE_UNUSED_NODE) { in lpfc_els_unsol_buffer()
10393 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); in lpfc_els_unsol_buffer()
10403 spin_lock_irq(&ndlp->lock); in lpfc_els_unsol_buffer()
10404 if (ndlp->nlp_flag & NLP_IN_DEV_LOSS) { in lpfc_els_unsol_buffer()
10405 spin_unlock_irq(&ndlp->lock); in lpfc_els_unsol_buffer()
10407 lpfc_nlp_put(ndlp); in lpfc_els_unsol_buffer()
10410 spin_unlock_irq(&ndlp->lock); in lpfc_els_unsol_buffer()
10412 elsiocb->ndlp = lpfc_nlp_get(ndlp); in lpfc_els_unsol_buffer()
10413 if (!elsiocb->ndlp) in lpfc_els_unsol_buffer()
10424 cmd, did, kref_read(&ndlp->kref), vport->port_state, in lpfc_els_unsol_buffer()
10440 did, vport->port_state, ndlp->nlp_flag); in lpfc_els_unsol_buffer()
10443 ndlp = lpfc_plogi_confirm_nport(phba, payload, ndlp); in lpfc_els_unsol_buffer()
10460 lpfc_send_els_event(vport, ndlp, payload); in lpfc_els_unsol_buffer()
10478 spin_lock_irq(&ndlp->lock); in lpfc_els_unsol_buffer()
10479 ndlp->nlp_flag &= ~NLP_TARGET_REMOVE; in lpfc_els_unsol_buffer()
10480 spin_unlock_irq(&ndlp->lock); in lpfc_els_unsol_buffer()
10482 lpfc_disc_state_machine(vport, ndlp, elsiocb, in lpfc_els_unsol_buffer()
10489 did, vport->port_state, ndlp->nlp_flag); in lpfc_els_unsol_buffer()
10505 lpfc_els_rcv_flogi(vport, elsiocb, ndlp); in lpfc_els_unsol_buffer()
10510 lpfc_disc_state_machine(vport, ndlp, NULL, in lpfc_els_unsol_buffer()
10516 did, vport->port_state, ndlp->nlp_flag); in lpfc_els_unsol_buffer()
10519 lpfc_send_els_event(vport, ndlp, payload); in lpfc_els_unsol_buffer()
10525 lpfc_disc_state_machine(vport, ndlp, elsiocb, NLP_EVT_RCV_LOGO); in lpfc_els_unsol_buffer()
10527 lpfc_disc_state_machine(vport, ndlp, NULL, in lpfc_els_unsol_buffer()
10533 did, vport->port_state, ndlp->nlp_flag); in lpfc_els_unsol_buffer()
10536 lpfc_send_els_event(vport, ndlp, payload); in lpfc_els_unsol_buffer()
10542 lpfc_disc_state_machine(vport, ndlp, elsiocb, NLP_EVT_RCV_PRLO); in lpfc_els_unsol_buffer()
10546 lpfc_els_rcv_lcb(vport, elsiocb, ndlp); in lpfc_els_unsol_buffer()
10550 lpfc_els_rcv_rdp(vport, elsiocb, ndlp); in lpfc_els_unsol_buffer()
10554 lpfc_els_rcv_rscn(vport, elsiocb, ndlp); in lpfc_els_unsol_buffer()
10556 lpfc_disc_state_machine(vport, ndlp, NULL, in lpfc_els_unsol_buffer()
10562 did, vport->port_state, ndlp->nlp_flag); in lpfc_els_unsol_buffer()
10564 lpfc_send_els_event(vport, ndlp, payload); in lpfc_els_unsol_buffer()
10571 lpfc_disc_state_machine(vport, ndlp, elsiocb, in lpfc_els_unsol_buffer()
10577 did, vport->port_state, ndlp->nlp_flag); in lpfc_els_unsol_buffer()
10585 lpfc_disc_state_machine(vport, ndlp, elsiocb, in lpfc_els_unsol_buffer()
10591 did, vport->port_state, ndlp->nlp_flag); in lpfc_els_unsol_buffer()
10594 lpfc_els_rcv_farpr(vport, elsiocb, ndlp); in lpfc_els_unsol_buffer()
10599 did, vport->port_state, ndlp->nlp_flag); in lpfc_els_unsol_buffer()
10602 lpfc_els_rcv_farp(vport, elsiocb, ndlp); in lpfc_els_unsol_buffer()
10607 did, vport->port_state, ndlp->nlp_flag); in lpfc_els_unsol_buffer()
10610 lpfc_els_rcv_fan(vport, elsiocb, ndlp); in lpfc_els_unsol_buffer()
10616 did, vport->port_state, ndlp->nlp_flag); in lpfc_els_unsol_buffer()
10625 lpfc_disc_state_machine(vport, ndlp, elsiocb, NLP_EVT_RCV_PRLI); in lpfc_els_unsol_buffer()
10630 did, vport->port_state, ndlp->nlp_flag); in lpfc_els_unsol_buffer()
10633 lpfc_els_rcv_lirr(vport, elsiocb, ndlp); in lpfc_els_unsol_buffer()
10635 lpfc_disc_state_machine(vport, ndlp, NULL, in lpfc_els_unsol_buffer()
10641 did, vport->port_state, ndlp->nlp_flag); in lpfc_els_unsol_buffer()
10644 lpfc_els_rcv_rls(vport, elsiocb, ndlp); in lpfc_els_unsol_buffer()
10646 lpfc_disc_state_machine(vport, ndlp, NULL, in lpfc_els_unsol_buffer()
10652 did, vport->port_state, ndlp->nlp_flag); in lpfc_els_unsol_buffer()
10655 lpfc_els_rcv_rpl(vport, elsiocb, ndlp); in lpfc_els_unsol_buffer()
10657 lpfc_disc_state_machine(vport, ndlp, NULL, in lpfc_els_unsol_buffer()
10663 did, vport->port_state, ndlp->nlp_flag); in lpfc_els_unsol_buffer()
10666 lpfc_els_rcv_rnid(vport, elsiocb, ndlp); in lpfc_els_unsol_buffer()
10668 lpfc_disc_state_machine(vport, ndlp, NULL, in lpfc_els_unsol_buffer()
10674 did, vport->port_state, ndlp->nlp_flag); in lpfc_els_unsol_buffer()
10676 lpfc_els_rcv_rtv(vport, elsiocb, ndlp); in lpfc_els_unsol_buffer()
10678 lpfc_disc_state_machine(vport, ndlp, NULL, in lpfc_els_unsol_buffer()
10684 did, vport->port_state, ndlp->nlp_flag); in lpfc_els_unsol_buffer()
10687 lpfc_els_rcv_rrq(vport, elsiocb, ndlp); in lpfc_els_unsol_buffer()
10689 lpfc_disc_state_machine(vport, ndlp, NULL, in lpfc_els_unsol_buffer()
10695 did, vport->port_state, ndlp->nlp_flag); in lpfc_els_unsol_buffer()
10698 lpfc_els_rcv_echo(vport, elsiocb, ndlp); in lpfc_els_unsol_buffer()
10700 lpfc_disc_state_machine(vport, ndlp, NULL, in lpfc_els_unsol_buffer()
10711 did, vport->port_state, ndlp->nlp_flag); in lpfc_els_unsol_buffer()
10719 lpfc_els_rcv_edc(vport, elsiocb, ndlp); in lpfc_els_unsol_buffer()
10733 lpfc_els_rcv_rdf(vport, elsiocb, ndlp); in lpfc_els_unsol_buffer()
10749 lpfc_disc_state_machine(vport, ndlp, NULL, in lpfc_els_unsol_buffer()
10760 lpfc_els_rsp_reject(vport, stat.un.lsRjtError, elsiocb, ndlp, in lpfc_els_unsol_buffer()
10764 lpfc_disc_state_machine(vport, ndlp, NULL, in lpfc_els_unsol_buffer()
10769 lpfc_nlp_put(elsiocb->ndlp); in lpfc_els_unsol_buffer()
10770 elsiocb->ndlp = NULL; in lpfc_els_unsol_buffer()
10912 struct lpfc_nodelist *ndlp; in lpfc_start_fdmi() local
10918 ndlp = lpfc_findnode_did(vport, FDMI_DID); in lpfc_start_fdmi()
10919 if (!ndlp) { in lpfc_start_fdmi()
10920 ndlp = lpfc_nlp_init(vport, FDMI_DID); in lpfc_start_fdmi()
10921 if (ndlp) { in lpfc_start_fdmi()
10922 ndlp->nlp_type |= NLP_FABRIC; in lpfc_start_fdmi()
10928 lpfc_nlp_set_state(vport, ndlp, NLP_STE_PLOGI_ISSUE); in lpfc_start_fdmi()
10929 lpfc_issue_els_plogi(vport, ndlp->nlp_DID, 0); in lpfc_start_fdmi()
10948 struct lpfc_nodelist *ndlp; in lpfc_do_scr_ns_plogi() local
10968 ndlp = lpfc_findnode_did(vport, NameServer_DID); in lpfc_do_scr_ns_plogi()
10969 if (!ndlp) { in lpfc_do_scr_ns_plogi()
10970 ndlp = lpfc_nlp_init(vport, NameServer_DID); in lpfc_do_scr_ns_plogi()
10971 if (!ndlp) { in lpfc_do_scr_ns_plogi()
10983 ndlp->nlp_type |= NLP_FABRIC; in lpfc_do_scr_ns_plogi()
10985 lpfc_nlp_set_state(vport, ndlp, NLP_STE_PLOGI_ISSUE); in lpfc_do_scr_ns_plogi()
10987 if (lpfc_issue_els_plogi(vport, ndlp->nlp_DID, 0)) { in lpfc_do_scr_ns_plogi()
11017 struct lpfc_nodelist *ndlp = pmb->ctx_ndlp; in lpfc_cmpl_reg_new_vport() local
11061 lpfc_nlp_put(ndlp); in lpfc_cmpl_reg_new_vport()
11110 lpfc_nlp_put(ndlp); in lpfc_cmpl_reg_new_vport()
11127 struct lpfc_nodelist *ndlp) in lpfc_register_new_vport() argument
11136 mbox->ctx_ndlp = lpfc_nlp_get(ndlp); in lpfc_register_new_vport()
11148 lpfc_nlp_put(ndlp); in lpfc_register_new_vport()
11180 struct lpfc_nodelist *ndlp; in lpfc_cancel_all_vport_retry_delay_timer() local
11193 ndlp = lpfc_findnode_did(vports[i], Fabric_DID); in lpfc_cancel_all_vport_retry_delay_timer()
11194 if (ndlp) in lpfc_cancel_all_vport_retry_delay_timer()
11195 lpfc_cancel_retry_delay_tmo(vports[i], ndlp); in lpfc_cancel_all_vport_retry_delay_timer()
11213 struct lpfc_nodelist *ndlp; in lpfc_retry_pport_discovery() local
11219 ndlp = lpfc_findnode_did(phba->pport, Fabric_DID); in lpfc_retry_pport_discovery()
11220 if (!ndlp) in lpfc_retry_pport_discovery()
11223 mod_timer(&ndlp->nlp_delayfunc, jiffies + msecs_to_jiffies(1000)); in lpfc_retry_pport_discovery()
11224 spin_lock_irq(&ndlp->lock); in lpfc_retry_pport_discovery()
11225 ndlp->nlp_flag |= NLP_DELAY_TMO; in lpfc_retry_pport_discovery()
11226 spin_unlock_irq(&ndlp->lock); in lpfc_retry_pport_discovery()
11227 ndlp->nlp_last_elscmd = ELS_CMD_FLOGI; in lpfc_retry_pport_discovery()
11282 struct lpfc_nodelist *ndlp = cmdiocb->ndlp; in lpfc_cmpl_els_fdisc() local
11327 lpfc_check_nlp_post_devloss(vport, ndlp); in lpfc_cmpl_els_fdisc()
11359 spin_lock_irq(&ndlp->lock); in lpfc_cmpl_els_fdisc()
11361 spin_unlock_irq(&ndlp->lock); in lpfc_cmpl_els_fdisc()
11383 lpfc_register_new_vport(phba, vport, ndlp); in lpfc_cmpl_els_fdisc()
11384 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); in lpfc_cmpl_els_fdisc()
11391 lpfc_register_new_vport(phba, vport, ndlp); in lpfc_cmpl_els_fdisc()
11398 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); in lpfc_cmpl_els_fdisc()
11409 lpfc_nlp_put(ndlp); in lpfc_cmpl_els_fdisc()
11432 lpfc_issue_els_fdisc(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, in lpfc_issue_els_fdisc() argument
11442 int did = ndlp->nlp_DID; in lpfc_issue_els_fdisc()
11448 elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, retry, ndlp, did, in lpfc_issue_els_fdisc()
11501 elsiocb->ndlp = lpfc_nlp_get(ndlp); in lpfc_issue_els_fdisc()
11502 if (!elsiocb->ndlp) in lpfc_issue_els_fdisc()
11507 lpfc_nlp_put(ndlp); in lpfc_issue_els_fdisc()
11542 struct lpfc_nodelist *ndlp; in lpfc_cmpl_els_npiv_logo() local
11546 ndlp = cmdiocb->ndlp; in lpfc_cmpl_els_npiv_logo()
11568 ndlp->nlp_DID, ulp_status, ulp_word4, in lpfc_cmpl_els_npiv_logo()
11570 kref_read(&ndlp->kref), ndlp->nlp_flag, in lpfc_cmpl_els_npiv_logo()
11571 ndlp->fc4_xpt_flags); in lpfc_cmpl_els_npiv_logo()
11581 if (ndlp->save_flags & NLP_WAIT_FOR_LOGO) { in lpfc_cmpl_els_npiv_logo()
11583 if (ndlp->logo_waitq) in lpfc_cmpl_els_npiv_logo()
11584 wake_up(ndlp->logo_waitq); in lpfc_cmpl_els_npiv_logo()
11585 spin_lock_irq(&ndlp->lock); in lpfc_cmpl_els_npiv_logo()
11586 ndlp->nlp_flag &= ~(NLP_ISSUE_LOGO | NLP_LOGO_SND); in lpfc_cmpl_els_npiv_logo()
11587 ndlp->save_flags &= ~NLP_WAIT_FOR_LOGO; in lpfc_cmpl_els_npiv_logo()
11588 spin_unlock_irq(&ndlp->lock); in lpfc_cmpl_els_npiv_logo()
11593 lpfc_nlp_put(ndlp); 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
11621 elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, 0, ndlp, ndlp->nlp_DID, in lpfc_issue_els_npiv_logo()
11637 ndlp->nlp_DID, ndlp->nlp_flag, 0); in lpfc_issue_els_npiv_logo()
11640 spin_lock_irq(&ndlp->lock); in lpfc_issue_els_npiv_logo()
11641 ndlp->nlp_flag |= NLP_LOGO_SND; in lpfc_issue_els_npiv_logo()
11642 spin_unlock_irq(&ndlp->lock); in lpfc_issue_els_npiv_logo()
11643 elsiocb->ndlp = lpfc_nlp_get(ndlp); in lpfc_issue_els_npiv_logo()
11644 if (!elsiocb->ndlp) { in lpfc_issue_els_npiv_logo()
11652 lpfc_nlp_put(ndlp); in lpfc_issue_els_npiv_logo()
11658 spin_lock_irq(&ndlp->lock); in lpfc_issue_els_npiv_logo()
11659 ndlp->nlp_flag &= ~NLP_LOGO_SND; in lpfc_issue_els_npiv_logo()
11660 spin_unlock_irq(&ndlp->lock); in lpfc_issue_els_npiv_logo()
11957 void lpfc_fabric_abort_nport(struct lpfc_nodelist *ndlp) in lpfc_fabric_abort_nport() argument
11960 struct lpfc_hba *phba = ndlp->phba; in lpfc_fabric_abort_nport()
11972 if ((lpfc_check_sli_ndlp(phba, pring, piocb, ndlp))) { in lpfc_fabric_abort_nport()
12020 struct lpfc_nodelist *ndlp = NULL; in lpfc_sli4_vport_delete_els_xri_aborted() local
12026 if (sglq_entry->ndlp && sglq_entry->ndlp->vport == vport) { in lpfc_sli4_vport_delete_els_xri_aborted()
12027 lpfc_nlp_put(sglq_entry->ndlp); in lpfc_sli4_vport_delete_els_xri_aborted()
12028 ndlp = sglq_entry->ndlp; in lpfc_sli4_vport_delete_els_xri_aborted()
12029 sglq_entry->ndlp = NULL; in lpfc_sli4_vport_delete_els_xri_aborted()
12036 ndlp->nlp_DID == Fabric_DID) { in lpfc_sli4_vport_delete_els_xri_aborted()
12066 struct lpfc_nodelist *ndlp; in lpfc_sli4_els_xri_aborted() local
12076 ndlp = sglq_entry->ndlp; in lpfc_sli4_els_xri_aborted()
12077 sglq_entry->ndlp = NULL; in lpfc_sli4_els_xri_aborted()
12084 if (ndlp) { in lpfc_sli4_els_xri_aborted()
12085 lpfc_set_rrq_active(phba, ndlp, in lpfc_sli4_els_xri_aborted()
12088 lpfc_nlp_put(ndlp); in lpfc_sli4_els_xri_aborted()
12124 struct lpfc_nodelist *ndlp) in lpfc_sli_abts_recover_port() argument
12132 if (ndlp->nlp_state != NLP_STE_MAPPED_NODE) { in lpfc_sli_abts_recover_port()
12135 "rport in state 0x%x\n", ndlp->nlp_state); in lpfc_sli_abts_recover_port()
12142 shost->host_no, ndlp->nlp_DID, in lpfc_sli_abts_recover_port()
12143 vport->vpi, ndlp->nlp_rpi, ndlp->nlp_state, in lpfc_sli_abts_recover_port()
12144 ndlp->nlp_flag); in lpfc_sli_abts_recover_port()
12149 spin_lock_irqsave(&ndlp->lock, flags); in lpfc_sli_abts_recover_port()
12150 ndlp->nlp_fcp_info &= ~NLP_FCP_2_DEVICE; in lpfc_sli_abts_recover_port()
12151 ndlp->nlp_flag |= NLP_ISSUE_LOGO; in lpfc_sli_abts_recover_port()
12152 spin_unlock_irqrestore(&ndlp->lock, flags); in lpfc_sli_abts_recover_port()
12153 lpfc_unreg_rpi(vport, ndlp); in lpfc_sli_abts_recover_port()
12208 struct lpfc_nodelist *ndlp = cmdiocb->ndlp; in lpfc_cmpl_els_qfpa() local
12284 lpfc_nlp_put(ndlp); in lpfc_cmpl_els_qfpa()
12290 struct lpfc_nodelist *ndlp; in lpfc_issue_els_qfpa() local
12295 ndlp = lpfc_findnode_did(phba->pport, Fabric_DID); in lpfc_issue_els_qfpa()
12296 if (!ndlp || ndlp->nlp_state != NLP_STE_UNMAPPED_NODE) in lpfc_issue_els_qfpa()
12299 elsiocb = lpfc_prep_els_iocb(vport, 1, LPFC_QFPA_SIZE, 2, ndlp, in lpfc_issue_els_qfpa()
12300 ndlp->nlp_DID, ELS_CMD_QFPA); in lpfc_issue_els_qfpa()
12311 elsiocb->ndlp = lpfc_nlp_get(ndlp); in lpfc_issue_els_qfpa()
12312 if (!elsiocb->ndlp) { in lpfc_issue_els_qfpa()
12320 lpfc_nlp_put(ndlp); in lpfc_issue_els_qfpa()
12332 struct lpfc_nodelist *ndlp; in lpfc_vmid_uvem() local
12340 ndlp = lpfc_findnode_did(vport, Fabric_DID); in lpfc_vmid_uvem()
12341 if (!ndlp || ndlp->nlp_state != NLP_STE_UNMAPPED_NODE) in lpfc_vmid_uvem()
12348 ndlp, Fabric_DID, ELS_CMD_UVEM); in lpfc_vmid_uvem()
12356 vmid_context->nlp = ndlp; in lpfc_vmid_uvem()
12395 elsiocb->ndlp = lpfc_nlp_get(ndlp); in lpfc_vmid_uvem()
12396 if (!elsiocb->ndlp) { in lpfc_vmid_uvem()
12404 lpfc_nlp_put(ndlp); in lpfc_vmid_uvem()
12422 struct lpfc_nodelist *ndlp = icmdiocb->ndlp; in lpfc_cmpl_els_uvem() local
12431 if (!ndlp || ndlp->nlp_state != NLP_STE_UNMAPPED_NODE) in lpfc_cmpl_els_uvem()
12432 ndlp = NULL; in lpfc_cmpl_els_uvem()
12466 lpfc_nlp_put(ndlp); in lpfc_cmpl_els_uvem()