All of lore.kernel.org
 help / color / mirror / Atom feed
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 v3 09/13] qla2xxx: edif: reduce connection thrash
Date: Tue, 26 Oct 2021 04:54:08 -0700	[thread overview]
Message-ID: <20211026115412.27691-10-njavali@marvell.com> (raw)
In-Reply-To: <20211026115412.27691-1-njavali@marvell.com>

From: Quinn Tran <qutran@marvell.com>

On ipsec start by remote port, Target port may use RSCN to
trigger initiator to relogin. If driver is already in the process
of a relogin, then ignore the RSCN and allow the current relogin
to continue. This reduces thrashing of the connection.

Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
---
 drivers/scsi/qla2xxx/qla_attr.c |  7 ++++++-
 drivers/scsi/qla2xxx/qla_edif.h |  4 ++++
 drivers/scsi/qla2xxx/qla_init.c | 24 ++++++++++++++++++++++--
 3 files changed, 32 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index cb5f2ecb652d..c94f98f4ee68 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -2757,7 +2757,12 @@ qla2x00_terminate_rport_io(struct fc_rport *rport)
 			if (fcport->loop_id != FC_NO_LOOP_ID)
 				fcport->logout_on_delete = 1;
 
-			qlt_schedule_sess_for_deletion(fcport);
+			if (!EDIF_NEGOTIATION_PENDING(fcport)) {
+				ql_dbg(ql_dbg_disc, fcport->vha, 0x911e,
+				       "%s %d schedule session deletion\n", __func__,
+				       __LINE__);
+				qlt_schedule_sess_for_deletion(fcport);
+			}
 		} else {
 			qla2x00_port_logout(fcport->vha, fcport);
 		}
diff --git a/drivers/scsi/qla2xxx/qla_edif.h b/drivers/scsi/qla2xxx/qla_edif.h
index cd54c1dfe3cb..920b1eace40f 100644
--- a/drivers/scsi/qla2xxx/qla_edif.h
+++ b/drivers/scsi/qla2xxx/qla_edif.h
@@ -132,4 +132,8 @@ struct enode {
 	 _s->disc_state == DSC_DELETED || \
 	 !_s->edif.app_sess_online))
 
+#define EDIF_NEGOTIATION_PENDING(_fcport) \
+	((_fcport->vha.e_dbell.db_flags & EDB_ACTIVE) && \
+	 (_fcport->disc_state == DSC_LOGIN_AUTH_PEND))
+
 #endif	/* __QLA_EDIF_H */
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index dbffc59e1677..999e0423891c 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -1793,8 +1793,28 @@ void qla2x00_handle_rscn(scsi_qla_host_t *vha, struct event_arg *ea)
 					fcport->d_id.b24, fcport->port_name);
 				return;
 			}
-			fcport->scan_needed = 1;
-			fcport->rscn_gen++;
+
+			if (vha->hw->flags.edif_enabled && vha->e_dbell.db_flags & EDB_ACTIVE) {
+				/*
+				 * On ipsec start by remote port, Target port
+				 * may use RSCN to trigger initiator to
+				 * relogin. If driver is already in the
+				 * process of a relogin, then ignore the RSCN
+				 * and allow the current relogin to continue.
+				 * This reduces thrashing of the connection.
+				 */
+				if (atomic_read(&fcport->state) == FCS_ONLINE) {
+					/*
+					 * If state = online, then set scan_needed=1 to do relogin.
+					 * Otherwise we're already in the middle of a relogin
+					 */
+					fcport->scan_needed = 1;
+					fcport->rscn_gen++;
+				}
+			} else {
+				fcport->scan_needed = 1;
+				fcport->rscn_gen++;
+			}
 		}
 		break;
 	case RSCN_AREA_ADDR:
-- 
2.19.0.rc0


  parent reply	other threads:[~2021-10-26 11:54 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-26 11:53 [PATCH v3 00/13] qla2xxx - misc driver and EDIF bug fixes Nilesh Javali
2021-10-26 11:54 ` [PATCH v3 01/13] qla2xxx: relogin during fabric disturbance Nilesh Javali
2021-10-26 11:54 ` [PATCH v3 02/13] qla2xxx: fix gnl list corruption Nilesh Javali
2021-10-26 11:54 ` [PATCH v3 03/13] qla2xxx: turn off target reset during issue_lip Nilesh Javali
2021-10-26 11:54 ` [PATCH v3 04/13] qla2xxx: edif: fix app start fail Nilesh Javali
2021-10-26 17:20   ` Himanshu Madhani
2021-10-26 11:54 ` [PATCH v3 05/13] qla2xxx: edif: fix app start delay Nilesh Javali
2021-10-26 11:54 ` [PATCH v3 06/13] qla2xxx: edif: flush stale events and msgs on session down Nilesh Javali
2021-10-26 11:54 ` [PATCH v3 07/13] qla2xxx: edif: replace list_for_each_safe with list_for_each_entry_safe Nilesh Javali
2021-10-26 11:54 ` [PATCH v3 08/13] qla2xxx: edif: tweak trace message Nilesh Javali
2021-10-26 11:54 ` Nilesh Javali [this message]
2021-10-26 11:54 ` [PATCH v3 10/13] qla2xxx: edif: increase ELS payload Nilesh Javali
2021-10-26 11:54 ` [PATCH v3 11/13] qla2xxx: edif: fix inconsistent check of db_flags Nilesh Javali
2021-10-26 11:54 ` [PATCH v3 12/13] qla2xxx: edif: fix edif bsg Nilesh Javali
2021-10-26 11:54 ` [PATCH v3 13/13] qla2xxx: Update version to 10.02.07.200-k Nilesh Javali

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=20211026115412.27691-10-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.