diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2014-06-02 09:56:49 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-07-17 16:07:31 -0400 |
commit | 6bb5e6e772f5f71413e290eb9c6a475e9a6d39e2 (patch) | |
tree | 3bba23e0ace91ecf9aac6404c13720bc8a7f813e /drivers/scsi/scsi_debug.c | |
parent | 8ed5a4d2f7d8b296a22fed7ec2b543c0500d13be (diff) |
scsi_debug: allow huge transfer length for read/write commands
This change enables to test read/write commands with huge transfer
length such as 1GB. For example:
# modprobe scsi_debug dev_size_mb=1024 clustering=1 opts=1
# cat /sys/block/$DEV/queue/max_hw_sectors_kb > \
/sys/block/$DEV/queue/max_sectors_kb
# fio --name=test --rw=write --bs=1g --size=1g --filename=/dev/$DEV \
--mem=mmaphuge --direct=1
The data type of max_sectors in scsi_host_template has been extended
to unsigned int by the previous change. So we can increase it from
0xffff to 0xffffffff to allow such huge transfer length.
Also, this increases sg_tablesize and max_segment_size, otherwise the
maximum transfer length is limited to 64MB.
(sg_tablesize * max_segment_size = 256 * 256KB)
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Acked by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/scsi/scsi_debug.c')
-rw-r--r-- | drivers/scsi/scsi_debug.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 1328a2621070..c4ad52c2ec69 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c | |||
@@ -2484,7 +2484,7 @@ static int scsi_debug_slave_configure(struct scsi_device *sdp) | |||
2484 | if (sdp->host->cmd_per_lun) | 2484 | if (sdp->host->cmd_per_lun) |
2485 | scsi_adjust_queue_depth(sdp, SDEBUG_TAGGED_QUEUING, | 2485 | scsi_adjust_queue_depth(sdp, SDEBUG_TAGGED_QUEUING, |
2486 | sdp->host->cmd_per_lun); | 2486 | sdp->host->cmd_per_lun); |
2487 | blk_queue_max_segment_size(sdp->request_queue, 256 * 1024); | 2487 | blk_queue_max_segment_size(sdp->request_queue, -1U); |
2488 | if (scsi_debug_no_uld) | 2488 | if (scsi_debug_no_uld) |
2489 | sdp->no_uld_attach = 1; | 2489 | sdp->no_uld_attach = 1; |
2490 | return 0; | 2490 | return 0; |
@@ -3946,9 +3946,9 @@ static struct scsi_host_template sdebug_driver_template = { | |||
3946 | .bios_param = scsi_debug_biosparam, | 3946 | .bios_param = scsi_debug_biosparam, |
3947 | .can_queue = SCSI_DEBUG_CANQUEUE, | 3947 | .can_queue = SCSI_DEBUG_CANQUEUE, |
3948 | .this_id = 7, | 3948 | .this_id = 7, |
3949 | .sg_tablesize = 256, | 3949 | .sg_tablesize = SCSI_MAX_SG_CHAIN_SEGMENTS, |
3950 | .cmd_per_lun = 16, | 3950 | .cmd_per_lun = 16, |
3951 | .max_sectors = 0xffff, | 3951 | .max_sectors = -1U, |
3952 | .use_clustering = DISABLE_CLUSTERING, | 3952 | .use_clustering = DISABLE_CLUSTERING, |
3953 | .module = THIS_MODULE, | 3953 | .module = THIS_MODULE, |
3954 | }; | 3954 | }; |