From owner-freebsd-hackers Sat Dec 1 15: 6:46 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from mass.dis.org (mass.dis.org [216.240.45.41]) by hub.freebsd.org (Postfix) with ESMTP id F081537B419 for ; Sat, 1 Dec 2001 15:06:43 -0800 (PST) Received: from mass.dis.org (localhost [127.0.0.1]) by mass.dis.org (8.11.6/8.11.3) with ESMTP id fB1NB4v02853; Sat, 1 Dec 2001 15:11:04 -0800 (PST) (envelope-from msmith@mass.dis.org) Message-Id: <200112012311.fB1NB4v02853@mass.dis.org> X-Mailer: exmh version 2.1.1 10/15/1999 To: mark tinguely Cc: freebsd-hackers@FreeBSD.ORG, zzhang@cs.binghamton.edu Subject: Re: contiguous memory of a buffer In-reply-to: Your message of "Thu, 29 Nov 2001 15:34:15 CST." <200111292134.fATLYFn42233@web.cs.ndsu.nodak.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 01 Dec 2001 15:11:04 -0800 From: Mike Smith Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > > 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