From 98270ab45c0a5e533f253f04e0b617c98b5a6259 Mon Sep 17 00:00:00 2001 From: Manish Rangankar Date: Fri, 7 Oct 2011 16:55:47 -0700 Subject: [PATCH] [SCSI] qla4xxx: Fixed session destroy issue on link up-down. During link down, iscsid tries to do re-login to failed session. In case of link down-up-down, LLD was sending connection login failed event to iscsid, which is destroying the session, instead we have to continue re-login by sending connection err event. JIRA Key: UPSISCSI-134 Signed-off-by: Manish Rangankar Signed-off-by: Vikas Chaudhary Reviewed-by: Mike Christie Signed-off-by: James Bottomley --- drivers/scsi/qla4xxx/ql4_init.c | 16 ++++++++++++++++ drivers/scsi/qla4xxx/ql4_os.c | 6 +++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/qla4xxx/ql4_init.c b/drivers/scsi/qla4xxx/ql4_init.c index ca155bb..cc10bac 100644 --- a/drivers/scsi/qla4xxx/ql4_init.c +++ b/drivers/scsi/qla4xxx/ql4_init.c @@ -931,6 +931,22 @@ int qla4xxx_process_ddb_changed(struct scsi_qla_host *ha, uint32_t fw_ddb_index, break; } break; + case DDB_DS_SESSION_FAILED: + switch (state) { + case DDB_DS_SESSION_ACTIVE: + case DDB_DS_DISCOVERY: + iscsi_conn_login_event(ddb_entry->conn, + ISCSI_CONN_STATE_LOGGED_IN); + qla4xxx_update_session_conn_param(ha, ddb_entry); + status = QLA_SUCCESS; + break; + case DDB_DS_SESSION_FAILED: + iscsi_session_failure(ddb_entry->sess->dd_data, + ISCSI_ERR_CONN_FAILED); + status = QLA_SUCCESS; + break; + } + break; default: DEBUG2(ql4_printk(KERN_INFO, ha, "%s: Unknown Event\n", __func__)); diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c index bea78a7..af83e6f 100644 --- a/drivers/scsi/qla4xxx/ql4_os.c +++ b/drivers/scsi/qla4xxx/ql4_os.c @@ -1158,7 +1158,11 @@ static int qla4xxx_conn_start(struct iscsi_cls_conn *cls_conn) goto exit_conn_start; } - ddb_entry->fw_ddb_device_state = DDB_DS_LOGIN_IN_PROCESS; + if (ddb_entry->fw_ddb_device_state == DDB_DS_NO_CONNECTION_ACTIVE) + ddb_entry->fw_ddb_device_state = DDB_DS_LOGIN_IN_PROCESS; + + DEBUG2(printk(KERN_INFO "%s: DDB state [%d]\n", __func__, + ddb_entry->fw_ddb_device_state)); exit_set_param: iscsi_conn_start(cls_conn); -- 2.7.4