Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 01 Dec 2001 15:11:04 -0800
From:      Mike Smith <msmith@freebsd.org>
To:        mark tinguely <tinguely@web.cs.ndsu.nodak.edu>
Cc:        freebsd-hackers@FreeBSD.ORG, zzhang@cs.binghamton.edu
Subject:   Re: contiguous memory of a buffer 
Message-ID:  <200112012311.fB1NB4v02853@mass.dis.org>
In-Reply-To: Your message of "Thu, 29 Nov 2001 15:34:15 CST." <200111292134.fATLYFn42233@web.cs.ndsu.nodak.edu> 

next in thread | previous in thread | raw e-mail | index | archive | help
> > I am wondering whether we need contiguous memory for a PHYSICAL buffer to
> > perform the DMA I/O.
> 
> yes. The DMA request should either not cross a physical page or
> if the request does cross a physical page, those pages must be
> contiguous.

Er, no.

> the exception to this is if your DMA card has a memory management
> unit, and you are sharing the same virtual to physical map with the
> MMU and the host memory allocation space (for a driver, the kernel
> physical map).

Er, no again.

All but the very worst busmaster DMA controllers accept what's called a 
"scatter/gather" list, which is a list of physical addresses and matching 
lengths, over which the logical transfer is broken up.

Contiguous memory is not typically required for DMA transactions.  It can 
be easier to construct some control structures by using contiguous 
memory, but modern controller design recognises that contiguous memory 
can be hard to come by, and thus few controllers actually mandate it.

-- 
... every activity meets with opposition, everyone who acts has his
rivals and unfortunately opponents also.  But not because people want
to be opponents, rather because the tasks and relationships force
people to take different points of view.  [Dr. Fritz Todt]
           V I C T O R Y   N O T   V E N G E A N C E



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




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