Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: map@zk3.dec.com (Mark Parenti)
Subject: Re: Physically contiguous large buffers.
Date: 1996/03/29	[thread overview]
Message-ID: <4jgot8$e6r@zk2nws.zko.dec.com> (raw)
In-Reply-To: 4j6ba9$avv@news.xmission.com


Nagesh Chintada <nagesh@newbridge.com> wrote:
>Hi folks,
>
>Does anyone know HOW I can allocate buffers that are physically contiguous AND
>large enough to hold about 10kbytes of data, under OSF1? The context is a 
>network device driver receive buffer, which needs to DMA frames of the size
>10kbytes. Any info will be helpful.

Nagesh,

It depends on what you mean by "physically contiguous". If you mean from the
point of view of the device out on the PCI bus (which is what I think you
mean based on your description) then you don't have to do anything special.
When you call dma_map_load() the appropriate mapping will happen to make
your buffer appear to be physically contiguous on the PCI bus even if it
is not physically contiguous in main memory. The PCI adapter hardware then 
does the scatter gather on the fly during the actual transfer. There are
some situations where you may not get a physically contiguous bus map by
default (although I've never seen one in practice). If you really require
the buffer to be physically congtigous you should set the DMA_CONTIG flag
in your dma_map_alloc()/dma_map_load() calls. This will guarantee that either
you get contiguous mapping or the request will fail. With 10K you are not
going to have a problem, this is mostly an issue for multi-MB buffers (we
might not have enough contiguous scatter gather registers).

If you really need the buffer to be physically contiguous in system memory
then you have two choice. On V3.x you will need to use the undocumented
method described in steal_mem.c. In V4.0 there is a contig_alloc() call
that allows drivers to allocate physically contiguous chunks of main
memory. As was mentioned in Chris' post, anything less than 8K (1 page) is
guaranteed to be physically contiguous regardless of what method you use.


Mark Parenti
Digital Equipment Corporation
UNIX Engineering Group




      reply	other threads:[~1996-03-29  5:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-03-21  5:00 Physically contiguous large buffers Nagesh Chintada
1996-03-25  5:00 ` Christian Worley
1996-03-29  5:00   ` Mark Parenti [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox