scsi: lpfc: Exit PRLI completion handling early if ndlp not in PRLI_ISSUE state
authorJustin Tee <justin.tee@broadcom.com>
Mon, 9 Jan 2023 23:33:12 +0000 (15:33 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 12 Jan 2023 05:03:14 +0000 (00:03 -0500)
commitc051f1a424a15b73c493090a9f1c0273398b1637
treec23bc55192a62bc8d03fcf6408c8954add3a809e
parentecdf4ddf4eb7a9135abdb358e98a8e6c1e8effe6
scsi: lpfc: Exit PRLI completion handling early if ndlp not in PRLI_ISSUE state

In a large SAN testing configuration, frequent target port toggle tests are
occasionally resulting in missing lun path rediscoveries.  An outstanding
PRLI can be inflight when a target RSCN dissappearance occurs, causing the
driver to retry PRLIs using invalid rpi contexts.

Fix by verifying that an ndlp's state was not restarted from PRLI_ISSUE
due to an intermediate RSCN.  If not in a valid state, early exit PRLI
completion handling.

The last follow up RSCN indicating target reappearance retriggers
PLOGI/PRLI with a valid rpi context and is expected to succeed in LUN path
rediscovery.

Signed-off-by: Justin Tee <justin.tee@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_els.c