All of lore.kernel.org
 help / color / mirror / Atom feed
From: Saurav Kashyap <skashyap@marvell.com>
To: <martin.petersen@oracle.com>
Cc: <GR-QLogic-Storage-Upstream@marvell.com>,
	<linux-scsi@vger.kernel.org>, <jhasan@marvell.com>
Subject: [PATCH 1/2] libfc: If PRLI rejected, move rport to PLOGI state.
Date: Thu, 26 Mar 2020 23:02:07 -0700	[thread overview]
Message-ID: <20200327060208.17104-2-skashyap@marvell.com> (raw)
In-Reply-To: <20200327060208.17104-1-skashyap@marvell.com>

From: Javed Hasan <jhasan@marvell.com>

-If PRLI reject code indicates "rejected status",
   move rport state machine back to PLOGI state.

Signed-off-by: Javed Hasan <jhasan@marvell.com>
Signed-off-by: Saurav Kashyap <skashyap@marvell.com>
---
 drivers/scsi/libfc/fc_rport.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c
index da6e97d..6bb8917 100644
--- a/drivers/scsi/libfc/fc_rport.c
+++ b/drivers/scsi/libfc/fc_rport.c
@@ -1208,9 +1208,15 @@ static void fc_rport_prli_resp(struct fc_seq *sp, struct fc_frame *fp,
 		rjt = fc_frame_payload_get(fp, sizeof(*rjt));
 		if (!rjt)
 			FC_RPORT_DBG(rdata, "PRLI bad response\n");
-		else
+		else {
 			FC_RPORT_DBG(rdata, "PRLI ELS rejected, reason %x expl %x\n",
 				     rjt->er_reason, rjt->er_explan);
+			if (rjt->er_reason == ELS_RJT_UNAB &&
+			    rjt->er_explan == ELS_EXPL_PLOGI_REQD) {
+				fc_rport_enter_plogi(rdata);
+				goto out;
+			}
+		}
 		fc_rport_error_retry(rdata, FC_EX_ELS_RJT);
 	}
 
-- 
1.8.3.1


  reply	other threads:[~2020-03-27  6:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-27  6:02 [PATCH 0/2] libfc: Move to PLOGI state on RJT and retry exhaustion Saurav Kashyap
2020-03-27  6:02 ` Saurav Kashyap [this message]
2020-03-27  6:02 ` [PATCH 2/2] libfc: rport state move to PLOGI if all PRLI retry exhausted Saurav Kashyap
2020-03-27 20:51 ` [PATCH 0/2] libfc: Move to PLOGI state on RJT and retry exhaustion Martin K. Petersen

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=20200327060208.17104-2-skashyap@marvell.com \
    --to=skashyap@marvell.com \
    --cc=GR-QLogic-Storage-Upstream@marvell.com \
    --cc=jhasan@marvell.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /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.