diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2014-02-26 08:57:04 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2014-03-19 18:04:37 -0400 |
commit | 0759c666a39f16ab3a42d37b1e8fb0f246f97f52 (patch) | |
tree | 1fb92e8d39d403b3fc5018c32c0a9c1bdd7c50ce /drivers/scsi | |
parent | 6c78cc06583344244628bf29aa5b5fe43ff5d04e (diff) |
[SCSI] scsi_debug: add ability to enable clustering
This adds a module parameter to enable clustering.
Without enabling clustering support, the transfer length for read and
write scsi commands is limited upto 8MB when page size is 4KB and
sg_tablesize is 2048 (= SCSI_MAX_SG_CHAIN_SEGMENTS). I would like to
test commands with more than that transfer length.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Reviewed-by: Douglas Gilbert <dgilbert@interlog.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/scsi_debug.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 0bb1d49c3552..f3e9cc038d1d 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c | |||
@@ -196,6 +196,7 @@ static unsigned int scsi_debug_unmap_max_blocks = DEF_UNMAP_MAX_BLOCKS; | |||
196 | static unsigned int scsi_debug_unmap_max_desc = DEF_UNMAP_MAX_DESC; | 196 | static unsigned int scsi_debug_unmap_max_desc = DEF_UNMAP_MAX_DESC; |
197 | static unsigned int scsi_debug_write_same_length = DEF_WRITESAME_LENGTH; | 197 | static unsigned int scsi_debug_write_same_length = DEF_WRITESAME_LENGTH; |
198 | static bool scsi_debug_removable = DEF_REMOVABLE; | 198 | static bool scsi_debug_removable = DEF_REMOVABLE; |
199 | static bool scsi_debug_clustering; | ||
199 | 200 | ||
200 | static int scsi_debug_cmnd_count = 0; | 201 | static int scsi_debug_cmnd_count = 0; |
201 | 202 | ||
@@ -2762,6 +2763,7 @@ static int schedule_resp(struct scsi_cmnd * cmnd, | |||
2762 | */ | 2763 | */ |
2763 | module_param_named(add_host, scsi_debug_add_host, int, S_IRUGO | S_IWUSR); | 2764 | module_param_named(add_host, scsi_debug_add_host, int, S_IRUGO | S_IWUSR); |
2764 | module_param_named(ato, scsi_debug_ato, int, S_IRUGO); | 2765 | module_param_named(ato, scsi_debug_ato, int, S_IRUGO); |
2766 | module_param_named(clustering, scsi_debug_clustering, bool, S_IRUGO | S_IWUSR); | ||
2765 | module_param_named(delay, scsi_debug_delay, int, S_IRUGO | S_IWUSR); | 2767 | module_param_named(delay, scsi_debug_delay, int, S_IRUGO | S_IWUSR); |
2766 | module_param_named(dev_size_mb, scsi_debug_dev_size_mb, int, S_IRUGO); | 2768 | module_param_named(dev_size_mb, scsi_debug_dev_size_mb, int, S_IRUGO); |
2767 | module_param_named(dif, scsi_debug_dif, int, S_IRUGO); | 2769 | module_param_named(dif, scsi_debug_dif, int, S_IRUGO); |
@@ -2805,6 +2807,7 @@ MODULE_VERSION(SCSI_DEBUG_VERSION); | |||
2805 | 2807 | ||
2806 | MODULE_PARM_DESC(add_host, "0..127 hosts allowed(def=1)"); | 2808 | MODULE_PARM_DESC(add_host, "0..127 hosts allowed(def=1)"); |
2807 | MODULE_PARM_DESC(ato, "application tag ownership: 0=disk 1=host (def=1)"); | 2809 | MODULE_PARM_DESC(ato, "application tag ownership: 0=disk 1=host (def=1)"); |
2810 | MODULE_PARM_DESC(clustering, "when set enables larger transfers (def=0)"); | ||
2808 | MODULE_PARM_DESC(delay, "# of jiffies to delay response(def=1)"); | 2811 | MODULE_PARM_DESC(delay, "# of jiffies to delay response(def=1)"); |
2809 | MODULE_PARM_DESC(dev_size_mb, "size in MB of ram shared by devs(def=8)"); | 2812 | MODULE_PARM_DESC(dev_size_mb, "size in MB of ram shared by devs(def=8)"); |
2810 | MODULE_PARM_DESC(dif, "data integrity field type: 0-3 (def=0)"); | 2813 | MODULE_PARM_DESC(dif, "data integrity field type: 0-3 (def=0)"); |
@@ -3952,6 +3955,8 @@ static int sdebug_driver_probe(struct device * dev) | |||
3952 | sdbg_host = to_sdebug_host(dev); | 3955 | sdbg_host = to_sdebug_host(dev); |
3953 | 3956 | ||
3954 | sdebug_driver_template.can_queue = scsi_debug_max_queue; | 3957 | sdebug_driver_template.can_queue = scsi_debug_max_queue; |
3958 | if (scsi_debug_clustering) | ||
3959 | sdebug_driver_template.use_clustering = ENABLE_CLUSTERING; | ||
3955 | hpnt = scsi_host_alloc(&sdebug_driver_template, sizeof(sdbg_host)); | 3960 | hpnt = scsi_host_alloc(&sdebug_driver_template, sizeof(sdbg_host)); |
3956 | if (NULL == hpnt) { | 3961 | if (NULL == hpnt) { |
3957 | printk(KERN_ERR "%s: scsi_register failed\n", __func__); | 3962 | printk(KERN_ERR "%s: scsi_register failed\n", __func__); |