Subject: Re: FreeBSD Bus DMA (was Re: AdvanSys board support)
To: Justin T. Gibbs <>
From: Jason Thorpe <>
List: tech-kern
Date: 06/11/1998 16:55:18
On Thu, 11 Jun 1998 16:32:47 -0600 
 "Justin T. Gibbs" <> wrote:

 > In NetBSD, the dma map contains the S/G list of the mapping as well as
 > any implementation private data required to perform the mapping.  In

It's not an S/G list.  It is a list of DMA segments.  There is a subtle,
but real, difference.

It also contains other non-private data used during map sync operations.
Maybe you're not up to speed on what the NetBSD bus_dma interface actually
looks like.

 > Maybe you should go look at the code?  Or perhaps someone who has can
 > better describe how the interface is different.

I looked at the code.  Before I comment on it, I want to see your
design document (like the ones I posted to tech-kern during the design
phase of bus_dma).

 > I was talking about static storage of the MI S/G list. My complaint is that
 > a large portion of what is in the dma map (the MI S/G list) doesn't need to
 > be in the map at all and that by including it there, the implementation is
 > forced to consume more memory space than it might otherwise have to.

Yes, but as has been previously stated, including it in the map can avoid
inefficiency on other platforms.

If you're really that concerned about it, then by all means quantify it
for us.

Actually, let me do this.  Let's use the BusLogic driver as an example.

The i386 DMA map has 8 4-byte quantities + 17 8 byte quantities in each
map used by the bha driver.  That's 168 bytes.  It currently allocates
32 DMA maps for transfers, plus one for the mailboxes, for a total
of 33.  That's a total of 5544 bytes.  That's not really very much.

That, BTW, assumes that we have allocated the maxiumum number of maps.
If there aren't enough targets on the bus to warrant that many maps,
the usage is less.

Jason R. Thorpe                             
NASA Ames Research Center                            Home: +1 408 866 1912
NAS: M/S 258-5                                       Work: +1 650 604 0935
Moffett Field, CA 94035                             Pager: +1 650 428 6939