* Physically contiguous large buffers.
@ 1996-03-21 5:00 Nagesh Chintada
1996-03-25 5:00 ` Christian Worley
0 siblings, 1 reply; 3+ messages in thread
From: Nagesh Chintada @ 1996-03-21 5:00 UTC (permalink / raw)
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.
Thanks in advance,
Nagesh
--
______________________________________________________________________________
| Nagesh Chintada nagesh@newbridge.com |
| Sr. Software Engineer |
| Newbridge Networks, Inc. |
| Tel:703-708-5922 Fax:703-708-5959 http://www.vivid.newbridge.com |
______________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Physically contiguous large buffers.
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
0 siblings, 1 reply; 3+ messages in thread
From: Christian Worley @ 1996-03-25 5:00 UTC (permalink / raw)
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
Digital claims that DUX 4.x will have a kenal function to allocate physically
contiguous memory. In 3.x, you're going to have to use scatter/gather
techniques. Then again, memory blocks on AXP's are 8K; you could probably
get an 8K chunk.
Chris
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Physically contiguous large buffers.
1996-03-25 5:00 ` Christian Worley
@ 1996-03-29 5:00 ` Mark Parenti
0 siblings, 0 replies; 3+ messages in thread
From: Mark Parenti @ 1996-03-29 5:00 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1996-03-29 5:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox