scsi: lpfc: Refresh ndlp when a new PRLI is received in the PRLI issue state
authorJames Smart <jsmart2021@gmail.com>
Mon, 4 Jan 2021 18:02:28 +0000 (10:02 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 8 Jan 2021 04:02:35 +0000 (23:02 -0500)
commitecf041fe9895c3f5c0119fb427fa634a275c9382
tree89cab7be82ffe1f3ddddc0cdc6716d66fa2660dc
parentd2f2547efd39e9482e25a07c5bddf928dcb12ce7
scsi: lpfc: Refresh ndlp when a new PRLI is received in the PRLI issue state

Testing with target ports coming and going, the driver eventually reached a
state where it no longer discovered the target. When the driver has issued
a PRLI and receives a PRLI from the target, it is not properly updating the
node's initiator/target role flags. Thus, when a subsequent RSCN is
received for a target loss, the driver mis-identifies the target as an
initiator and does not initiate LUN scanning.

Fix by always refreshing the ndlp with the latest PRLI state information
whenever a PRLI is processed.  Also clear the ndlp flags when processing a
PLOGI so that there is no carry over through a re-login.

Link: https://lore.kernel.org/r/20210104180240.46824-4-jsmart2021@gmail.com
Co-developed-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_nportdisc.c