From: Nilesh Javali <njavali@marvell.com>
To: <martin.petersen@oracle.com>
Cc: <linux-scsi@vger.kernel.org>, <GR-QLogic-Storage-Upstream@marvell.com>
Subject: [PATCH 10/12] qla2xxx: fix NVME session down detection
Date: Mon, 16 Aug 2021 22:13:13 -0700 [thread overview]
Message-ID: <20210817051315.2477-11-njavali@marvell.com> (raw)
In-Reply-To: <20210817051315.2477-1-njavali@marvell.com>
From: Quinn Tran <qutran@marvell.com>
When Target port transition its personality from one to another
(NVME <--> FCP), there could be some overlap of the two where
one layer is going down while the other layer is coming up. This
overlap can cause temporary IO error. This patch detects those
error/transition and recover from it. This patch triggers session
tear down and allow relogin to re-drive the connection under the
following conditions:
- NVME command error
- On prlo + N2N (rida format 2)
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
---
drivers/scsi/qla2xxx/qla_attr.c | 12 +++++++-----
drivers/scsi/qla2xxx/qla_isr.c | 9 +++++++++
drivers/scsi/qla2xxx/qla_mbx.c | 10 ++++++++++
3 files changed, 26 insertions(+), 5 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index 4a0a5b4e688d..d09776b77af2 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -2733,12 +2733,14 @@ qla2x00_terminate_rport_io(struct fc_rport *rport)
* final cleanup of firmware resources (PCBs and XCBs).
*/
if (fcport->loop_id != FC_NO_LOOP_ID) {
- if (IS_FWI2_CAPABLE(fcport->vha->hw))
- fcport->vha->hw->isp_ops->fabric_logout(fcport->vha,
- fcport->loop_id, fcport->d_id.b.domain,
- fcport->d_id.b.area, fcport->d_id.b.al_pa);
- else
+ if (IS_FWI2_CAPABLE(fcport->vha->hw)) {
+ if (fcport->loop_id != FC_NO_LOOP_ID)
+ fcport->logout_on_delete = 1;
+
+ qlt_schedule_sess_for_deletion(fcport);
+ } else {
qla2x00_port_logout(fcport->vha, fcport);
+ }
}
}
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index c2fc75a9ca61..ece60267b971 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -2652,6 +2652,15 @@ static void qla24xx_nvme_iocb_entry(scsi_qla_host_t *vha, struct req_que *req,
case CS_PORT_UNAVAILABLE:
case CS_PORT_LOGGED_OUT:
fcport->nvme_flag |= NVME_FLAG_RESETTING;
+ if (atomic_read(&fcport->state) == FCS_ONLINE) {
+ ql_dbg(ql_dbg_disc, fcport->vha, 0x3021,
+ "Port to be marked lost on fcport=%06x, current "
+ "port state= %s comp_status %x.\n",
+ fcport->d_id.b24, port_state_str[FCS_ONLINE],
+ comp_status);
+
+ qlt_schedule_sess_for_deletion(fcport);
+ }
fallthrough;
case CS_ABORTED:
case CS_PORT_BUSY:
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c
index 438af0d55135..7811c4952035 100644
--- a/drivers/scsi/qla2xxx/qla_mbx.c
+++ b/drivers/scsi/qla2xxx/qla_mbx.c
@@ -4190,6 +4190,16 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha,
rptid_entry->u.f2.remote_nport_id[1];
fcport->d_id.b.al_pa =
rptid_entry->u.f2.remote_nport_id[0];
+
+ /*
+ * For the case where remote port sending PRLO, FW
+ * sends up RIDA Format 2 as an indication of session
+ * loss. In other word, FW state change from PRLI
+ * complete back to PLOGI complete. Delete the
+ * session and let relogin drive the reconnect.
+ */
+ if (atomic_read(&fcport->state) == FCS_ONLINE)
+ qlt_schedule_sess_for_deletion(fcport);
}
}
}
--
2.23.1
next prev parent reply other threads:[~2021-08-17 5:14 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-17 5:13 [PATCH 00/12] qla2xxx driver bug fixes Nilesh Javali
2021-08-17 5:13 ` [PATCH 01/12] qla2xxx: edif: Fix stale session Nilesh Javali
2021-08-17 5:13 ` [PATCH 02/12] qla2xxx: edif: reject AUTH ELS on session down Nilesh Javali
2021-08-17 5:13 ` [PATCH 03/12] qla2xxx: edif: fix edif enable flag Nilesh Javali
2021-08-17 5:13 ` [PATCH 04/12] qla2xxx: Fix hang during NVME session tear down Nilesh Javali
2021-08-17 5:13 ` [PATCH 05/12] qla2xxx: edif: add N2N support for EDIF Nilesh Javali
2021-08-17 5:13 ` [PATCH 06/12] qla2xxx: edif: do secure plogi when auth app is present Nilesh Javali
2021-08-17 5:13 ` [PATCH 07/12] qla2xxx: fix NVME | FCP personality change Nilesh Javali
2021-08-17 5:13 ` [PATCH 08/12] qla2xxx: Fix hang on NVME command timeouts Nilesh Javali
2021-08-17 5:13 ` [PATCH 09/12] qla2xxx: fix NVME retry Nilesh Javali
2021-08-17 5:13 ` Nilesh Javali [this message]
2021-08-17 5:13 ` [PATCH 11/12] qla2xxx: edif: fix returnvar.cocci warnings Nilesh Javali
2021-08-17 5:13 ` [PATCH 12/12] qla2xxx: Update version to 10.02.06.200-k Nilesh Javali
2021-08-24 3:05 ` [PATCH 00/12] qla2xxx driver bug fixes Martin K. Petersen
2021-08-28 2:32 ` 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=20210817051315.2477-11-njavali@marvell.com \
--to=njavali@marvell.com \
--cc=GR-QLogic-Storage-Upstream@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.