All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Smart <jsmart2021@gmail.com>
To: linux-scsi@vger.kernel.org
Cc: James Smart <jsmart2021@gmail.com>,
	Dick Kennedy <dick.kennedy@broadcom.com>,
	James Smart <james.smart@broadcom.com>
Subject: [PATCH 13/15] lpfc: Fix PRLI retry handling when target rejects it.
Date: Tue, 30 May 2017 23:04:37 -0700	[thread overview]
Message-ID: <20170531060439.2073-14-jsmart2021@gmail.com> (raw)
In-Reply-To: <20170531060439.2073-1-jsmart2021@gmail.com>

The nvmet driver was rejecting the initiator's PRLI because
its reg_rpi for the PLOGI was still outstanding.  The initiator
would resend the PRLI without delay and get the same answer.
The PRLI retries would exhaust causing the nvme initiator to
set the nvmet ndlp to UNMAPPED.

The driver's lpfc_els_retry handler did not have a policy for an
LS_RJT with explanation CMD_IN_PROGRESS for PRLI or NVME_PRLI.
This caused the delay to remain at 0 but retry set 1.

Fix: When the ELS response is LS_RJT, TPC and the command was PRLI
or NVME_PRLI, just set the delay to 1000 mS to get a 1 second
delay on the PRLI retry.  This was enough to allow the REG_RPI to
complete at the target.

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

diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
index 8e532b39ae93..a140318d6159 100644
--- a/drivers/scsi/lpfc/lpfc_els.c
+++ b/drivers/scsi/lpfc/lpfc_els.c
@@ -3332,6 +3332,19 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
 		 */
 		switch (stat.un.b.lsRjtRsnCode) {
 		case LSRJT_UNABLE_TPC:
+			/* The driver has a VALID PLOGI but the rport has
+			 * rejected the PRLI - can't do it now.  Delay
+			 * for 1 second and try again - don't care about
+			 * the explanation.
+			 */
+			if (cmd == ELS_CMD_PRLI || cmd == ELS_CMD_NVMEPRLI) {
+				delay = 1000;
+				maxretry = lpfc_max_els_tries + 1;
+				retry = 1;
+				break;
+			}
+
+			/* Legacy bug fix code for targets with PLOGI delays. */
 			if (stat.un.b.lsRjtRsnCodeExp ==
 			    LSEXP_CMD_IN_PROGRESS) {
 				if (cmd == ELS_CMD_PLOGI) {
@@ -3350,9 +3363,7 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
 				retry = 1;
 				break;
 			}
-			if ((cmd == ELS_CMD_PLOGI) ||
-			    (cmd == ELS_CMD_PRLI) ||
-			    (cmd == ELS_CMD_NVMEPRLI)) {
+			if (cmd == ELS_CMD_PLOGI) {
 				delay = 1000;
 				maxretry = lpfc_max_els_tries + 1;
 				retry = 1;
-- 
2.11.0

  parent reply	other threads:[~2017-05-31  6:05 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-31  6:04 [PATCH 00/15] lpfc updates for 11.4.0.0 James Smart
2017-05-31  6:04 ` [PATCH 01/15] lpfc: Add nvme initiator devloss support James Smart
2017-05-31  6:04 ` [PATCH 02/15] lpfc: Fix transition nvme-i rport handling to nport only James Smart
2017-05-31  6:04 ` [PATCH 03/15] lpfc: Fix nvme port role handling in sysfs and debugfs handlers James Smart
2017-05-31  6:04 ` [PATCH 04/15] lpfc: Add changes to assist in NVMET debugging James Smart
2017-05-31  6:04 ` [PATCH 05/15] lpfc: Fix Lun Priority level shown as NA James Smart
2017-05-31  6:04 ` [PATCH 06/15] lpfc: Fix nvmet node ref count handling James Smart
2017-05-31  6:04 ` [PATCH 07/15] lpfc: Fix Port going offline after multiple resets James Smart
2017-05-31  6:04 ` [PATCH 08/15] lpfc: Fix counters so outstandng NVME IO count is accurate James Smart
2017-05-31  6:04 ` [PATCH 09/15] lpfc: Fix return value of board_mode store routine in case of online failure James Smart
2017-05-31  6:04 ` [PATCH 10/15] lpfc: Fix crash on powering off BFS VM with passthrough device James Smart
2017-06-01 19:27   ` Raphael Philipe Mendes da Silva
2017-05-31  6:04 ` [PATCH 11/15] lpfc: Fix System panic after loading the driver James Smart
2017-05-31  6:04 ` [PATCH 12/15] lpfc: Null pointer dereference when log_verbose is set to 0xffffffff James Smart
2017-05-31  6:04 ` James Smart [this message]
2017-05-31  6:04 ` [PATCH 14/15] lpfc: Fix vports not logging into target James Smart
2017-05-31  6:04 ` [PATCH 15/15] lpfc: update to revision to 11.4.0.0 James Smart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170531060439.2073-14-jsmart2021@gmail.com \
    --to=jsmart2021@gmail.com \
    --cc=dick.kennedy@broadcom.com \
    --cc=james.smart@broadcom.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.