Commit d83ca3ea authored by James Smart's avatar James Smart Committed by Martin K. Petersen

scsi: lpfc: Correct loss of fc4 type on remote port address change

An address change for a remote port cause PRLI for the wrong protocol
to be sent.  The node copy done in the discovery code skipped copying
the fc4 protocols supported as well.

Fix the copy logic for the address change.  Beefed up log messages in
this area as well.
Signed-off-by: default avatarDick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: default avatarJames Smart <jsmart2021@gmail.com>
Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent d496b9a7
...@@ -1556,8 +1556,10 @@ lpfc_plogi_confirm_nport(struct lpfc_hba *phba, uint32_t *prsp, ...@@ -1556,8 +1556,10 @@ lpfc_plogi_confirm_nport(struct lpfc_hba *phba, uint32_t *prsp,
*/ */
new_ndlp = lpfc_findnode_wwpn(vport, &sp->portName); new_ndlp = lpfc_findnode_wwpn(vport, &sp->portName);
/* return immediately if the WWPN matches ndlp */
if (new_ndlp == ndlp && NLP_CHK_NODE_ACT(new_ndlp)) if (new_ndlp == ndlp && NLP_CHK_NODE_ACT(new_ndlp))
return ndlp; return ndlp;
if (phba->sli_rev == LPFC_SLI_REV4) { if (phba->sli_rev == LPFC_SLI_REV4) {
active_rrqs_xri_bitmap = mempool_alloc(phba->active_rrq_pool, active_rrqs_xri_bitmap = mempool_alloc(phba->active_rrq_pool,
GFP_KERNEL); GFP_KERNEL);
...@@ -1566,9 +1568,13 @@ lpfc_plogi_confirm_nport(struct lpfc_hba *phba, uint32_t *prsp, ...@@ -1566,9 +1568,13 @@ lpfc_plogi_confirm_nport(struct lpfc_hba *phba, uint32_t *prsp,
phba->cfg_rrq_xri_bitmap_sz); phba->cfg_rrq_xri_bitmap_sz);
} }
lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS | LOG_NODE,
"3178 PLOGI confirm: ndlp %p x%x: new_ndlp %p\n", "3178 PLOGI confirm: ndlp x%x x%x x%x: "
ndlp, ndlp->nlp_DID, new_ndlp); "new_ndlp x%x x%x x%x\n",
ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_fc4_type,
(new_ndlp ? new_ndlp->nlp_DID : 0),
(new_ndlp ? new_ndlp->nlp_flag : 0),
(new_ndlp ? new_ndlp->nlp_fc4_type : 0));
if (!new_ndlp) { if (!new_ndlp) {
rc = memcmp(&ndlp->nlp_portname, name, rc = memcmp(&ndlp->nlp_portname, name,
...@@ -1617,6 +1623,14 @@ lpfc_plogi_confirm_nport(struct lpfc_hba *phba, uint32_t *prsp, ...@@ -1617,6 +1623,14 @@ lpfc_plogi_confirm_nport(struct lpfc_hba *phba, uint32_t *prsp,
phba->cfg_rrq_xri_bitmap_sz); phba->cfg_rrq_xri_bitmap_sz);
} }
/* At this point in this routine, we know new_ndlp will be
* returned. however, any previous GID_FTs that were done
* would have updated nlp_fc4_type in ndlp, so we must ensure
* new_ndlp has the right value.
*/
if (vport->fc_flag & FC_FABRIC)
new_ndlp->nlp_fc4_type = ndlp->nlp_fc4_type;
lpfc_unreg_rpi(vport, new_ndlp); lpfc_unreg_rpi(vport, new_ndlp);
new_ndlp->nlp_DID = ndlp->nlp_DID; new_ndlp->nlp_DID = ndlp->nlp_DID;
new_ndlp->nlp_prev_state = ndlp->nlp_prev_state; new_ndlp->nlp_prev_state = ndlp->nlp_prev_state;
...@@ -1666,7 +1680,6 @@ lpfc_plogi_confirm_nport(struct lpfc_hba *phba, uint32_t *prsp, ...@@ -1666,7 +1680,6 @@ lpfc_plogi_confirm_nport(struct lpfc_hba *phba, uint32_t *prsp,
if (ndlp->nrport) { if (ndlp->nrport) {
ndlp->nrport = NULL; ndlp->nrport = NULL;
lpfc_nlp_put(ndlp); lpfc_nlp_put(ndlp);
new_ndlp->nlp_fc4_type = ndlp->nlp_fc4_type;
} }
/* We shall actually free the ndlp with both nlp_DID and /* We shall actually free the ndlp with both nlp_DID and
...@@ -1740,6 +1753,12 @@ lpfc_plogi_confirm_nport(struct lpfc_hba *phba, uint32_t *prsp, ...@@ -1740,6 +1753,12 @@ lpfc_plogi_confirm_nport(struct lpfc_hba *phba, uint32_t *prsp,
active_rrqs_xri_bitmap) active_rrqs_xri_bitmap)
mempool_free(active_rrqs_xri_bitmap, mempool_free(active_rrqs_xri_bitmap,
phba->active_rrq_pool); phba->active_rrq_pool);
lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS | LOG_NODE,
"3173 PLOGI confirm exit: new_ndlp x%x x%x x%x\n",
new_ndlp->nlp_DID, new_ndlp->nlp_flag,
new_ndlp->nlp_fc4_type);
return new_ndlp; return new_ndlp;
} }
......
...@@ -2868,8 +2868,9 @@ lpfc_disc_state_machine(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, ...@@ -2868,8 +2868,9 @@ lpfc_disc_state_machine(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
/* DSM in event <evt> on NPort <nlp_DID> in state <cur_state> */ /* DSM in event <evt> on NPort <nlp_DID> in state <cur_state> */
lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
"0211 DSM in event x%x on NPort x%x in " "0211 DSM in event x%x on NPort x%x in "
"state %d Data: x%x\n", "state %d Data: x%x x%x\n",
evt, ndlp->nlp_DID, cur_state, ndlp->nlp_flag); evt, ndlp->nlp_DID, cur_state,
ndlp->nlp_flag, ndlp->nlp_fc4_type);
lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_DSM, lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_DSM,
"DSM in: evt:%d ste:%d did:x%x", "DSM in: evt:%d ste:%d did:x%x",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment