aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ocs_fc/ocs_hw.h
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_hw.h
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_hw.h')
-rw-r--r--sys/dev/ocs_fc/ocs_hw.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/ocs_fc/ocs_hw.h b/sys/dev/ocs_fc/ocs_hw.h
index d4ee85c3f52a..671aa40871f2 100644
--- a/sys/dev/ocs_fc/ocs_hw.h
+++ b/sys/dev/ocs_fc/ocs_hw.h
@@ -211,7 +211,7 @@ typedef enum {
OCS_HW_WAR_VERSION,
OCS_HW_DISABLE_AR_TGT_DIF,
OCS_HW_EMULATE_I_ONLY_AAB, /**< emulate IAAB=0 for initiator-commands only */
- OCS_HW_EMULATE_TARGET_WQE_TIMEOUT, /**< enable driver timeouts for target WQEs */
+ OCS_HW_EMULATE_WQE_TIMEOUT, /**< enable driver timeouts for WQEs */
OCS_HW_LINK_CONFIG_SPEED,
OCS_HW_CONFIG_TOPOLOGY,
OCS_HW_BOUNCE,
@@ -520,7 +520,7 @@ typedef union ocs_hw_io_param_u {
ocs_hw_dif_blk_size_e blk_size;
uint32_t cmnd_size;
uint16_t flags;
- uint8_t timeout;
+ uint32_t timeout;
uint32_t first_burst;
} fcp_ini;
} ocs_hw_io_param_t;
@@ -576,8 +576,8 @@ struct ocs_hw_io_s {
void *abort_arg; /**< argument passed to "abort done" callback */
ocs_ref_t ref; /**< refcount object */
size_t length; /**< needed for bug O127585: length of IO */
- uint8_t tgt_wqe_timeout; /**< timeout value for target WQEs */
- uint64_t submit_ticks; /**< timestamp when current WQE was submitted */
+ uint32_t wqe_timeout; /**< timeout value for WQEs */
+ struct timeval submit_time; /**< timestamp when current WQE was submitted */
uint32_t status_saved:1, /**< if TRUE, latched status should be returned */
abort_in_progress:1, /**< if TRUE, abort is in progress */
@@ -915,7 +915,7 @@ struct ocs_hw_s {
uint16_t auto_xfer_rdy_app_tag_value;
uint8_t dif_mode; /**< DIF mode to use */
uint8_t i_only_aab; /** Enable initiator-only auto-abort */
- uint8_t emulate_tgt_wqe_timeout; /** Enable driver target wqe timeouts */
+ uint8_t emulate_wqe_timeout; /** Enable driver wqe timeouts */
uint32_t bounce:1;
const char *queue_topology; /**< Queue topology string */
uint8_t auto_xfer_rdy_t10_enable; /** Enable t10 PI for auto xfer ready */