Re: Max DMA size
Hmm. My knowledge may be a bit dated in this matter, but as I recall the 8237 DMA controller standard on PCs only supports DMA requests up to 128k (and then only on the upper 4 DMA channels). The low 4 DMA channels were byte-granular and could only transfer 64k. Am I correct in assuming from this discussion that the state of affairs is somewhat different nowadays? Uh, yeah. Standard PCI h/w usually has 32 bit dma engines, and a lot have 64 bit. To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: Max DMA size
On Thu, 6 Jul 2000, Matthew Jacob wrote: Uh, yeah. Standard PCI h/w usually has 32 bit dma engines, and a lot have 64 bit. Neat, I'll have to go read my books on PCI now. :) Kelly -- Kelly Yancey - [EMAIL PROTECTED] - Belmont, CA System Administrator, eGroups.com http://www.egroups.com/ Maintainer, BSD Driver Database http://www.posi.net/freebsd/drivers/ Coordinator, Team FreeBSDhttp://www.posi.net/freebsd/Team-FreeBSD/ To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Max DMA size
Can anyone tell me what factors determine the max DMA size (DMA counter on each controller or PCI bus related)? What is the typical max DMA size for a SCSI disk connected to a PCI bus? It seems to be much larger than MAXPHYS (128K). If so, does it mean we are not using full potential of DMA? So what's the problem if we enlarge MAXPHYS? Any help is appreciated. -Zhihui To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: Max DMA size
Can anyone tell me what factors determine the max DMA size (DMA counter on each controller or PCI bus related)? What is the typical max DMA size for a SCSI disk connected to a PCI bus? It seems to be much larger than MAXPHYS (128K). If so, does it mean we are not using full potential of DMA? So what's the problem if we enlarge MAXPHYS? You can enlarge MAXPHYS, but watch out that you don't also then make MAXBSIZE so big that the creation of buffers eats up all of your memory. IMO MAXPHYS is way too small, but there are a number of current VM implementation reasons why making it larger by default is not right. To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: Max DMA size
On Thu, Jul 06, 2000 at 15:51:34 -0400, Zhihui Zhang wrote: Can anyone tell me what factors determine the max DMA size (DMA counter on each controller or PCI bus related)? What is the typical max DMA size for a SCSI disk connected to a PCI bus? It seems to be much larger than MAXPHYS (128K). If so, does it mean we are not using full potential of DMA? So what's the problem if we enlarge MAXPHYS? Any help is appreciated. MAXPHYS determines the size of struct buf, which at the moment determines the maximum size of a given DMA transaction to a SCSI controller. Typical modern SCSI controllers can handle much more than MAXPHYS data (currently 128K) at a time. An exception is the Adaptec 154x controllers, which can only handle about 64K of data. (Thus the reason I/O through the CAM passthrough interface is limited to 64K instead of the full 128K. We will have that limitation until we implement a way of determining the maximum DMA size allowable for a given controller.) However, as Matt said, you have to be careful about increasing MAXPHYS too much, since you could end up allocating too much memory. I think a better approach to increasing the amount of data that can be sent at one time to a SCSI controller would be to implement some sort of buffer chaining scheme. Most SCSI controllers can do scatter/gather DMA, and CAM has facilities for it, so that would probably be the easiest way to go. Ken -- Kenneth Merry [EMAIL PROTECTED] To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: Max DMA size
On Thu, 6 Jul 2000, Kenneth D. Merry wrote: On Thu, Jul 06, 2000 at 15:51:34 -0400, Zhihui Zhang wrote: Can anyone tell me what factors determine the max DMA size (DMA counter on each controller or PCI bus related)? What is the typical max DMA size for a SCSI disk connected to a PCI bus? It seems to be much larger than MAXPHYS (128K). If so, does it mean we are not using full potential of DMA? So what's the problem if we enlarge MAXPHYS? Any help is appreciated. MAXPHYS determines the size of struct buf, which at the moment determines the maximum size of a given DMA transaction to a SCSI controller. Typical modern SCSI controllers can handle much more than MAXPHYS data (currently 128K) at a time. An exception is the Adaptec 154x controllers, which can only handle about 64K of data. (Thus the reason I/O through the CAM passthrough interface is limited to 64K instead of the full 128K. We will have that limitation until we implement a way of determining the maximum DMA size allowable for a given controller.) However, as Matt said, you have to be careful about increasing MAXPHYS too much, since you could end up allocating too much memory. I think a better approach to increasing the amount of data that can be sent at one time to a SCSI controller would be to implement some sort of buffer chaining scheme. Most SCSI controllers can do scatter/gather DMA, and CAM has facilities for it, so that would probably be the easiest way to go. Hmm. My knowledge may be a bit dated in this matter, but as I recall the 8237 DMA controller standard on PCs only supports DMA requests up to 128k (and then only on the upper 4 DMA channels). The low 4 DMA channels were byte-granular and could only transfer 64k. Am I correct in assuming from this discussion that the state of affairs is somewhat different nowadays? Kelly -- Kelly Yancey - [EMAIL PROTECTED] - Belmont, CA System Administrator, eGroups.com http://www.egroups.com/ Maintainer, BSD Driver Database http://www.posi.net/freebsd/drivers/ Coordinator, Team FreeBSDhttp://www.posi.net/freebsd/Team-FreeBSD/ To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message