diff mbox series

[09/13] qla2xxx: reduce false trigger to login

Message ID 20220308082048.9774-10-njavali@marvell.com
State Superseded
Headers show
Series qla2xxx driver fixes | expand

Commit Message

Nilesh Javali March 8, 2022, 8:20 a.m. UTC
From: Quinn Tran <qutran@marvell.com>

While a session is in the middle of a relogin,
a late RSCN can be delivered from switch. RSCN trigger fabric
scan where the scan logic can trigger another session login
while a login is in progress.
This patch reduce the extra trigger to prevent multiple login
to the same session.

Cc: stable@vger.kernel.org
Fixes: bee8b84686c4 ("scsi: qla2xxx: Reduce redundant ADISC command for RSCNs")
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
---
 drivers/scsi/qla2xxx/qla_init.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Himanshu Madhani March 9, 2022, 7:06 p.m. UTC | #1
> On Mar 8, 2022, at 12:20 AM, Nilesh Javali <njavali@marvell.com> wrote:
> 
> From: Quinn Tran <qutran@marvell.com>
> 
> While a session is in the middle of a relogin,
> a late RSCN can be delivered from switch. RSCN trigger fabric
> scan where the scan logic can trigger another session login
> while a login is in progress.
> This patch reduce the extra trigger to prevent multiple login
> to the same session.
> 
> Cc: stable@vger.kernel.org
> Fixes: bee8b84686c4 ("scsi: qla2xxx: Reduce redundant ADISC command for RSCNs")
> Signed-off-by: Quinn Tran <qutran@marvell.com>
> Signed-off-by: Nilesh Javali <njavali@marvell.com>
> ---
> drivers/scsi/qla2xxx/qla_init.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
> index 3c58a2911937..a53894444460 100644
> --- a/drivers/scsi/qla2xxx/qla_init.c
> +++ b/drivers/scsi/qla2xxx/qla_init.c
> @@ -1644,7 +1644,8 @@ int qla24xx_fcport_handle_login(struct scsi_qla_host *vha, fc_port_t *fcport)
> 	    fcport->login_gen, fcport->loop_id, fcport->scan_state,
> 	    fcport->fc4_type);
> 
> -	if (fcport->scan_state != QLA_FCPORT_FOUND)
> +	if (fcport->scan_state != QLA_FCPORT_FOUND ||
> +	    fcport->disc_state == DSC_DELETE_PEND)
> 		return 0;
> 
> 	if ((fcport->loop_id != FC_NO_LOOP_ID) &&
> @@ -1665,7 +1666,7 @@ int qla24xx_fcport_handle_login(struct scsi_qla_host *vha, fc_port_t *fcport)
> 	if (vha->host->active_mode == MODE_TARGET && !N2N_TOPO(vha->hw))
> 		return 0;
> 
> -	if (fcport->flags & FCF_ASYNC_SENT) {
> +	if (fcport->flags & (FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE)) {
> 		set_bit(RELOGIN_NEEDED, &vha->dpc_flags);
> 		return 0;
> 	}
> -- 
> 2.19.0.rc0
> 

Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>

--
Himanshu Madhani	 Oracle Linux Engineering
diff mbox series

Patch

diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 3c58a2911937..a53894444460 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -1644,7 +1644,8 @@  int qla24xx_fcport_handle_login(struct scsi_qla_host *vha, fc_port_t *fcport)
 	    fcport->login_gen, fcport->loop_id, fcport->scan_state,
 	    fcport->fc4_type);
 
-	if (fcport->scan_state != QLA_FCPORT_FOUND)
+	if (fcport->scan_state != QLA_FCPORT_FOUND ||
+	    fcport->disc_state == DSC_DELETE_PEND)
 		return 0;
 
 	if ((fcport->loop_id != FC_NO_LOOP_ID) &&
@@ -1665,7 +1666,7 @@  int qla24xx_fcport_handle_login(struct scsi_qla_host *vha, fc_port_t *fcport)
 	if (vha->host->active_mode == MODE_TARGET && !N2N_TOPO(vha->hw))
 		return 0;
 
-	if (fcport->flags & FCF_ASYNC_SENT) {
+	if (fcport->flags & (FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE)) {
 		set_bit(RELOGIN_NEEDED, &vha->dpc_flags);
 		return 0;
 	}