Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Jan 1998 03:41:36 +1100
From:      Bruce Evans <bde@zeta.org.au>
To:        bde@zeta.org.au, gibbs@plutotech.com
Cc:        cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, cvs-sys@FreeBSD.ORG, mike@smith.net.au
Subject:   Re: cvs commit: src/sys/i386/isa wfd.c
Message-ID:  <199801291641.DAA03949@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>>Some of them can only can only handle 16 scatter-gather segments, so
>>they can only handle transfer sizes <= 64K, which is currently MAXPHYS/2.
>>They are never asked to handle > 64K because filesystem block sizes are
>>limited to MAXBSIZE = 64K and raw i/o sizes are limited to DFLTPHYS = 64K.
>
>And may not be able to handle even 64k if the raw I/O is not page aligned.

Thanks for reading this far.

minphys() reduces the i/o size to handle the non-page-aligned case.
Most (all?) SCSI driver minphys routines don't bother checking for
alignment.  Most of them pretend that they have one fewer scatter/
gather segment than they actually have.  This works OK because most
of them have one segment to spare.  aha1542.c has exactly one segment
to spare.  aic6360.c seems to be the only one limited to 16 segments,
and the only one that doesn't pretend to hand one segment fewer.  This
is broken if it is ever passed a 64K misaligned request.  I think
such requests don't occur.  minphys() weeds out the ones for raw i/o,
and filesystem buffers are aligned, and I think there are no requests
for anything else (e.g., for bp->b_data = &staticarray[0]).

BTW, the bug in PR5599 (scsi_ioctl() broken) is probably caused by
limiting the size to bp->b_kvasize in minphys().  It shouldn't do this
if bp->b_kvasize == 0.  scsi_ioctl() should use geteblk(0) instead
of malloc() to allocate a buffer.  fd_ioctl() also abuses malloc() to
allocate a buffer for formatting.  This is safe because the buffer is
only used internally, but takes more code.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199801291641.DAA03949>