scsi: qla2xxx: Fix duplicate switch's Nport ID entries
authorQuinn Tran <quinn.tran@cavium.com>
Tue, 11 Sep 2018 17:18:25 +0000 (10:18 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 12 Sep 2018 00:28:10 +0000 (20:28 -0400)
commitf3a03ee1102a44ccbd2c5de80a6e862ba23e9b55
treec8989cb23fae135793524ef4f1f8e4a2145e175e
parent7c388f91ec1a59b0ed815b07b90536e2d57e1e1f
scsi: qla2xxx: Fix duplicate switch's Nport ID entries

Current code relies on switch to provide a unique combination of WWPN +
NPORTID to tract an FC port.  This patch tries to detect a case where switch
data base can get corrupted where multiple WWPNs can have the same Nport ID.
The 1st Nport ID on the list will be kept while the duplicate Nport ID will be
discarded.

Signed-off-by: Quinn Tran <quinn.tran@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qla2xxx/qla_gs.c