diff mbox series

[SRU,Artful,1/1] scsi: lpfc: Fix loop mode target discovery

Message ID df46b71ffbd86d23361a517e5e5ab86c61cfa0a8.1518547424.git.joseph.salisbury@canonical.com
State New
Headers show
Series [SRU,Artful,1/1] scsi: lpfc: Fix loop mode target discovery | expand

Commit Message

Joseph Salisbury Feb. 16, 2018, 4:01 p.m. UTC
From: Dick Kennedy <dick.kennedy@broadcom.com>

BugLink: http://bugs.launchpad.net/bugs/1746970

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>
(cherry picked from commit 2877cbffb79ed121a6bcc5edbe629d3aba36cd29)
Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
---
 drivers/scsi/lpfc/lpfc_nportdisc.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Stefan Bader Feb. 28, 2018, 10:07 a.m. UTC | #1
On 16.02.2018 17:01, Joseph Salisbury wrote:
> From: Dick Kennedy <dick.kennedy@broadcom.com>
> 
> BugLink: http://bugs.launchpad.net/bugs/1746970
> 
> 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>
> (cherry picked from commit 2877cbffb79ed121a6bcc5edbe629d3aba36cd29)
> Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>

> ---
>  drivers/scsi/lpfc/lpfc_nportdisc.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc/lpfc_nportdisc.c
> index f74cb01..95b2b43 100644
> --- a/drivers/scsi/lpfc/lpfc_nportdisc.c
> +++ b/drivers/scsi/lpfc/lpfc_nportdisc.c
> @@ -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);
>
diff mbox series

Patch

diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc/lpfc_nportdisc.c
index f74cb01..95b2b43 100644
--- a/drivers/scsi/lpfc/lpfc_nportdisc.c
+++ b/drivers/scsi/lpfc/lpfc_nportdisc.c
@@ -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);