]> git.baikalelectronics.ru Git - kernel.git/commit
scsi_debug: allow huge transfer length for read/write commands
authorAkinobu Mita <akinobu.mita@gmail.com>
Mon, 2 Jun 2014 13:56:49 +0000 (22:56 +0900)
committerChristoph Hellwig <hch@lst.de>
Thu, 17 Jul 2014 20:07:31 +0000 (22:07 +0200)
commitfa8baf3229c34bb41107e1998e0f5758f31a5134
tree3bba23e0ace91ecf9aac6404c13720bc8a7f813e
parentecd706778d8a198bd6b9f5bf0cf1924907c06112
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>
drivers/scsi/scsi_debug.c