diff mbox

[05/15] lpfc: Fix NVMEI driver not decrementing counter causing bad rport state.

Message ID 20170510190713.30171-6-jsmart2021@gmail.com (mailing list archive)
State Superseded, archived
Headers show

Commit Message

James Smart May 10, 2017, 7:07 p.m. UTC
During driver boot, a latency in the NVMET driver
side causes the incoming NVMEI PRLI to get rejected by the
NVMET driver.  When this happens, the NVMEI driver runs
out of PRLI retries.  Bouncing the link does not fix the
situation.

If the NVMEI driver decides, on PRLI completion
failures, to retry the PRLI, always decrement the
fc4_prli_sent counter.  This allows the PRLI completion
to resolve to UNMAPPED when NVMET rejects the PRLI.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
---
 drivers/scsi/lpfc/lpfc_els.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Comments

Hannes Reinecke May 11, 2017, 6:18 a.m. UTC | #1
On 05/10/2017 09:07 PM, James Smart wrote:
> During driver boot, a latency in the NVMET driver
> side causes the incoming NVMEI PRLI to get rejected by the
> NVMET driver.  When this happens, the NVMEI driver runs
> out of PRLI retries.  Bouncing the link does not fix the
> situation.
> 
> If the NVMEI driver decides, on PRLI completion
> failures, to retry the PRLI, always decrement the
> fc4_prli_sent counter.  This allows the PRLI completion
> to resolve to UNMAPPED when NVMET rejects the PRLI.
> 
> Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
> Signed-off-by: James Smart <james.smart@broadcom.com>
> ---
>  drivers/scsi/lpfc/lpfc_els.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
Reviewed-by: Hannes Reinecke <hare@suse.com>

Cheers,

Hannes
diff mbox

Patch

diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
index 3f9f6d5f8c69..3085895464d9 100644
--- a/drivers/scsi/lpfc/lpfc_els.c
+++ b/drivers/scsi/lpfc/lpfc_els.c
@@ -2077,16 +2077,19 @@  lpfc_cmpl_els_prli(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
 
 	if (irsp->ulpStatus) {
 		/* Check for retry */
+		ndlp->fc4_prli_sent--;
 		if (lpfc_els_retry(phba, cmdiocb, rspiocb)) {
 			/* ELS command is being retried */
-			ndlp->fc4_prli_sent--;
 			goto out;
 		}
+
 		/* PRLI failed */
 		lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
-				 "2754 PRLI failure DID:%06X Status:x%x/x%x\n",
+				 "2754 PRLI failure DID:%06X Status:x%x/x%x, "
+				 "data: x%x\n",
 				 ndlp->nlp_DID, irsp->ulpStatus,
-				 irsp->un.ulpWord[4]);
+				 irsp->un.ulpWord[4], ndlp->fc4_prli_sent);
+
 		/* Do not call DSM for lpfc_els_abort'ed ELS cmds */
 		if (lpfc_error_lost_link(irsp))
 			goto out;