aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_els.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_els.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_els.c32
1 files changed, 25 insertions, 7 deletions
diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
index d54ae199979..3c624a5494a 100644
--- a/drivers/scsi/lpfc/lpfc_els.c
+++ b/drivers/scsi/lpfc/lpfc_els.c
@@ -1476,6 +1476,10 @@ lpfc_plogi_confirm_nport(struct lpfc_hba *phba, uint32_t *prsp,
1476 return ndlp; 1476 return ndlp;
1477 memset(&rrq.xri_bitmap, 0, sizeof(new_ndlp->active_rrqs.xri_bitmap)); 1477 memset(&rrq.xri_bitmap, 0, sizeof(new_ndlp->active_rrqs.xri_bitmap));
1478 1478
1479 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
1480 "3178 PLOGI confirm: ndlp %p x%x: new_ndlp %p\n",
1481 ndlp, ndlp->nlp_DID, new_ndlp);
1482
1479 if (!new_ndlp) { 1483 if (!new_ndlp) {
1480 rc = memcmp(&ndlp->nlp_portname, name, 1484 rc = memcmp(&ndlp->nlp_portname, name,
1481 sizeof(struct lpfc_name)); 1485 sizeof(struct lpfc_name));
@@ -1527,6 +1531,9 @@ lpfc_plogi_confirm_nport(struct lpfc_hba *phba, uint32_t *prsp,
1527 /* The new_ndlp is replacing ndlp totally, so we need 1531 /* The new_ndlp is replacing ndlp totally, so we need
1528 * to put ndlp on UNUSED list and try to free it. 1532 * to put ndlp on UNUSED list and try to free it.
1529 */ 1533 */
1534 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
1535 "3179 PLOGI confirm NEW: %x %x\n",
1536 new_ndlp->nlp_DID, keepDID);
1530 1537
1531 /* Fix up the rport accordingly */ 1538 /* Fix up the rport accordingly */
1532 rport = ndlp->rport; 1539 rport = ndlp->rport;
@@ -1559,23 +1566,34 @@ lpfc_plogi_confirm_nport(struct lpfc_hba *phba, uint32_t *prsp,
1559 lpfc_drop_node(vport, ndlp); 1566 lpfc_drop_node(vport, ndlp);
1560 } 1567 }
1561 else { 1568 else {
1569 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
1570 "3180 PLOGI confirm SWAP: %x %x\n",
1571 new_ndlp->nlp_DID, keepDID);
1572
1562 lpfc_unreg_rpi(vport, ndlp); 1573 lpfc_unreg_rpi(vport, ndlp);
1574
1563 /* Two ndlps cannot have the same did */ 1575 /* Two ndlps cannot have the same did */
1564 ndlp->nlp_DID = keepDID; 1576 ndlp->nlp_DID = keepDID;
1565 if (phba->sli_rev == LPFC_SLI_REV4) 1577 if (phba->sli_rev == LPFC_SLI_REV4)
1566 memcpy(&ndlp->active_rrqs.xri_bitmap, 1578 memcpy(&ndlp->active_rrqs.xri_bitmap,
1567 &rrq.xri_bitmap, 1579 &rrq.xri_bitmap,
1568 sizeof(ndlp->active_rrqs.xri_bitmap)); 1580 sizeof(ndlp->active_rrqs.xri_bitmap));
1581
1569 /* Since we are swapping the ndlp passed in with the new one 1582 /* Since we are swapping the ndlp passed in with the new one
1570 * and the did has already been swapped, copy over the 1583 * and the did has already been swapped, copy over state.
1571 * state and names. 1584 * The new WWNs are already in new_ndlp since thats what
1585 * we looked it up by in the begining of this routine.
1572 */ 1586 */
1573 memcpy(&new_ndlp->nlp_portname, &ndlp->nlp_portname,
1574 sizeof(struct lpfc_name));
1575 memcpy(&new_ndlp->nlp_nodename, &ndlp->nlp_nodename,
1576 sizeof(struct lpfc_name));
1577 new_ndlp->nlp_state = ndlp->nlp_state; 1587 new_ndlp->nlp_state = ndlp->nlp_state;
1578 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); 1588
1589 /* Since we are switching over to the new_ndlp, the old
1590 * ndlp should be put in the NPR state, unless we have
1591 * already started re-discovery on it.
1592 */
1593 if ((ndlp->nlp_state == NLP_STE_UNMAPPED_NODE) ||
1594 (ndlp->nlp_state == NLP_STE_MAPPED_NODE))
1595 lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE);
1596
1579 /* Fix up the rport accordingly */ 1597 /* Fix up the rport accordingly */
1580 rport = ndlp->rport; 1598 rport = ndlp->rport;
1581 if (rport) { 1599 if (rport) {