Commit 9e3961ba2be51a88c6223143568c80e0616d93ce

Authored by Mike Christie
Committed by James Bottomley
1 parent f6cfba1d21

[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>

Showing 2 changed files with 17 additions and 6 deletions Side-by-side Diff

drivers/scsi/iscsi_tcp.c
... ... @@ -2402,6 +2402,15 @@
2402 2402 }
2403 2403  
2404 2404 static int
  2405 +iscsi_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 +
  2413 +static int
2405 2414 iscsi_pool_init(struct iscsi_queue *q, int max, void ***items, int item_size)
2406 2415 {
2407 2416 int i;
2408 2417  
... ... @@ -3260,13 +3269,14 @@
3260 3269 static struct scsi_host_template iscsi_sht = {
3261 3270 .name = "iSCSI Initiator over TCP/IP, v."
3262 3271 ISCSI_VERSION_STR,
3263   - .queuecommand = iscsi_queuecommand,
  3272 + .queuecommand = iscsi_queuecommand,
  3273 + .change_queue_depth = iscsi_change_queue_depth,
3264 3274 .can_queue = ISCSI_XMIT_CMDS_MAX - 1,
3265 3275 .sg_tablesize = ISCSI_SG_TABLESIZE,
3266   - .cmd_per_lun = ISCSI_CMD_PER_LUN,
3267   - .eh_abort_handler = iscsi_eh_abort,
3268   - .eh_host_reset_handler = iscsi_eh_host_reset,
3269   - .use_clustering = DISABLE_CLUSTERING,
  3276 + .cmd_per_lun = ISCSI_DEF_CMD_PER_LUN,
  3277 + .eh_abort_handler = iscsi_eh_abort,
  3278 + .eh_host_reset_handler = iscsi_eh_host_reset,
  3279 + .use_clustering = DISABLE_CLUSTERING,
3270 3280 .proc_name = "iscsi_tcp",
3271 3281 .this_id = -1,
3272 3282 };
drivers/scsi/iscsi_tcp.h
... ... @@ -71,7 +71,8 @@
71 71 #define ISCSI_MGMT_CMDS_MAX 32 /* must be power of 2 */
72 72 #define ISCSI_MGMT_ITT_OFFSET 0xa00
73 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 76 #define ISCSI_TCP_MAX_CMD_LEN 16
76 77  
77 78 #define ITT_MASK (0xfff)