scsi: lpfc: Fix loop mode target discovery
authorDick Kennedy <dick.kennedy@broadcom.com>
Wed, 23 Aug 2017 23:55:31 +0000 (16:55 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 25 Aug 2017 02:29:35 +0000 (22:29 -0400)
The driver does not discover targets when in loop mode.

The NLP type is correctly getting set when a fabric connection is
detected but, not for loop. The unknown NLP type means that the driver
does not issue a PRLI when in loop topology. Thus target discovery
fails.

Fix by checking the topology during discovery.  If it is loop, set the
NLP FC4 type to FCP.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_nportdisc.c

index f74cb0142fd4edac4e1378db1e85d14ec21c71a8..95b2b43ac37d4b0ba57645b5512fe09b48cf7cb6 100644 (file)
@@ -1724,6 +1724,9 @@ lpfc_cmpl_reglogin_reglogin_issue(struct lpfc_vport *vport,
                                lpfc_nvme_update_localport(vport);
                        }
 
+               } else if (phba->fc_topology == LPFC_TOPOLOGY_LOOP) {
+                       ndlp->nlp_fc4_type |= NLP_FC4_FCP;
+
                } else if (ndlp->nlp_fc4_type == 0) {
                        rc = lpfc_ns_cmd(vport, SLI_CTNS_GFT_ID,
                                         0, ndlp->nlp_DID);