Commit 91f6f5fb authored by Quinn Tran's avatar Quinn Tran Committed by Martin K. Petersen
Browse files

scsi: qla2xxx: edif: Reduce connection thrash

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.

Link: https://lore.kernel.org/r/20211026115412.27691-10-njavali@marvell.com


Reviewed-by: default avatarHimanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: default avatarQuinn Tran <qutran@marvell.com>
Signed-off-by: default avatarNilesh Javali <njavali@marvell.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 6c9998ce
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -2762,7 +2762,12 @@ qla2x00_terminate_rport_io(struct fc_rport *rport)
			if (fcport->loop_id != FC_NO_LOOP_ID)
				fcport->logout_on_delete = 1;

			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);
		}
+4 −0
Original line number Diff line number Diff line
@@ -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 */
+22 −2
Original line number Diff line number Diff line
@@ -1793,9 +1793,29 @@ void qla2x00_handle_rscn(scsi_qla_host_t *vha, struct event_arg *ea)
					fcport->d_id.b24, fcport->port_name);
				return;
			}

			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:
		list_for_each_entry(fcport, &vha->vp_fcports, list) {