Re: IOMemoryCursor segment size issue
Re: IOMemoryCursor segment size issue
- Subject: Re: IOMemoryCursor segment size issue
- From: Godfrey van der Linden <email@hidden>
- Date: Thu, 13 Jun 2002 10:30:15 -0700
G'day Peter,
The problem is that the physical memory you are I/Oing from is
fragmented. In X it is very likely that you will always get a
maximum physically contiguous I/O of only 4k because that is the page
size of the VM system.
You have a couple of solutions.
1> Limit your I/Os to 1/2 Meg
2> Or if your DMA engine is capable then my solution is to setup
multiple DMA programs then at 'Filter' time (i.e. at primary
interrupt time) reprogram the DMA engine with the new DMA.
I personally have used approach 2 with really dumb hardware, i.e. no
page list at all just a single physical address and length. Using
Filter dma chaining I managed to get 112Mb/s throughput with a not
bad 5% CPU load.
Remember if you go for this solution totally prepare the ENTIRE I/O
before starting the first I/O running. There is very little you are
allowed to do at primary interrupt time, you certainly CAN NOT call
genPhysicalSegments.
Godfrey
At 16:43 +0100 02-6-13, Peter Young wrote:
Hi,
I am creating an IOMemoryCursor using:
CursP = IOMemoryCursor::withSpecification ( SegFn, UINT_MAX, UINT_MAX,
1 );
which gives me a valid MemoryCursor.
I then call CursP->genPhysicalSegments( MemDescP,
start,
Segments,
NumSegments,
MaxTransferSize,
&BytesToTransfer );
to create the DMA address/len pairs I require in 'Segments'.
When I debug SegFn, the Segment.length field is ALWAYS 4096 regardless of
the values passed to the withSpecification function above. This gives me a
max transfer size of 0.5Mb (128 entries), which is way too small for my
requirements.
Questions:
1. Why does my segment function ONLY get 4k segments? What am I doing wrong?
2. When 'wiring' the User buffer, do I just need to 'prepare' the
MemoryDescriptor,
or do I need to 'map' it as well?
_______________________________________________
darwin-kernel mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/darwin-kernel
Do not post admin requests to the list. They will be ignored.