summaryrefslogtreecommitdiff
path: root/drivers/scsi/qla2xxx/qla_def.h
diff options
context:
space:
mode:
authorQuinn Tran <quinn.tran@qlogic.com>2014-09-25 06:14:55 -0400
committerChristoph Hellwig <hch@lst.de>2014-09-25 14:25:07 +0200
commit33e7997755936ba92516c6ad69cd012c2e7d4dbb (patch)
tree226806ebe455794fe94a4ac3bf8a4130197ed6f1 /drivers/scsi/qla2xxx/qla_def.h
parentf2ea653fd448b814dd92b6554ede85abd9e22d9f (diff)
qla2xxx: Add support for QFull throttling and Term Exchange retry
Through the qla target code, the qlt_send_term_exchange() routine is used in various different places to cleanup an exchange. For the case of IOCB request queue is full, the exchange is left unhandled/ dangling. Existing code does not have re-try logic to cleanup the exchange. This patch add retry logic to cleanup the exchange before letting new commands through. For the case of FW running out of exchanges, driver need to reply SAM_STAT_BUSY to the initiators. This patch add a pending queue for the busy reply in case IOCB queue is unable to handle the cmd. Cc: <stable@vger.kernel.org> Signed-off-by: Quinn Tran <quinn.tran@qlogic.com> Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_def.h')
-rw-r--r--drivers/scsi/qla2xxx/qla_def.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index b048841a5360..5f6b2960cccb 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -2776,6 +2776,9 @@ struct qla_statistics {
uint32_t control_requests;
uint64_t jiffies_at_last_reset;
+ uint32_t stat_max_pend_cmds;
+ uint32_t stat_max_qfull_cmds_alloc;
+ uint32_t stat_max_qfull_cmds_dropped;
};
struct bidi_statistics {
@@ -2898,8 +2901,22 @@ struct qlt_hw_data {
uint8_t saved_add_firmware_options[2];
uint8_t tgt_node_name[WWN_SIZE];
+
+ struct list_head q_full_list;
+ uint32_t num_pend_cmds;
+ uint32_t num_qfull_cmds_alloc;
+ uint32_t num_qfull_cmds_dropped;
+ spinlock_t q_full_lock;
+ uint32_t leak_exchg_thresh_hold;
};
+#define MAX_QFULL_CMDS_ALLOC 8192
+#define Q_FULL_THRESH_HOLD_PERCENT 90
+#define Q_FULL_THRESH_HOLD(ha) \
+ ((ha->fw_xcb_count/100) * Q_FULL_THRESH_HOLD_PERCENT)
+
+#define LEAK_EXCHG_THRESH_HOLD_PERCENT 75 /* 75 percent */
+
/*
* Qlogic host adapter specific data structure.
*/