aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ocs_fc/ocs_xport.c
diff options
context:
space:
mode:
authorRam Kishore Vegesna <ram@FreeBSD.org>2023-12-12 15:22:58 +0000
committerKenneth D. Merry <ken@FreeBSD.org>2023-12-12 15:22:58 +0000
commit70547544ce931357c980be47d937e5b57a2d7f49 (patch)
treefd7b6361826021e3b0e7b6b11dc1291316c05f7d /sys/dev/ocs_fc/ocs_xport.c
parent793e4aca9e70f2441f0f4e1688d0a727d602ed81 (diff)
downloadsrc-70547544ce931357c980be47d937e5b57a2d7f49.tar.gz
src-70547544ce931357c980be47d937e5b57a2d7f49.zip
ocs_fc: IO timeout handling and error reporting fix.
Hardware timeout uses a 8-bit timeout value and expects the timeout to be less than 255 seconds. Added software timer implemetation to timeout and abort the IOs with timeout more than 255 seconds. Fix the timeout problem by dividing CAM timeouts by 1000 as hardware expects timeout value in seconds. Before this change, CAM timeouts in milliseconds were getting truncated to 8 bits and converted to seconds. So the actual timeout used when going down to the card would depend on the bottom 8 bits of the timeout used. Add the mapping of ocs_fc error status to CAM status. Reported by: ken Reviewed by: ken Tested by: ken, ram Approved by: ken MFC after: 1 week
Diffstat (limited to 'sys/dev/ocs_fc/ocs_xport.c')
-rw-r--r--sys/dev/ocs_fc/ocs_xport.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/ocs_fc/ocs_xport.c b/sys/dev/ocs_fc/ocs_xport.c
index d6b0d8740906..d997ea245132 100644
--- a/sys/dev/ocs_fc/ocs_xport.c
+++ b/sys/dev/ocs_fc/ocs_xport.c
@@ -524,9 +524,11 @@ ocs_xport_initialize(ocs_xport_t *xport)
}
}
- if (ocs->target_io_timer_sec) {
- ocs_log_debug(ocs, "setting target io timer=%d\n", ocs->target_io_timer_sec);
- ocs_hw_set(&ocs->hw, OCS_HW_EMULATE_TARGET_WQE_TIMEOUT, TRUE);
+ if (ocs->target_io_timer_sec || ocs->enable_ini) {
+ if (ocs->target_io_timer_sec)
+ ocs_log_debug(ocs, "setting target io timer=%d\n", ocs->target_io_timer_sec);
+
+ ocs_hw_set(&ocs->hw, OCS_HW_EMULATE_WQE_TIMEOUT, TRUE);
}
ocs_hw_callback(&ocs->hw, OCS_HW_CB_DOMAIN, ocs_domain_cb, ocs);