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

scsi: lpfc: Fix multiple PRLI completion error path

Nodelist entry for SCSI array ends up in UNMAPPED state. This is due to
illegal discovery State machine transition because of two PRLIs and the
first one failing with LS_RJT. Also, the error path was designed
assuming the PRLIs complete in the order they were sent, FCP first, then
NVME. In a failing case, the array thinks about the first PRLI (FCP),
but issues LS_RJT for the 2nd PRLI immediately.

Fix PRLI completion error path for the ordering expectation.  Ensure the
discovery state machine update is not set until all outstanding PRLIs
are complete.
Signed-off-by: default avatarDick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: default avatarJames Smart <james.smart@broadcom.com>
Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 67c5490a
......@@ -1936,31 +1936,14 @@ lpfc_cmpl_prli_prli_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
goto out;
}
/* When the rport rejected the FCP PRLI as unsupported.
* This should only happen in Pt2Pt so an NVME PRLI
* should be outstanding still.
*/
if (npr && ndlp->nlp_flag & NLP_FCP_PRLI_RJT) {
/* Adjust the nlp_type accordingly if the PRLI failed */
if (npr)
ndlp->nlp_fc4_type &= ~NLP_FC4_FCP;
goto out_err;
}
if (nvpr)
ndlp->nlp_fc4_type &= ~NLP_FC4_NVME;
/* The LS Req had some error. Don't let this be a
* target.
*/
if ((ndlp->fc4_prli_sent == 1) &&
(ndlp->nlp_state == NLP_STE_PRLI_ISSUE) &&
(ndlp->nlp_type & (NLP_FCP_TARGET | NLP_FCP_INITIATOR)))
/* The FCP PRLI completed successfully but
* the NVME PRLI failed. Since they are sent in
* succession, allow the FCP to complete.
*/
/* We can't set the DSM state till BOTH PRLIs complete */
goto out_err;
ndlp->nlp_prev_state = NLP_STE_PRLI_ISSUE;
ndlp->nlp_type |= NLP_FCP_INITIATOR;
lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE);
return ndlp->nlp_state;
}
if (npr && (npr->acceptRspCode == PRLI_REQ_EXECUTED) &&
......
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