OSDN Git Service

scsi: lpfc: rport port swap discovery issue.
authorJames Smart <jsmart2021@gmail.com>
Fri, 30 Nov 2018 00:09:34 +0000 (16:09 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sat, 8 Dec 2018 03:35:32 +0000 (22:35 -0500)
commit92ea83a878c68f709a172dd0125582b311d4d0d0
tree173b4a4772c687b97b8a20814f5854b40d4b9712
parent8b47ae69e049ae0b3373859d901f0334322f9fe9
scsi: lpfc: rport port swap discovery issue.

Two initiator ports were cable swapped and after swap both went down.  The
driver internally swaps the nlp nodes based on matching node wwn's but not
the same nport id as before. After detecting a change in the nodes RPI, the
driver sends an UNREG_RPI command and clears the NLP_RPI_REGISTERED flag,
then swaps the node information with the other node. But the other node's
NLP_RPI_REGISTERED flag is also cleared, but it is done so without an
UNREG_RPI being sent, which causes the later REG_RPI for that other node to
fail as the hardware believes its still registered.

Additionally, if the node swap occurred while the two nodes had PLOGI's in
flight, the fc4_types weren't properly getting swapped such that when the
PLOGIs commpleted and PRLI's were then sent, the PRLI's acted on bad
protocol types so the PRLI was for the wrong protocol. NVME devices saw
SCSI FCP PRLIs and vice versa.

Clean up the node swap so that the NLP_RPI_REGISTERED flag is handled
properly.

Fix the handling of the fc4_types when the nodes are swapped as well

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_els.c