Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Wireless pcmcia Driver-Transmition,Queuing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Wireless pcmcia Driver-Transmition,Queuing



Sure, there's truth to that. Coalescing packets into fewer physical segments is *usually* only necessary when your hardware has trouble with scatter/gather of many segments or some other limitation. Some of the hardware I wrote for had scatter/gather issues, so I have to coalesce those buffers into a single segment.

So, you have two choices. One is to pass a large value for "maxSegs" when doing IOMbufMemoryCursor->initWithSpecification(). If the maxSegs value is large (say greater than 5), my tests show the mbuf will likely come in below that number (even on a system with heavily fragmented memory); therefore, calling getPhysicalSegmentsWithCoalesce() won't cause coalescing to actually occur since it is below the threshold.

Or, you can run IOMbufMemoryCursor->genPhysicalSegments() which will just write out a vector containing the full list of buffer segments.

In my tests I haven't seen a significant difference between either approach. Of course, YMMV. :-)

cr

On Sunday, September 15, 2002, at 01:56 AM, Bob wrote:

I'd suggest not accessing the fields of the mbuf directly. If the code
is using an IOMbufMemoryCursor then I'd suggest calling
IOMbufMemoryCursor->getPhysicalSegmentsWithCoalesce() which takes a few
parameters one of which is a vector. If the vector length returned by
the call is greater than one, you can get the physical address of the
segment by accessing vector[ index ].location. This will allow Apple to
twiddle the mbuf structures behind your back without breaking your code.

Surely there is a performance hit if you do this?? Especially if your hardware means that you have
to copy the mbuf list to a transmit buffer anyway because of DMA/or other hardware limitations.
Coalesce() implies buffer copying and reallocation of the buffer chain which in general is
considered a good thing to minimise in any network stack --- less copying is better performance ???

Unless the MAC is especially efficient at buffer allocation and copying ??
_______________________________________________
darwin-drivers mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-drivers
Do not post admin requests to the list. They will be ignored.
_______________________________________________
darwin-drivers mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-drivers
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Wireless pcmcia Driver-Transmition,Queuing (From: Bob <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.