Tape block size greater than MAXPHYS
Shivaram Upadhyayula
shivaram.u at quadstor.com
Mon Dec 29 09:22:21 UTC 2014
Hi,
It seems that currently any tape reads/writes greater than MAXPHYS
will fail. For example
cpi->maxio = 256 * 1024; /* Controller max io size 256K */
root at quadstorvtl # dd if=/dev/zero of=/dev/sa0 bs=256k count=1
sa0.0: request size=262144 > si_iosize_max=131072; cannot split request
sa0.0: request size=262144 > MAXPHYS=131072; cannot split request
dd: /dev/sa0: File too large
1+0 records in
0+0 records out
0 bytes transferred in 0.000390 secs (0 bytes/sec)
The first limitation comes from sys/cam/scsi/scsi_sa.c:saregister
/*
* If maxio isn't set, we fall back to DFLTPHYS. Otherwise we take
* the smaller of cpi.maxio or MAXPHYS.
*/
if (cpi.maxio == 0)
softc->maxio = DFLTPHYS;
else if (cpi.maxio > MAXPHYS)
softc->maxio = MAXPHYS;
else
softc->maxio = cpi.maxio;
softc limits maxio to MAXPHYS even if the controller supports a higher
maxio value. I tried removing the limitation which then led me to
reason for the actual reason for the limiation in
sys/kern/kern_physio.c:physio
/*
* If the driver does not want I/O to be split, that means that we
* need to reject any requests that will not fit into one buffer.
*/
if (dev->si_flags & SI_NOSPLIT &&
(uio->uio_resid > dev->si_iosize_max || uio->uio_resid > MAXPHYS ||
uio->uio_iovcnt > 1)) {
To maintain consistency of the block numbers SI_NOSPLIT has to be set,
but then to issue the entire request in a single bio the request size
will be limited to MAXPHYS.
Would is be correct to assume that the only way to increase the tape
block size for writes/reads is to increase MAXPHYS and recompile the
kernel ? (As of now on FreeBSD 10.1)
Regards,
Shivaram
--
QUADStor Open Source Storage Virtualization : Thin Provisioning, Data
Deduplication, VAAI, High Availability, Virtual Tape Library
http://www.quadstor.com
More information about the freebsd-scsi
mailing list