aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Christie <michaelc@cs.wisc.edu>2005-11-30 00:12:59 -0500
committerJames Bottomley <jejb@mulgrave.(none)>2005-12-13 20:12:00 -0500
commit9e3961ba2be51a88c6223143568c80e0616d93ce (patch)
treeb811c3ab70d14997718596c9ec21a08561b34d5f
parentf6cfba1d21e9e4afd80e2274aa4df3dc1bd0aab7 (diff)
[SCSI] iscsi: lower queue depth
From Wang Zhenyu: High queue depth was a problem for some targets so make queue_depth adjustable From Mike Christie Make default queue_depth a little lower Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: Alex Aizman <itn780@yahoo.com> Signed-off-by: Dmitry Yusupov <dmitry_yus@yahoo.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
-rw-r--r--drivers/scsi/iscsi_tcp.c20
-rw-r--r--drivers/scsi/iscsi_tcp.h3
2 files changed, 17 insertions, 6 deletions
diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c
index 83e2f8c8e49..5b14c404069 100644
--- a/drivers/scsi/iscsi_tcp.c
+++ b/drivers/scsi/iscsi_tcp.c
@@ -2402,6 +2402,15 @@ fault:
2402} 2402}
2403 2403
2404static int 2404static int
2405iscsi_change_queue_depth(struct scsi_device *sdev, int depth)
2406{
2407 if (depth > ISCSI_MAX_CMD_PER_LUN)
2408 depth = ISCSI_MAX_CMD_PER_LUN;
2409 scsi_adjust_queue_depth(sdev, scsi_get_tag_type(sdev), depth);
2410 return sdev->queue_depth;
2411}
2412
2413static int
2405iscsi_pool_init(struct iscsi_queue *q, int max, void ***items, int item_size) 2414iscsi_pool_init(struct iscsi_queue *q, int max, void ***items, int item_size)
2406{ 2415{
2407 int i; 2416 int i;
@@ -3260,13 +3269,14 @@ iscsi_r2tpool_free(struct iscsi_session *session)
3260static struct scsi_host_template iscsi_sht = { 3269static struct scsi_host_template iscsi_sht = {
3261 .name = "iSCSI Initiator over TCP/IP, v." 3270 .name = "iSCSI Initiator over TCP/IP, v."
3262 ISCSI_VERSION_STR, 3271 ISCSI_VERSION_STR,
3263 .queuecommand = iscsi_queuecommand, 3272 .queuecommand = iscsi_queuecommand,
3273 .change_queue_depth = iscsi_change_queue_depth,
3264 .can_queue = ISCSI_XMIT_CMDS_MAX - 1, 3274 .can_queue = ISCSI_XMIT_CMDS_MAX - 1,
3265 .sg_tablesize = ISCSI_SG_TABLESIZE, 3275 .sg_tablesize = ISCSI_SG_TABLESIZE,
3266 .cmd_per_lun = ISCSI_CMD_PER_LUN, 3276 .cmd_per_lun = ISCSI_DEF_CMD_PER_LUN,
3267 .eh_abort_handler = iscsi_eh_abort, 3277 .eh_abort_handler = iscsi_eh_abort,
3268 .eh_host_reset_handler = iscsi_eh_host_reset, 3278 .eh_host_reset_handler = iscsi_eh_host_reset,
3269 .use_clustering = DISABLE_CLUSTERING, 3279 .use_clustering = DISABLE_CLUSTERING,
3270 .proc_name = "iscsi_tcp", 3280 .proc_name = "iscsi_tcp",
3271 .this_id = -1, 3281 .this_id = -1,
3272}; 3282};
diff --git a/drivers/scsi/iscsi_tcp.h b/drivers/scsi/iscsi_tcp.h
index d23ae68fae0..855f2dfd18a 100644
--- a/drivers/scsi/iscsi_tcp.h
+++ b/drivers/scsi/iscsi_tcp.h
@@ -71,7 +71,8 @@
71#define ISCSI_MGMT_CMDS_MAX 32 /* must be power of 2 */ 71#define ISCSI_MGMT_CMDS_MAX 32 /* must be power of 2 */
72#define ISCSI_MGMT_ITT_OFFSET 0xa00 72#define ISCSI_MGMT_ITT_OFFSET 0xa00
73#define ISCSI_SG_TABLESIZE SG_ALL 73#define ISCSI_SG_TABLESIZE SG_ALL
74#define ISCSI_CMD_PER_LUN 128 74#define ISCSI_DEF_CMD_PER_LUN 32
75#define ISCSI_MAX_CMD_PER_LUN 128
75#define ISCSI_TCP_MAX_CMD_LEN 16 76#define ISCSI_TCP_MAX_CMD_LEN 16
76 77
77#define ITT_MASK (0xfff) 78#define ITT_MASK (0xfff)