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

scsi: lpfc: Fix devices that don't return after devloss followed by rediscovery

If a remote port is removed and remains removed for devloss_tmo, if an RSCN
is subsequently received indicating the presence of the remte port, the
driver does not login to and rediscovery the remote port.

Currently, in order to for a port to be rediscovered post an RSCN, the node
state must be NPR to reflect not logged in. When devloss expires, the node
state is marked UNUSED. When an RSCN occurs, the nodes referenced by the
RSCN will have a NPR_2B_DISC flag set, but the re-login will only be
attempted if the node is in NPR_NODE state.  Thus the node is skipped over.

Fix by recognizing the NPR_2B_DISC and UNUSED and transition the node back
to NPR state to allow the re-login to take place.
Signed-off-by: default avatarDick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: default avatarJames Smart <jsmart2021@gmail.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 07f50997
...@@ -480,10 +480,20 @@ lpfc_prep_node_fc4type(struct lpfc_vport *vport, uint32_t Did, uint8_t fc4_type) ...@@ -480,10 +480,20 @@ lpfc_prep_node_fc4type(struct lpfc_vport *vport, uint32_t Did, uint8_t fc4_type)
lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
"0238 Process x%06x NameServer Rsp " "0238 Process x%06x NameServer Rsp "
"Data: x%x x%x x%x x%x\n", Did, "Data: x%x x%x x%x x%x x%x\n", Did,
ndlp->nlp_flag, ndlp->nlp_fc4_type, ndlp->nlp_flag, ndlp->nlp_fc4_type,
vport->fc_flag, ndlp->nlp_state, vport->fc_flag,
vport->fc_rscn_id_cnt); vport->fc_rscn_id_cnt);
/* if ndlp needs to be discovered and prior
* state of ndlp hit devloss, change state to
* allow rediscovery.
*/
if (ndlp->nlp_flag & NLP_NPR_2B_DISC &&
ndlp->nlp_state == NLP_STE_UNUSED_NODE) {
lpfc_nlp_set_state(vport, ndlp,
NLP_STE_NPR_NODE);
}
} else { } else {
lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_CT, lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_CT,
"Skip1 GID_FTrsp: did:x%x flg:x%x cnt:%d", "Skip1 GID_FTrsp: did:x%x flg:x%x cnt:%d",
...@@ -751,9 +761,11 @@ lpfc_cmpl_ct_cmd_gid_ft(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, ...@@ -751,9 +761,11 @@ lpfc_cmpl_ct_cmd_gid_ft(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
if (CTrsp->CommandResponse.bits.CmdRsp == if (CTrsp->CommandResponse.bits.CmdRsp ==
cpu_to_be16(SLI_CT_RESPONSE_FS_ACC)) { cpu_to_be16(SLI_CT_RESPONSE_FS_ACC)) {
lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
"0208 NameServer Rsp Data: x%x x%x\n", "0208 NameServer Rsp Data: x%x x%x "
"sz x%x\n",
vport->fc_flag, vport->fc_flag,
CTreq->un.gid.Fc4Type); CTreq->un.gid.Fc4Type,
irsp->un.genreq64.bdl.bdeSize);
lpfc_ns_rsp(vport, lpfc_ns_rsp(vport,
outp, outp,
...@@ -814,6 +826,11 @@ lpfc_cmpl_ct_cmd_gid_ft(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, ...@@ -814,6 +826,11 @@ lpfc_cmpl_ct_cmd_gid_ft(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
} }
vport->gidft_inp--; vport->gidft_inp--;
} }
lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
"4216 GID_FT cmpl inp %d disc %d\n",
vport->gidft_inp, vport->num_disc_nodes);
/* Link up / RSCN discovery */ /* Link up / RSCN discovery */
if ((vport->num_disc_nodes == 0) && if ((vport->num_disc_nodes == 0) &&
(vport->gidft_inp == 0)) { (vport->gidft_inp == 0)) {
......
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