scsi: libfc: If PRLI rejected, move rport to PLOGI state

[ Upstream commit 45e544bfda ]

If PRLI reject code indicates "rejected status", move rport state machine
back to PLOGI state.

Link: https://lore.kernel.org/r/20200327060208.17104-2-skashyap@marvell.com
Signed-off-by: Javed Hasan <jhasan@marvell.com>
Signed-off-by: Saurav Kashyap <skashyap@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Javed Hasan 2020-03-26 23:02:07 -07:00 committed by Greg Kroah-Hartman
parent 8427b05a7a
commit fb669262fd
1 changed files with 7 additions and 1 deletions

View File

@ -1208,9 +1208,15 @@ static void fc_rport_prli_resp(struct fc_seq *sp, struct fc_frame *fp,
rjt = fc_frame_payload_get(fp, sizeof(*rjt));
if (!rjt)
FC_RPORT_DBG(rdata, "PRLI bad response\n");
else
else {
FC_RPORT_DBG(rdata, "PRLI ELS rejected, reason %x expl %x\n",
rjt->er_reason, rjt->er_explan);
if (rjt->er_reason == ELS_RJT_UNAB &&
rjt->er_explan == ELS_EXPL_PLOGI_REQD) {
fc_rport_enter_plogi(rdata);
goto out;
}
}
fc_rport_error_retry(rdata, FC_EX_ELS_RJT);
}