From owner-cvs-all Thu Jan 29 08:50:53 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id IAA05712 for cvs-all-outgoing; Thu, 29 Jan 1998 08:50:53 -0800 (PST) (envelope-from owner-cvs-all@FreeBSD.ORG) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id IAA05652; Thu, 29 Jan 1998 08:50:23 -0800 (PST) (envelope-from bde@godzilla.zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.7/8.8.7) id DAA03949; Fri, 30 Jan 1998 03:41:36 +1100 Date: Fri, 30 Jan 1998 03:41:36 +1100 From: Bruce Evans Message-Id: <199801291641.DAA03949@godzilla.zeta.org.au> To: bde@zeta.org.au, gibbs@plutotech.com Subject: Re: cvs commit: src/sys/i386/isa wfd.c Cc: cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, cvs-sys@FreeBSD.ORG, mike@smith.net.au Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-To-Unsubscribe: mail to majordomo@FreeBSD.org "unsubscribe cvs-all" >>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