mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-17 10:41:26 +00:00
qla2x00t-32gbit: 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: Hannes Reinecke <hare@suse.de> Tested-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Quinn Tran <qutran@marvell.com> Signed-off-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> [ commit 86196a8fa8a84af1395a28ea0548f2ce6ae9bc22 upstream ] git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8730 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -870,6 +870,8 @@ static int sqa_close_session(struct scst_session *scst_sess)
|
||||
unsigned long flags;
|
||||
struct qla_hw_data *ha = fcport->vha->hw;
|
||||
|
||||
fcport->explicit_logout = 1;
|
||||
|
||||
spin_lock_irqsave(&ha->tgt.sess_lock, flags);
|
||||
sqa_qla2xxx_put_sess(fcport);
|
||||
spin_unlock_irqrestore(&ha->tgt.sess_lock, flags);
|
||||
|
||||
@@ -2427,6 +2427,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;
|
||||
|
||||
@@ -2411,11 +2411,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->keep_nport_handle)
|
||||
logio->control_flags |= cpu_to_le16(LCF_FREE_NPORT);
|
||||
|
||||
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)
|
||||
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;
|
||||
|
||||
@@ -1117,6 +1117,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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user