提交 c28eaaca 编写于 作者: N Nilesh Javali 提交者: James Bottomley

[SCSI] qla4xxx: Limit the ACB Default Timeout value to 12s

A wrong default timeout value programmed in the adapter causes driver
to wait for that much time while waiting for target discoveries to complete.
This could add huge delays during the driver load time. To avoid this,
limit the default timeout value to 12 seconds if the default timeout value
set in adapter is less than 12 seconds and greater than 120 seconds.
Signed-off-by: NNilesh Javali <nilesh.javali@qlogic.com>
Signed-off-by: NVikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
上级 4a4bc2e9
...@@ -1630,7 +1630,9 @@ void qla4xxx_update_session_conn_param(struct scsi_qla_host *ha, ...@@ -1630,7 +1630,9 @@ void qla4xxx_update_session_conn_param(struct scsi_qla_host *ha,
/* Update timers after login */ /* Update timers after login */
ddb_entry->default_relogin_timeout = ddb_entry->default_relogin_timeout =
le16_to_cpu(fw_ddb_entry->def_timeout); (le16_to_cpu(fw_ddb_entry->def_timeout) > LOGIN_TOV) &&
(le16_to_cpu(fw_ddb_entry->def_timeout) < LOGIN_TOV * 10) ?
le16_to_cpu(fw_ddb_entry->def_timeout) : LOGIN_TOV;
ddb_entry->default_time2wait = ddb_entry->default_time2wait =
le16_to_cpu(fw_ddb_entry->iscsi_def_time2wait); le16_to_cpu(fw_ddb_entry->iscsi_def_time2wait);
...@@ -3882,6 +3884,8 @@ static int qla4xxx_verify_boot_idx(struct scsi_qla_host *ha, uint16_t idx) ...@@ -3882,6 +3884,8 @@ static int qla4xxx_verify_boot_idx(struct scsi_qla_host *ha, uint16_t idx)
static void qla4xxx_setup_flash_ddb_entry(struct scsi_qla_host *ha, static void qla4xxx_setup_flash_ddb_entry(struct scsi_qla_host *ha,
struct ddb_entry *ddb_entry) struct ddb_entry *ddb_entry)
{ {
uint16_t def_timeout;
ddb_entry->ddb_type = FLASH_DDB; ddb_entry->ddb_type = FLASH_DDB;
ddb_entry->fw_ddb_index = INVALID_ENTRY; ddb_entry->fw_ddb_index = INVALID_ENTRY;
ddb_entry->fw_ddb_device_state = DDB_DS_NO_CONNECTION_ACTIVE; ddb_entry->fw_ddb_device_state = DDB_DS_NO_CONNECTION_ACTIVE;
...@@ -3892,9 +3896,10 @@ static void qla4xxx_setup_flash_ddb_entry(struct scsi_qla_host *ha, ...@@ -3892,9 +3896,10 @@ static void qla4xxx_setup_flash_ddb_entry(struct scsi_qla_host *ha,
atomic_set(&ddb_entry->retry_relogin_timer, INVALID_ENTRY); atomic_set(&ddb_entry->retry_relogin_timer, INVALID_ENTRY);
atomic_set(&ddb_entry->relogin_timer, 0); atomic_set(&ddb_entry->relogin_timer, 0);
atomic_set(&ddb_entry->relogin_retry_count, 0); atomic_set(&ddb_entry->relogin_retry_count, 0);
def_timeout = le16_to_cpu(ddb_entry->fw_ddb_entry.def_timeout);
ddb_entry->default_relogin_timeout = ddb_entry->default_relogin_timeout =
le16_to_cpu(ddb_entry->fw_ddb_entry.def_timeout); (def_timeout > LOGIN_TOV) && (def_timeout < LOGIN_TOV * 10) ?
def_timeout : LOGIN_TOV;
ddb_entry->default_time2wait = ddb_entry->default_time2wait =
le16_to_cpu(ddb_entry->fw_ddb_entry.iscsi_def_time2wait); le16_to_cpu(ddb_entry->fw_ddb_entry.iscsi_def_time2wait);
} }
...@@ -4228,7 +4233,10 @@ void qla4xxx_build_ddb_list(struct scsi_qla_host *ha, int is_reset) ...@@ -4228,7 +4233,10 @@ void qla4xxx_build_ddb_list(struct scsi_qla_host *ha, int is_reset)
} }
/* Wait to ensure all sendtargets are done for min 12 sec wait */ /* Wait to ensure all sendtargets are done for min 12 sec wait */
tmo = ((ha->def_timeout < LOGIN_TOV) ? LOGIN_TOV : ha->def_timeout); tmo = ((ha->def_timeout > LOGIN_TOV) &&
(ha->def_timeout < LOGIN_TOV * 10) ?
ha->def_timeout : LOGIN_TOV);
DEBUG2(ql4_printk(KERN_INFO, ha, DEBUG2(ql4_printk(KERN_INFO, ha,
"Default time to wait for build ddb %d\n", tmo)); "Default time to wait for build ddb %d\n", tmo));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册