• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/scsi/lpfc/

Lines Matching refs:ndlp

51 				struct lpfc_nodelist *ndlp, uint8_t retry);
125 * @ndlp: pointer to a node-list data structure.
139 * ndlp is incremented by 1 and the reference to the ndlp is put into
140 * context1 of the IOCB data structure for this IOCB to hold the ndlp
150 struct lpfc_nodelist *ndlp, uint32_t did,
274 /* prevent preparing iocb with NULL ndlp reference */
275 elsiocb->context1 = lpfc_nlp_get(ndlp);
299 elscmd, ndlp->nlp_DID, elsiocb->iotag,
324 * active ndlp node with Fabric_DID must already exist for this @vport.
341 struct lpfc_nodelist *ndlp;
347 ndlp = lpfc_findnode_did(vport, Fabric_DID);
348 if (!ndlp || !NLP_CHK_NODE_ACT(ndlp)) {
383 /* increment the reference count on ndlp to hold reference
386 mbox->context2 = lpfc_nlp_get(ndlp);
397 /* decrement the reference count on ndlp just incremented
400 lpfc_nlp_put(ndlp);
430 struct lpfc_nodelist *ndlp;
436 ndlp = lpfc_findnode_did(vport, Fabric_DID);
437 if (!ndlp || !NLP_CHK_NODE_ACT(ndlp)) {
486 * @ndlp: pointer to a node-list data structure.
492 * port in a fabric topology. It properly sets up the parameters to the @ndlp
504 lpfc_cmpl_els_flogi_fabric(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
535 memcpy(&ndlp->nlp_portname, &sp->portName, sizeof(struct lpfc_name));
536 memcpy(&ndlp->nlp_nodename, &sp->nodeName, sizeof(struct lpfc_name));
537 ndlp->nlp_class_sup = 0;
539 ndlp->nlp_class_sup |= FC_COS_CLASS1;
541 ndlp->nlp_class_sup |= FC_COS_CLASS2;
543 ndlp->nlp_class_sup |= FC_COS_CLASS3;
545 ndlp->nlp_class_sup |= FC_COS_CLASS4;
546 ndlp->nlp_maxframe = ((sp->cmn.bbRcvSizeMsb & 0x0F) << 8) |
609 lpfc_register_new_vport(phba, vport, ndlp);
614 lpfc_nlp_set_state(vport, ndlp, NLP_STE_REG_LOGIN_ISSUE);
617 lpfc_register_new_vport(phba, vport, ndlp);
621 ndlp->nlp_type |= NLP_FABRIC;
622 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE);
637 * @ndlp: pointer to a node-list data structure.
655 lpfc_cmpl_els_flogi_nport(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
699 /* Decrement ndlp reference count indicating that ndlp can be
702 lpfc_nlp_put(ndlp);
704 ndlp = lpfc_findnode_did(vport, PT2PT_RemoteID);
705 if (!ndlp) {
707 * Cannot find existing Fabric ndlp, so allocate a
710 ndlp = mempool_alloc(phba->nlp_mem_pool, GFP_KERNEL);
711 if (!ndlp)
713 lpfc_nlp_init(vport, ndlp, PT2PT_RemoteID);
714 } else if (!NLP_CHK_NODE_ACT(ndlp)) {
715 ndlp = lpfc_enable_node(vport, ndlp,
717 if(!ndlp)
721 memcpy(&ndlp->nlp_portname, &sp->portName,
723 memcpy(&ndlp->nlp_nodename, &sp->nodeName,
725 /* Set state will put ndlp onto node list if not already done */
726 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE);
728 ndlp->nlp_flag |= NLP_NPR_2B_DISC;
731 /* This side will wait for the PLOGI, decrement ndlp reference
732 * count indicating that ndlp can be released when other
735 lpfc_nlp_put(ndlp);
763 * number of retries), one additional decrement of ndlp reference shall be
766 * invoke one decrement of ndlp reference count). If no error reported in
781 struct lpfc_nodelist *ndlp = cmdiocb->context1;
792 lpfc_nlp_put(ndlp);
911 rc = lpfc_cmpl_els_flogi_fabric(vport, ndlp, sp, irsp);
913 rc = lpfc_cmpl_els_flogi_nport(vport, ndlp, sp);
939 lpfc_nlp_put(ndlp);
963 lpfc_nlp_put(ndlp);
985 * @ndlp: pointer to a node-list data structure.
995 * Note that, in lpfc_prep_els_iocb() routine, the reference count of ndlp
996 * will be incremented by 1 for holding the ndlp and the reference to ndlp
1005 lpfc_issue_els_flogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
1021 elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, retry, ndlp,
1022 ndlp->nlp_DID, ELS_CMD_FLOGI);
1092 * contains a active Fabric_DID ndlp. Note that this function is to issue
1104 struct lpfc_nodelist *ndlp;
1123 ndlp = (struct lpfc_nodelist *)(iocb->context1);
1124 if (ndlp && NLP_CHK_NODE_ACT(ndlp) &&
1125 (ndlp->nlp_DID == Fabric_DID))
1139 * specified. It first searches the ndlp with the Fabric_DID (0xfffffe) from
1140 * the @vport's ndlp list. If no such ndlp found, it will create an ndlp and
1141 * put it into the @vport's ndlp list. If an inactive ndlp found on the list,
1143 * is then invoked with the @vport and the ndlp to perform the FLOGI for the
1154 struct lpfc_nodelist *ndlp;
1159 /* First look for the Fabric ndlp */
1160 ndlp = lpfc_findnode_did(vport, Fabric_DID);
1161 if (!ndlp) {
1162 /* Cannot find existing Fabric ndlp, so allocate a new one */
1163 ndlp = mempool_alloc(phba->nlp_mem_pool, GFP_KERNEL);
1164 if (!ndlp)
1166 lpfc_nlp_init(vport, ndlp, Fabric_DID);
1168 ndlp->nlp_type |= NLP_FABRIC;
1169 /* Put ndlp onto node list */
1170 lpfc_enqueue_node(vport, ndlp);
1171 } else if (!NLP_CHK_NODE_ACT(ndlp)) {
1172 /* re-setup ndlp without removing from node list */
1173 ndlp = lpfc_enable_node(vport, ndlp, NLP_STE_UNUSED_NODE);
1174 if (!ndlp)
1178 if (lpfc_issue_els_flogi(vport, ndlp, 0))
1182 lpfc_nlp_put(ndlp);
1192 * specified. It first searches the ndlp with the Fabric_DID (0xfffffe) from
1193 * the @vport's ndlp list. If no such ndlp found, it will create an ndlp and
1194 * put it into the @vport's ndlp list. If an inactive ndlp found on the list,
1196 * is then invoked with the @vport and the ndlp to perform the FDISC for the
1207 struct lpfc_nodelist *ndlp;
1209 /* First look for the Fabric ndlp */
1210 ndlp = lpfc_findnode_did(vport, Fabric_DID);
1211 if (!ndlp) {
1212 /* Cannot find existing Fabric ndlp, so allocate a new one */
1213 ndlp = mempool_alloc(phba->nlp_mem_pool, GFP_KERNEL);
1214 if (!ndlp)
1216 lpfc_nlp_init(vport, ndlp, Fabric_DID);
1217 /* Put ndlp onto node list */
1218 lpfc_enqueue_node(vport, ndlp);
1219 } else if (!NLP_CHK_NODE_ACT(ndlp)) {
1220 /* re-setup ndlp without removing from node list */
1221 ndlp = lpfc_enable_node(vport, ndlp, NLP_STE_UNUSED_NODE);
1222 if (!ndlp)
1226 if (lpfc_issue_els_fdisc(vport, ndlp, 0)) {
1230 lpfc_nlp_put(ndlp);
1270 * lpfc_plogi_confirm_nport - Confirm pologi wwpn matches stored ndlp
1273 * @ndlp: pointer to a node-list data structure.
1276 * from a PLOGI, matches the WWPN that is stored in the @ndlp for that N_POrt.
1278 * 1) The N_Port is a Fabric ndlp; 2) The @ndlp is on vport list and matches
1279 * the WWPN of the N_Port logged into; 3) The @ndlp is not on vport list but
1281 * pointer to the @ndlp will be returned. If the WWPN is not confirmed:
1282 * 1) if there is a node on vport list other than the @ndlp with the same
1287 * parameters of the @ndlp shall be copied to the new_ndlp, the @ndlp shall
1291 * Note that before the @ndlp got "released", the keepDID from not-matching
1293 * of the @ndlp. This is because the release of @ndlp is actually to put it
1298 * pointer to the PLOGI N_Port @ndlp
1302 struct lpfc_nodelist *ndlp)
1304 struct lpfc_vport *vport = ndlp->vport;
1315 * by WWPN. Just return the ndlp that was given to us.
1317 if (ndlp->nlp_type & NLP_FABRIC)
1318 return ndlp;
1324 * we have for that ndlp. If not, we have some work to do.
1328 if (new_ndlp == ndlp && NLP_CHK_NODE_ACT(new_ndlp))
1329 return ndlp;
1332 rc = memcmp(&ndlp->nlp_portname, name,
1335 return ndlp;
1338 return ndlp;
1339 lpfc_nlp_init(vport, new_ndlp, ndlp->nlp_DID);
1341 rc = memcmp(&ndlp->nlp_portname, name,
1344 return ndlp;
1348 return ndlp;
1354 new_ndlp->nlp_DID = ndlp->nlp_DID;
1355 new_ndlp->nlp_prev_state = ndlp->nlp_prev_state;
1357 if (ndlp->nlp_flag & NLP_NPR_2B_DISC)
1359 ndlp->nlp_flag &= ~NLP_NPR_2B_DISC;
1362 lpfc_nlp_set_state(vport, new_ndlp, ndlp->nlp_state);
1365 if (memcmp(&ndlp->nlp_portname, name, sizeof(struct lpfc_name)) == 0) {
1366 /* The new_ndlp is replacing ndlp totally, so we need
1367 * to put ndlp on UNUSED list and try to free it.
1371 rport = ndlp->rport;
1374 if (rdata->pnode == ndlp) {
1375 lpfc_nlp_put(ndlp);
1376 ndlp->rport = NULL;
1380 new_ndlp->nlp_type = ndlp->nlp_type;
1382 /* We shall actually free the ndlp with both nlp_DID and
1383 * nlp_portname fields equals 0 to avoid any ndlp on the
1386 if (ndlp->nlp_DID == 0) {
1388 NLP_SET_FREE_REQ(ndlp);
1393 ndlp->nlp_DID = keepDID;
1394 lpfc_drop_node(vport, ndlp);
1397 lpfc_unreg_rpi(vport, ndlp);
1399 ndlp->nlp_DID = keepDID;
1400 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE);
1401 /* Since we are swapping the ndlp passed in with the new one
1405 memcpy(&new_ndlp->nlp_portname, &ndlp->nlp_portname,
1407 memcpy(&new_ndlp->nlp_nodename, &ndlp->nlp_nodename,
1409 new_ndlp->nlp_state = ndlp->nlp_state;
1411 rport = ndlp->rport;
1415 put_rport = ndlp->rport != NULL;
1417 ndlp->rport = NULL;
1419 lpfc_nlp_put(ndlp);
1467 * ndlp on the vport node list that matches the remote node ID from the
1468 * PLOGI reponse IOCB. If such ndlp does not exist, the PLOGI is simply
1473 * the ndlp and the NLP_EVT_CMPL_PLOGI state to the Discover State Machine
1486 struct lpfc_nodelist *ndlp;
1499 ndlp = lpfc_findnode_did(vport, irsp->un.elsreq64.remoteID);
1500 if (!ndlp || !NLP_CHK_NODE_ACT(ndlp)) {
1503 "with no ndlp. Data: x%x x%x x%x\n",
1510 /* Since ndlp can be freed in the disc state machine, note if this node
1514 disc = (ndlp->nlp_flag & NLP_NPR_2B_DISC);
1515 ndlp->nlp_flag &= ~NLP_NPR_2B_DISC;
1523 ndlp->nlp_DID, irsp->ulpStatus, irsp->un.ulpWord[4],
1528 ndlp->nlp_flag |= NLP_NPR_2B_DISC;
1533 /* ndlp could be freed in DSM, save these values now */
1534 type = ndlp->nlp_type;
1535 did = ndlp->nlp_DID;
1543 ndlp->nlp_flag |= NLP_NPR_2B_DISC;
1555 ndlp->nlp_DID, irsp->ulpStatus,
1561 rc = lpfc_disc_state_machine(vport, ndlp, cmdiocb,
1568 ndlp = lpfc_plogi_confirm_nport(phba, prsp->virt, ndlp);
1569 rc = lpfc_disc_state_machine(vport, ndlp, cmdiocb,
1600 * the ndlp with the remote N_Port DID must exist on the @vport's ndlp list.
1604 * Note that, in lpfc_prep_els_iocb() routine, the reference count of ndlp
1605 * will be incremented by 1 for holding the ndlp and the reference to ndlp
1619 struct lpfc_nodelist *ndlp;
1628 ndlp = lpfc_findnode_did(vport, did);
1629 if (ndlp && !NLP_CHK_NODE_ACT(ndlp))
1630 ndlp = NULL;
1632 /* If ndlp is not NULL, we will bump the reference count on it */
1634 elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, retry, ndlp, did,
1680 * ndlp to mark the PRLI completion.
1690 struct lpfc_nodelist *ndlp;
1697 ndlp = (struct lpfc_nodelist *) cmdiocb->context1;
1699 ndlp->nlp_flag &= ~NLP_PRLI_SND;
1705 ndlp->nlp_DID);
1710 ndlp->nlp_DID, irsp->ulpStatus, irsp->un.ulpWord[4],
1727 ndlp->nlp_DID, irsp->ulpStatus,
1733 lpfc_disc_state_machine(vport, ndlp, cmdiocb,
1737 lpfc_disc_state_machine(vport, ndlp, cmdiocb,
1747 * @ndlp: pointer to a node-list data structure.
1756 * Note that, in lpfc_prep_els_iocb() routine, the reference count of ndlp
1757 * will be incremented by 1 for holding the ndlp and the reference to ndlp
1766 lpfc_issue_els_prli(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
1778 elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, retry, ndlp,
1779 ndlp->nlp_DID, ELS_CMD_PRLI);
1811 ndlp->nlp_DID, 0, 0);
1816 ndlp->nlp_flag |= NLP_PRLI_SND;
1821 ndlp->nlp_flag &= ~NLP_PRLI_SND;
1964 struct lpfc_nodelist *ndlp;
1971 ndlp = (struct lpfc_nodelist *) cmdiocb->context1;
1976 ndlp->nlp_DID);
1978 /* Since ndlp can be freed in the disc state machine, note if this node
1982 disc = (ndlp->nlp_flag & NLP_NPR_2B_DISC);
1983 ndlp->nlp_flag &= ~(NLP_ADISC_SND | NLP_NPR_2B_DISC);
1989 ndlp->nlp_DID, irsp->ulpStatus, irsp->un.ulpWord[4],
1994 ndlp->nlp_flag |= NLP_NPR_2B_DISC;
2005 ndlp->nlp_flag |= NLP_NPR_2B_DISC;
2014 ndlp->nlp_DID, irsp->ulpStatus,
2018 lpfc_disc_state_machine(vport, ndlp, cmdiocb,
2022 lpfc_disc_state_machine(vport, ndlp, cmdiocb,
2036 * @ndlp: pointer to a node-list data structure.
2039 * This routine issues an Address Discover (ADISC) for an @ndlp on a
2041 * and states of the ndlp, and invokes the lpfc_sli_issue_iocb() routine
2044 * Note that, in lpfc_prep_els_iocb() routine, the reference count of ndlp
2045 * will be incremented by 1 for holding the ndlp and the reference to ndlp
2054 lpfc_issue_els_adisc(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
2066 elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, retry, ndlp,
2067 ndlp->nlp_DID, ELS_CMD_ADISC);
2087 ndlp->nlp_DID, 0, 0);
2092 ndlp->nlp_flag |= NLP_ADISC_SND;
2097 ndlp->nlp_flag &= ~NLP_ADISC_SND;
2113 * state machine of the associated ndlp shall be invoked for transition with
2121 struct lpfc_nodelist *ndlp = (struct lpfc_nodelist *) cmdiocb->context1;
2122 struct lpfc_vport *vport = ndlp->vport;
2133 ndlp->nlp_flag &= ~NLP_LOGO_SND;
2139 ndlp->nlp_DID);
2144 ndlp->nlp_DID, irsp->ulpStatus, irsp->un.ulpWord[4],
2150 if (ndlp->nlp_flag & NLP_TARGET_REMOVE) {
2154 lpfc_disc_state_machine(vport, ndlp, cmdiocb,
2167 ndlp->nlp_DID, irsp->ulpStatus,
2173 lpfc_disc_state_machine(vport, ndlp, cmdiocb,
2179 lpfc_disc_state_machine(vport, ndlp, cmdiocb,
2189 * @ndlp: pointer to a node-list data structure.
2193 * to a remote node, referred by an @ndlp on a @vport. It constructs the
2194 * payload of the IOCB, properly sets up the @ndlp state, and invokes the
2197 * Note that, in lpfc_prep_els_iocb() routine, the reference count of ndlp
2198 * will be incremented by 1 for holding the ndlp and the reference to ndlp
2207 lpfc_issue_els_logo(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
2219 if (ndlp->nlp_flag & NLP_LOGO_SND) {
2226 elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, retry, ndlp,
2227 ndlp->nlp_DID, ELS_CMD_LOGO);
2243 ndlp->nlp_DID, 0, 0);
2248 ndlp->nlp_flag |= NLP_LOGO_SND;
2254 ndlp->nlp_flag &= ~NLP_LOGO_SND;
2310 * first search the @vport node list to find the matching ndlp. If no such
2311 * ndlp is found, a new ndlp shall be created for this (SCR) purpose. An
2315 * Note that, in lpfc_prep_els_iocb() routine, the reference count of ndlp
2316 * will be incremented by 1 for holding the ndlp and the reference to ndlp
2333 struct lpfc_nodelist *ndlp;
2338 ndlp = lpfc_findnode_did(vport, nportid);
2339 if (!ndlp) {
2340 ndlp = mempool_alloc(phba->nlp_mem_pool, GFP_KERNEL);
2341 if (!ndlp)
2343 lpfc_nlp_init(vport, ndlp, nportid);
2344 lpfc_enqueue_node(vport, ndlp);
2345 } else if (!NLP_CHK_NODE_ACT(ndlp)) {
2346 ndlp = lpfc_enable_node(vport, ndlp, NLP_STE_UNUSED_NODE);
2347 if (!ndlp)
2351 elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, retry, ndlp,
2352 ndlp->nlp_DID, ELS_CMD_SCR);
2358 lpfc_nlp_put(ndlp);
2374 ndlp->nlp_DID, 0, 0);
2384 lpfc_nlp_put(ndlp);
2391 lpfc_nlp_put(ndlp);
2404 * the matching ndlp. If no such ndlp is found, a new ndlp shall be created
2408 * Note that, in lpfc_prep_els_iocb() routine, the reference count of ndlp
2409 * will be incremented by 1 for holding the ndlp and the reference to ndlp
2429 struct lpfc_nodelist *ndlp;
2434 ndlp = lpfc_findnode_did(vport, nportid);
2435 if (!ndlp) {
2436 ndlp = mempool_alloc(phba->nlp_mem_pool, GFP_KERNEL);
2437 if (!ndlp)
2439 lpfc_nlp_init(vport, ndlp, nportid);
2440 lpfc_enqueue_node(vport, ndlp);
2441 } else if (!NLP_CHK_NODE_ACT(ndlp)) {
2442 ndlp = lpfc_enable_node(vport, ndlp, NLP_STE_UNUSED_NODE);
2443 if (!ndlp)
2447 elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, retry, ndlp,
2448 ndlp->nlp_DID, ELS_CMD_RNID);
2453 lpfc_nlp_put(ndlp);
2484 ndlp->nlp_DID, 0, 0);
2494 lpfc_nlp_put(ndlp);
2501 lpfc_nlp_put(ndlp);
2511 * a @vport's @ndlp. It stops the timer for the delayed function retrial and
2561 * lpfc_els_retry_delay - Timer function with a ndlp delayed function timer
2562 * @ptr: holder for the pointer to the timer function associated data (ndlp).
2564 * This routine is invoked by the ndlp delayed-function timer to check
2570 * the work list to hold reference count of ndlp so that it guarantees the
2571 * reference to ndlp will still be available when the worker thread gets
2572 * to the event associated with the ndlp.
2577 struct lpfc_nodelist *ndlp = (struct lpfc_nodelist *) ptr;
2578 struct lpfc_vport *vport = ndlp->vport;
2581 struct lpfc_work_evt *evtp = &ndlp->els_retry_evt;
2592 evtp->evt_arg1 = lpfc_nlp_get(ndlp);
2603 * lpfc_els_retry_delay_handler - Work thread handler for ndlp delayed function
2604 * @ndlp: pointer to a node-list data structure.
2606 * This routine is the worker-thread handler for processing the @ndlp delayed
2608 * the last ELS command from the associated ndlp and invokes the proper ELS
2612 lpfc_els_retry_delay_handler(struct lpfc_nodelist *ndlp)
2614 struct lpfc_vport *vport = ndlp->vport;
2619 did = ndlp->nlp_DID;
2620 cmd = ndlp->nlp_last_elscmd;
2621 ndlp->nlp_last_elscmd = 0;
2623 if (!(ndlp->nlp_flag & NLP_DELAY_TMO)) {
2628 ndlp->nlp_flag &= ~NLP_DELAY_TMO;
2635 del_timer_sync(&ndlp->nlp_delayfunc);
2636 retry = ndlp->nlp_retry;
2637 ndlp->nlp_retry = 0;
2641 lpfc_issue_els_flogi(vport, ndlp, retry);
2644 if (!lpfc_issue_els_plogi(vport, ndlp->nlp_DID, retry)) {
2645 ndlp->nlp_prev_state = ndlp->nlp_state;
2646 lpfc_nlp_set_state(vport, ndlp, NLP_STE_PLOGI_ISSUE);
2650 if (!lpfc_issue_els_adisc(vport, ndlp, retry)) {
2651 ndlp->nlp_prev_state = ndlp->nlp_state;
2652 lpfc_nlp_set_state(vport, ndlp, NLP_STE_ADISC_ISSUE);
2656 if (!lpfc_issue_els_prli(vport, ndlp, retry)) {
2657 ndlp->nlp_prev_state = ndlp->nlp_state;
2658 lpfc_nlp_set_state(vport, ndlp, NLP_STE_PRLI_ISSUE);
2662 if (!lpfc_issue_els_logo(vport, ndlp, retry)) {
2663 ndlp->nlp_prev_state = ndlp->nlp_state;
2664 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE);
2668 lpfc_issue_els_fdisc(vport, ndlp, retry);
2688 * be posted to the ndlp delayed event and delayed function timer set to the
2689 * ndlp for the delayed command issusing.
2702 struct lpfc_nodelist *ndlp = (struct lpfc_nodelist *) cmdiocb->context1;
2721 if (ndlp && NLP_CHK_NODE_ACT(ndlp))
2722 did = ndlp->nlp_DID;
2726 ndlp = lpfc_findnode_did(vport, did);
2727 if ((!ndlp || !NLP_CHK_NODE_ACT(ndlp))
2734 *(((uint32_t *) irsp) + 7), irsp->un.ulpWord[4], ndlp->nlp_DID);
2954 if (ndlp && NLP_CHK_NODE_ACT(ndlp) && delay) {
2956 ndlp->nlp_retry = cmdiocb->retry;
2959 mod_timer(&ndlp->nlp_delayfunc,
2962 ndlp->nlp_flag |= NLP_DELAY_TMO;
2965 ndlp->nlp_prev_state = ndlp->nlp_state;
2967 lpfc_nlp_set_state(vport, ndlp,
2970 lpfc_nlp_set_state(vport, ndlp,
2972 ndlp->nlp_last_elscmd = cmd;
2978 lpfc_issue_els_flogi(vport, ndlp, cmdiocb->retry);
2981 lpfc_issue_els_fdisc(vport, ndlp, cmdiocb->retry);
2984 if (ndlp && NLP_CHK_NODE_ACT(ndlp)) {
2985 ndlp->nlp_prev_state = ndlp->nlp_state;
2986 lpfc_nlp_set_state(vport, ndlp,
2992 ndlp->nlp_prev_state = ndlp->nlp_state;
2993 lpfc_nlp_set_state(vport, ndlp, NLP_STE_ADISC_ISSUE);
2994 lpfc_issue_els_adisc(vport, ndlp, cmdiocb->retry);
2997 ndlp->nlp_prev_state = ndlp->nlp_state;
2998 lpfc_nlp_set_state(vport, ndlp, NLP_STE_PRLI_ISSUE);
2999 lpfc_issue_els_prli(vport, ndlp, cmdiocb->retry);
3002 ndlp->nlp_prev_state = ndlp->nlp_state;
3003 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE);
3004 lpfc_issue_els_logo(vport, ndlp, cmdiocb->retry);
3087 * context1 - reference to ndlp
3092 * It first properly decrements the reference count held on ndlp for the
3109 struct lpfc_nodelist *ndlp;
3111 ndlp = (struct lpfc_nodelist *)elsiocb->context1;
3112 if (ndlp) {
3113 if (ndlp->nlp_flag & NLP_DEFER_RM) {
3114 lpfc_nlp_put(ndlp);
3116 /* If the ndlp is not being used by another discovery
3119 if (!lpfc_nlp_not_used(ndlp)) {
3120 /* If ndlp is being used by another discovery
3123 ndlp->nlp_flag &= ~NLP_DEFER_RM;
3127 lpfc_nlp_put(ndlp);
3180 * release the ndlp if it has the last reference remaining (reference count
3181 * is 1). If succeeded (meaning ndlp released), it sets the IOCB context1
3183 * ndlp reference count needs to be decremented. Otherwise, the ndlp
3192 struct lpfc_nodelist *ndlp = (struct lpfc_nodelist *) cmdiocb->context1;
3199 irsp->ulpStatus, irsp->un.ulpWord[4], ndlp->nlp_DID);
3204 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state,
3205 ndlp->nlp_rpi);
3207 if (ndlp->nlp_state == NLP_STE_NPR_NODE) {
3209 if (!lpfc_nlp_not_used(ndlp)) {
3210 /* If the ndlp is being used by another discovery
3213 lpfc_unreg_rpi(vport, ndlp);
3233 * decrements the ndlp reference count held for this completion callback
3235 * whether there is only one reference left on the ndlp. If so, it will
3236 * perform one more decrement and trigger the release of the ndlp.
3242 struct lpfc_nodelist *ndlp = (struct lpfc_nodelist *) pmb->context2;
3256 if (ndlp && NLP_CHK_NODE_ACT(ndlp)) {
3257 lpfc_nlp_put(ndlp);
3259 * ndlp. If no other discovery threads are using this ndlp.
3262 lpfc_nlp_not_used(ndlp);
3276 * nlp_flag bitmap in the ndlp data structure, if the mbox command reference
3281 * routine shall be invoked trying to release the ndlp if no other threads
3288 struct lpfc_nodelist *ndlp = (struct lpfc_nodelist *) cmdiocb->context1;
3289 struct lpfc_vport *vport = ndlp ? ndlp->vport : NULL;
3303 * function can have cmdiocb->contest1 (ndlp) field set to NULL.
3306 if (ndlp && NLP_CHK_NODE_ACT(ndlp) &&
3311 if (!(ndlp->nlp_flag & NLP_RM_DFLT_RPI))
3316 if (!ndlp || !NLP_CHK_NODE_ACT(ndlp) || lpfc_els_chk_latt(vport)) {
3325 if (ndlp && NLP_CHK_NODE_ACT(ndlp) &&
3326 (ndlp->nlp_flag & NLP_RM_DFLT_RPI))
3327 if (lpfc_nlp_not_used(ndlp)) {
3328 ndlp = NULL;
3348 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state,
3349 ndlp->nlp_rpi);
3352 && (ndlp->nlp_flag & NLP_ACC_REGLOGIN)) {
3353 lpfc_unreg_rpi(vport, ndlp);
3354 /* Increment reference count to ndlp to hold the
3355 * reference to ndlp for the callback function.
3357 mbox->context2 = lpfc_nlp_get(ndlp);
3359 if (ndlp->nlp_flag & NLP_RM_DFLT_RPI) {
3365 ndlp->nlp_prev_state = ndlp->nlp_state;
3366 lpfc_nlp_set_state(vport, ndlp,
3373 /* Decrement the ndlp reference count we
3376 lpfc_nlp_put(ndlp);
3382 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state,
3383 ndlp->nlp_rpi);
3385 if (lpfc_nlp_not_used(ndlp)) {
3386 ndlp = NULL;
3396 ndlp->nlp_flag & NLP_ACC_REGLOGIN) {
3397 if (lpfc_nlp_not_used(ndlp)) {
3398 ndlp = NULL;
3416 if (ndlp && NLP_CHK_NODE_ACT(ndlp)) {
3418 ndlp->nlp_flag &= ~(NLP_ACC_REGLOGIN | NLP_RM_DFLT_RPI);
3427 if (lpfc_nlp_not_used(ndlp))
3444 * @ndlp: pointer to a node-list data structure.
3455 * Note that, in lpfc_prep_els_iocb() routine, the reference count of ndlp
3456 * will be incremented by 1 for holding the ndlp and the reference to ndlp
3466 struct lpfc_iocbq *oldiocb, struct lpfc_nodelist *ndlp,
3487 ndlp, ndlp->nlp_DID, ELS_CMD_ACC);
3490 ndlp->nlp_flag &= ~NLP_LOGO_ACC;
3503 ndlp->nlp_DID, ndlp->nlp_flag, 0);
3508 ndlp, ndlp->nlp_DID, ELS_CMD_ACC);
3525 ndlp->nlp_DID, ndlp->nlp_flag, 0);
3530 ndlp, ndlp->nlp_DID, ELS_CMD_PRLO);
3546 ndlp->nlp_DID, ndlp->nlp_flag, 0);
3556 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state,
3557 ndlp->nlp_rpi);
3558 if (ndlp->nlp_flag & NLP_LOGO_ACC) {
3560 ndlp->nlp_flag &= ~NLP_LOGO_ACC;
3581 * @ndlp: pointer to a node-list data structure.
3589 * Note that, in lpfc_prep_els_iocb() routine, the reference count of ndlp
3590 * will be incremented by 1 for holding the ndlp and the reference to ndlp
3600 struct lpfc_iocbq *oldiocb, struct lpfc_nodelist *ndlp,
3614 elsiocb = lpfc_prep_els_iocb(vport, 0, cmdsize, oldiocb->retry, ndlp,
3615 ndlp->nlp_DID, ELS_CMD_LS_RJT);
3637 elsiocb->iocb.ulpContext, ndlp->nlp_DID,
3638 ndlp->nlp_flag, ndlp->nlp_state, ndlp->nlp_rpi);
3641 ndlp->nlp_DID, ndlp->nlp_flag, rejectError);
3658 * @ndlp: pointer to a node-list data structure.
3664 * Note that, in lpfc_prep_els_iocb() routine, the reference count of ndlp
3665 * will be incremented by 1 for holding the ndlp and the reference to ndlp
3675 struct lpfc_nodelist *ndlp)
3686 elsiocb = lpfc_prep_els_iocb(vport, 0, cmdsize, oldiocb->retry, ndlp,
3687 ndlp->nlp_DID, ELS_CMD_ACC);
3700 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state,
3701 ndlp->nlp_rpi);
3715 ndlp->nlp_DID, ndlp->nlp_flag, 0);
3731 * @ndlp: pointer to a node-list data structure.
3737 * Note that, in lpfc_prep_els_iocb() routine, the reference count of ndlp
3738 * will be incremented by 1 for holding the ndlp and the reference to ndlp
3748 struct lpfc_nodelist *ndlp)
3764 elsiocb = lpfc_prep_els_iocb(vport, 0, cmdsize, oldiocb->retry, ndlp,
3765 ndlp->nlp_DID, (ELS_CMD_ACC | (ELS_CMD_PRLI & ~ELS_RSP_MASK)));
3777 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state,
3778 ndlp->nlp_rpi);
3793 if ((ndlp->nlp_type & NLP_FCP_TARGET) &&
3810 ndlp->nlp_DID, ndlp->nlp_flag, 0);
3828 * @ndlp: pointer to a node-list data structure.
3833 * issue the response. Note that this command does not need to hold the ndlp
3834 * reference count for the callback. So, the ndlp reference count taken by
3837 * there is no ndlp reference available.
3839 * Note that, in lpfc_prep_els_iocb() routine, the reference count of ndlp
3840 * will be incremented by 1 for holding the ndlp and the reference to ndlp
3851 struct lpfc_iocbq *oldiocb, struct lpfc_nodelist *ndlp)
3868 elsiocb = lpfc_prep_els_iocb(vport, 0, cmdsize, oldiocb->retry, ndlp,
3869 ndlp->nlp_DID, ELS_CMD_ACC);
3910 ndlp->nlp_DID, ndlp->nlp_flag, 0);
3914 lpfc_nlp_put(ndlp);
3915 elsiocb->context1 = NULL; /* Don't need ndlp for cmpl,
3949 struct lpfc_nodelist *ndlp, *next_ndlp;
3953 list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, nlp_listp) {
3954 if (!NLP_CHK_NODE_ACT(ndlp))
3956 if (ndlp->nlp_state == NLP_STE_NPR_NODE &&
3957 (ndlp->nlp_flag & NLP_NPR_2B_DISC) != 0 &&
3958 (ndlp->nlp_flag & NLP_NPR_ADISC) != 0) {
3960 ndlp->nlp_flag &= ~NLP_NPR_ADISC;
3962 ndlp->nlp_prev_state = ndlp->nlp_state;
3963 lpfc_nlp_set_state(vport, ndlp, NLP_STE_ADISC_ISSUE);
3964 lpfc_issue_els_adisc(vport, ndlp, 0);
4007 struct lpfc_nodelist *ndlp, *next_ndlp;
4011 list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, nlp_listp) {
4012 if (!NLP_CHK_NODE_ACT(ndlp))
4014 if (ndlp->nlp_state == NLP_STE_NPR_NODE &&
4015 (ndlp->nlp_flag & NLP_NPR_2B_DISC) != 0 &&
4016 (ndlp->nlp_flag & NLP_DELAY_TMO) == 0 &&
4017 (ndlp->nlp_flag & NLP_NPR_ADISC) == 0) {
4018 ndlp->nlp_prev_state = ndlp->nlp_state;
4019 lpfc_nlp_set_state(vport, ndlp, NLP_STE_PLOGI_ISSUE);
4020 lpfc_issue_els_plogi(vport, ndlp->nlp_DID, 0);
4173 struct lpfc_nodelist *ndlp = NULL;
4176 list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) {
4177 if (!NLP_CHK_NODE_ACT(ndlp) ||
4178 (ndlp->nlp_state == NLP_STE_UNUSED_NODE) ||
4179 !lpfc_rscn_payload_check(vport, ndlp->nlp_DID))
4181 lpfc_disc_state_machine(vport, ndlp, NULL,
4183 lpfc_cancel_retry_delay_tmo(vport, ndlp);
4235 * @ndlp: pointer to a node-list data structure.
4255 struct lpfc_nodelist *ndlp)
4292 ndlp->nlp_DID, vport->port_state, ndlp->nlp_flag);
4294 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL);
4322 ndlp->nlp_DID, vport->port_state,
4323 ndlp->nlp_flag);
4326 ndlp, NULL);
4337 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL);
4351 ndlp->nlp_DID, vport->port_state, ndlp->nlp_flag);
4396 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL);
4406 ndlp->nlp_DID, vport->port_state, ndlp->nlp_flag);
4421 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL);
4432 * (RSCN) for a @vport. If login to NameServer does not exist, a new ndlp shall
4434 * if the ndlp to NameServer exists, a Common Transport (CT) command to the
4446 struct lpfc_nodelist *ndlp;
4468 ndlp = lpfc_findnode_did(vport, NameServer_DID);
4469 if (ndlp && NLP_CHK_NODE_ACT(ndlp)
4470 && ndlp->nlp_state == NLP_STE_UNMAPPED_NODE) {
4471 /* Good ndlp, issue CT Request to NameServer */
4479 ndlp = lpfc_findnode_did(vport, NameServer_DID);
4480 if (ndlp && NLP_CHK_NODE_ACT(ndlp))
4485 if (ndlp) {
4486 ndlp = lpfc_enable_node(vport, ndlp,
4488 if (!ndlp) {
4492 ndlp->nlp_prev_state = NLP_STE_UNUSED_NODE;
4494 ndlp = mempool_alloc(phba->nlp_mem_pool, GFP_KERNEL);
4495 if (!ndlp) {
4499 lpfc_nlp_init(vport, ndlp, NameServer_DID);
4500 ndlp->nlp_prev_state = ndlp->nlp_state;
4501 lpfc_nlp_set_state(vport, ndlp, NLP_STE_PLOGI_ISSUE);
4503 ndlp->nlp_type |= NLP_FABRIC;
4519 * @ndlp: pointer to a node-list data structure.
4542 struct lpfc_nodelist *ndlp)
4577 if ((lpfc_check_sparm(vport, ndlp, sp, CLASS3, 1))) {
4618 lpfc_els_rsp_reject(vport, stat.un.lsRjtError, cmdiocb, ndlp,
4624 lpfc_els_rsp_acc(vport, ELS_CMD_PLOGI, cmdiocb, ndlp, NULL);
4633 * @ndlp: pointer to a node-list data structure.
4647 struct lpfc_nodelist *ndlp)
4670 lpfc_els_rsp_rnid_acc(vport, rn->Format, cmdiocb, ndlp);
4678 lpfc_els_rsp_reject(vport, stat.un.lsRjtError, cmdiocb, ndlp,
4688 * @ndlp: pointer to a node-list data structure.
4699 struct lpfc_nodelist *ndlp)
4708 lpfc_els_rsp_reject(vport, stat.un.lsRjtError, cmdiocb, ndlp, NULL);
4716 * @ndlp: pointer to a node-list data structure.
4730 struct lpfc_nodelist *ndlp)
4732 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL);
4748 * Note that, in lpfc_prep_els_iocb() routine, the reference count of ndlp
4749 * will be incremented by 1 for holding the ndlp and the reference to ndlp
4762 struct lpfc_nodelist *ndlp;
4768 ndlp = (struct lpfc_nodelist *) pmb->context2;
4781 lpfc_max_els_tries, ndlp,
4782 ndlp->nlp_DID, ELS_CMD_ACC);
4784 /* Decrement the ndlp reference count from previous mbox command */
4785 lpfc_nlp_put(ndlp);
4814 lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_ELS,
4818 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state,
4819 ndlp->nlp_rpi);
4831 * @ndlp: pointer to a node-list data structure.
4847 struct lpfc_nodelist *ndlp)
4857 if ((ndlp->nlp_state != NLP_STE_UNMAPPED_NODE) &&
4858 (ndlp->nlp_state != NLP_STE_MAPPED_NODE))
4879 mbox->context2 = lpfc_nlp_get(ndlp);
4889 lpfc_nlp_put(ndlp);
4900 lpfc_els_rsp_reject(vport, stat.un.lsRjtError, cmdiocb, ndlp, NULL);
4909 * @ndlp: pointer to a node-list data structure.
4914 * Note that, in lpfc_prep_els_iocb() routine, the reference count of ndlp
4915 * will be incremented by 1 for holding the ndlp and the reference to ndlp
4925 struct lpfc_iocbq *oldiocb, struct lpfc_nodelist *ndlp)
4933 elsiocb = lpfc_prep_els_iocb(vport, 0, cmdsize, oldiocb->retry, ndlp,
4934 ndlp->nlp_DID, ELS_CMD_ACC);
4963 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state,
4964 ndlp->nlp_rpi);
4979 * @ndlp: pointer to a node-list data structure.
4993 struct lpfc_nodelist *ndlp)
5002 if ((ndlp->nlp_state != NLP_STE_UNMAPPED_NODE) &&
5003 (ndlp->nlp_state != NLP_STE_MAPPED_NODE)) {
5009 lpfc_els_rsp_reject(vport, stat.un.lsRjtError, cmdiocb, ndlp,
5029 lpfc_els_rsp_rpl_acc(vport, cmdsize, cmdiocb, ndlp);
5038 * @ndlp: pointer to a node-list data structure.
5060 struct lpfc_nodelist *ndlp)
5099 if ((ndlp->nlp_state == NLP_STE_UNMAPPED_NODE) ||
5100 (ndlp->nlp_state == NLP_STE_MAPPED_NODE)) {
5103 ndlp->nlp_prev_state = ndlp->nlp_state;
5104 lpfc_nlp_set_state(vport, ndlp,
5106 lpfc_issue_els_plogi(vport, ndlp->nlp_DID, 0);
5121 * @ndlp: pointer to a node-list data structure.
5133 struct lpfc_nodelist *ndlp)
5150 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL);
5300 struct lpfc_nodelist *ndlp;
5301 ndlp = __lpfc_findnode_rpi(vport, cmd->ulpContext);
5302 if (ndlp && NLP_CHK_NODE_ACT(ndlp))
5303 remote_ID = ndlp->nlp_DID;
5471 struct lpfc_nodelist *ndlp;
5474 ndlp = cmdiocbp->context1;
5475 if (!ndlp || !NLP_CHK_NODE_ACT(ndlp))
5481 memcpy(lsrjt_event.header.wwpn, &ndlp->nlp_portname,
5483 memcpy(lsrjt_event.header.wwnn, &ndlp->nlp_nodename,
5505 memcpy(fabric_event.wwpn, &ndlp->nlp_portname,
5507 memcpy(fabric_event.wwnn, &ndlp->nlp_nodename,
5522 * @ndlp: Pointer FC node object.
5530 struct lpfc_nodelist *ndlp,
5577 memcpy(els_data->wwpn, &ndlp->nlp_portname, sizeof(struct lpfc_name));
5578 memcpy(els_data->wwnn, &ndlp->nlp_nodename, sizeof(struct lpfc_name));
5607 * event. It first determines whether there is an existing ndlp that matches
5618 struct lpfc_nodelist *ndlp;
5649 ndlp = lpfc_findnode_did(vport, did);
5650 if (!ndlp) {
5651 /* Cannot find existing Fabric ndlp, so allocate a new one */
5652 ndlp = mempool_alloc(phba->nlp_mem_pool, GFP_KERNEL);
5653 if (!ndlp)
5656 lpfc_nlp_init(vport, ndlp, did);
5657 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE);
5660 ndlp->nlp_type |= NLP_FABRIC;
5661 } else if (!NLP_CHK_NODE_ACT(ndlp)) {
5662 ndlp = lpfc_enable_node(vport, ndlp,
5664 if (!ndlp)
5666 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE);
5669 ndlp->nlp_type |= NLP_FABRIC;
5670 } else if (ndlp->nlp_state == NLP_STE_UNUSED_NODE) {
5672 ndlp = lpfc_nlp_get(ndlp);
5673 if (!ndlp)
5675 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE);
5681 elsiocb->context1 = lpfc_nlp_get(ndlp);
5695 did, vport->port_state, ndlp->nlp_flag);
5698 ndlp = lpfc_plogi_confirm_nport(phba, payload, ndlp);
5700 lpfc_send_els_event(vport, ndlp, payload);
5715 ndlp->nlp_flag &= ~NLP_TARGET_REMOVE;
5718 lpfc_disc_state_machine(vport, ndlp, elsiocb,
5725 did, vport->port_state, ndlp->nlp_flag);
5728 lpfc_els_rcv_flogi(vport, elsiocb, ndlp);
5730 lpfc_nlp_put(ndlp);
5735 did, vport->port_state, ndlp->nlp_flag);
5738 lpfc_send_els_event(vport, ndlp, payload);
5743 lpfc_disc_state_machine(vport, ndlp, elsiocb, NLP_EVT_RCV_LOGO);
5748 did, vport->port_state, ndlp->nlp_flag);
5751 lpfc_send_els_event(vport, ndlp, payload);
5756 lpfc_disc_state_machine(vport, ndlp, elsiocb, NLP_EVT_RCV_PRLO);
5760 lpfc_els_rcv_rscn(vport, elsiocb, ndlp);
5762 lpfc_nlp_put(ndlp);
5767 did, vport->port_state, ndlp->nlp_flag);
5769 lpfc_send_els_event(vport, ndlp, payload);
5775 lpfc_disc_state_machine(vport, ndlp, elsiocb,
5781 did, vport->port_state, ndlp->nlp_flag);
5788 lpfc_disc_state_machine(vport, ndlp, elsiocb,
5794 did, vport->port_state, ndlp->nlp_flag);
5797 lpfc_els_rcv_farpr(vport, elsiocb, ndlp);
5802 did, vport->port_state, ndlp->nlp_flag);
5805 lpfc_els_rcv_farp(vport, elsiocb, ndlp);
5810 did, vport->port_state, ndlp->nlp_flag);
5813 lpfc_els_rcv_fan(vport, elsiocb, ndlp);
5818 did, vport->port_state, ndlp->nlp_flag);
5825 lpfc_disc_state_machine(vport, ndlp, elsiocb, NLP_EVT_RCV_PRLI);
5830 did, vport->port_state, ndlp->nlp_flag);
5833 lpfc_els_rcv_lirr(vport, elsiocb, ndlp);
5835 lpfc_nlp_put(ndlp);
5840 did, vport->port_state, ndlp->nlp_flag);
5843 lpfc_els_rcv_rps(vport, elsiocb, ndlp);
5845 lpfc_nlp_put(ndlp);
5850 did, vport->port_state, ndlp->nlp_flag);
5853 lpfc_els_rcv_rpl(vport, elsiocb, ndlp);
5855 lpfc_nlp_put(ndlp);
5860 did, vport->port_state, ndlp->nlp_flag);
5863 lpfc_els_rcv_rnid(vport, elsiocb, ndlp);
5865 lpfc_nlp_put(ndlp);
5870 did, vport->port_state, ndlp->nlp_flag);
5873 lpfc_els_rcv_rrq(vport, elsiocb, ndlp);
5875 lpfc_nlp_put(ndlp);
5890 lpfc_nlp_put(ndlp);
5899 lpfc_els_rsp_reject(vport, stat.un.lsRjtError, elsiocb, ndlp,
6040 * ndlp for the Name Server associated to the @vport if such node does
6049 struct lpfc_nodelist *ndlp, *ndlp_fdmi;
6051 ndlp = lpfc_findnode_did(vport, NameServer_DID);
6052 if (!ndlp) {
6053 ndlp = mempool_alloc(phba->nlp_mem_pool, GFP_KERNEL);
6054 if (!ndlp) {
6064 lpfc_nlp_init(vport, ndlp, NameServer_DID);
6065 } else if (!NLP_CHK_NODE_ACT(ndlp)) {
6066 ndlp = lpfc_enable_node(vport, ndlp, NLP_STE_UNUSED_NODE);
6067 if (!ndlp) {
6078 ndlp->nlp_type |= NLP_FABRIC;
6080 lpfc_nlp_set_state(vport, ndlp, NLP_STE_PLOGI_ISSUE);
6082 if (lpfc_issue_els_plogi(vport, ndlp->nlp_DID, 0)) {
6121 struct lpfc_nodelist *ndlp = (struct lpfc_nodelist *) pmb->context2;
6165 lpfc_nlp_put(ndlp);
6202 /* Now, we decrement the ndlp reference count held for this
6205 lpfc_nlp_put(ndlp);
6215 * @ndlp: pointer to a node-list data structure.
6222 struct lpfc_nodelist *ndlp)
6231 mbox->context2 = lpfc_nlp_get(ndlp);
6235 /* mailbox command not success, decrement ndlp
6238 lpfc_nlp_put(ndlp);
6270 struct lpfc_nodelist *ndlp;
6283 ndlp = lpfc_findnode_did(vports[i], Fabric_DID);
6284 if (ndlp)
6285 lpfc_cancel_retry_delay_tmo(vports[i], ndlp);
6303 struct lpfc_nodelist *ndlp;
6310 ndlp = lpfc_findnode_did(phba->pport, Fabric_DID);
6311 if (!ndlp)
6315 mod_timer(&ndlp->nlp_delayfunc, jiffies + HZ);
6317 ndlp->nlp_flag |= NLP_DELAY_TMO;
6319 ndlp->nlp_last_elscmd = ELS_CMD_FLOGI;
6372 struct lpfc_nodelist *ndlp = (struct lpfc_nodelist *) cmdiocb->context1;
6428 if (!NLP_CHK_NODE_ACT(ndlp) ||
6452 lpfc_register_new_vport(phba, vport, ndlp);
6459 lpfc_register_new_vport(phba, vport, ndlp);
6467 lpfc_nlp_put(ndlp);
6475 * @ndlp: pointer to a node-list data structure.
6479 * a remote node (@ndlp) off a @vport. It uses the lpfc_issue_fabric_iocb()
6483 * Note that, in lpfc_prep_els_iocb() routine, the reference count of ndlp
6484 * will be incremented by 1 for holding the ndlp and the reference to ndlp
6493 lpfc_issue_els_fdisc(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
6502 int did = ndlp->nlp_DID;
6507 elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, retry, ndlp, did,
6582 * reference count held on ndlp for this completion function, indicating that
6583 * the reference to the ndlp is no long needed. Note that the
6584 * lpfc_els_free_iocb() routine decrements the ndlp reference held for this
6585 * callback function and an additional explicit ndlp reference decrementation
6586 * will trigger the actual release of the ndlp.
6594 struct lpfc_nodelist *ndlp;
6595 ndlp = (struct lpfc_nodelist *)cmdiocb->context1;
6605 /* Trigger the release of the ndlp after logo */
6606 lpfc_nlp_put(ndlp);
6612 * @ndlp: pointer to a node-list data structure.
6614 * This routine issues a LOGO ELS command to an @ndlp off a @vport.
6616 * Note that, in lpfc_prep_els_iocb() routine, the reference count of ndlp
6617 * will be incremented by 1 for holding the ndlp and the reference to ndlp
6626 lpfc_issue_els_npiv_logo(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp)
6636 elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, 0, ndlp, ndlp->nlp_DID,
6653 ndlp->nlp_DID, ndlp->nlp_flag, 0);
6657 ndlp->nlp_flag |= NLP_LOGO_SND;
6662 ndlp->nlp_flag &= ~NLP_LOGO_SND;
6958 * lpfc_fabric_abort_nport - Abort a ndlp's iocbs from driver fabric iocb list
6959 * @ndlp: pointer to a node-list data structure.
6961 * This routine aborts all the IOCBs associated with an @ndlp from the
6964 * list, removes each IOCB associated with the @ndlp off the list, set the
6968 void lpfc_fabric_abort_nport(struct lpfc_nodelist *ndlp)
6971 struct lpfc_hba *phba = ndlp->phba;
6978 if ((lpfc_check_sli_ndlp(phba, pring, piocb, ndlp))) {