Commit 86196a8f authored by Quinn Tran's avatar Quinn Tran Committed by Martin K. Petersen
Browse files

scsi: qla2xxx: Use explicit LOGO in target mode

Target makes implicit LOGO on session teardown. LOGO ELS is not send on the
wire and initiator is not aware that target no longer wants talking to
it. Initiator keeps sending I/O requests, target responds with BA_RJT, they
time out and then initiator sends ABORT TASK (ABTS-LS).

Current behaviour incurs unneeded I/O timeout and can be fixed for some
initiators by making explicit LOGO on session deletion.

Link: https://lore.kernel.org/r/20191125165702.1013-3-r.bolshakov@yadro.com


Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
Tested-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarQuinn Tran <qutran@marvell.com>
Signed-off-by: default avatarHimanshu Madhani <hmadhani@marvell.com>
Signed-off-by: default avatarRoman Bolshakov <r.bolshakov@yadro.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent f2c9ee54
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2401,6 +2401,7 @@ typedef struct fc_port {
	unsigned int id_changed:1;
	unsigned int scan_needed:1;
	unsigned int n2n_flag:1;
	unsigned int explicit_logout:1;

	struct completion nvme_del_done;
	uint32_t nvme_prli_service_param;
+12 −4
Original line number Diff line number Diff line
@@ -2405,11 +2405,19 @@ qla2x00_login_iocb(srb_t *sp, struct mbx_entry *mbx)
static void
qla24xx_logout_iocb(srb_t *sp, struct logio_entry_24xx *logio)
{
	u16 control_flags = LCF_COMMAND_LOGO;
	logio->entry_type = LOGINOUT_PORT_IOCB_TYPE;
	logio->control_flags =
	    cpu_to_le16(LCF_COMMAND_LOGO|LCF_IMPL_LOGO);

	if (sp->fcport->explicit_logout) {
		control_flags |= LCF_EXPL_LOGO|LCF_FREE_NPORT;
	} else {
		control_flags |= LCF_IMPL_LOGO;

		if (!sp->fcport->keep_nport_handle)
		logio->control_flags |= cpu_to_le16(LCF_FREE_NPORT);
			control_flags |= LCF_FREE_NPORT;
	}

	logio->control_flags = cpu_to_le16(control_flags);
	logio->nport_handle = cpu_to_le16(sp->fcport->loop_id);
	logio->port_id[0] = sp->fcport->d_id.b.al_pa;
	logio->port_id[1] = sp->fcport->d_id.b.area;
+1 −0
Original line number Diff line number Diff line
@@ -1104,6 +1104,7 @@ void qlt_free_session_done(struct work_struct *work)
		}
	}

	sess->explicit_logout = 0;
	spin_unlock_irqrestore(&ha->tgt.sess_lock, flags);
	sess->free_pending = 0;

+1 −0
Original line number Diff line number Diff line
@@ -350,6 +350,7 @@ static void tcm_qla2xxx_close_session(struct se_session *se_sess)
	target_sess_cmd_list_set_waiting(se_sess);
	spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags);

	sess->explicit_logout = 1;
	tcm_qla2xxx_put_sess(sess);
}