Scatter-gather/DMA

Hi , Any one know how prevalent is use of either scatter gather or DMA or both in high end embedded systems? Examples would be great..

thanks dz

Reply to
drizzle
Loading thread data ...

Scatter-gather describes a capability of a DMA engine.

Is this a homework assignment?

Reply to
Mark McDougall

Scatter-Gather is one option of a DMA. THey are rarely found separately nowaday.

High-end interface cards provides them; Most Gigabit Ethernet cards now have them. Nearly all 10 Gbps Ethernet cards uses them.

Unfortunately for Ethernet card, not all operating systems makes good uses of Scatter-Gather. This problem stems from rigid TCP/IP protocol stacks that don't allow splitting of header/data payload. SCSI Scatter-Gather, on the other hand, are frequently supported by most OSes.

Now, for your homework assignments, tell me which O/Ses cannot support Scatter-Gather for Ethernet?

drizzle wrote:

Reply to
Capt. James. T. Kirk

thanks for the answers, and it is not a homework assignment, why do I always get this trite comment of it being a homework question, ..one you should know that classes are just starting, two it will probably be too specific (and hence not likely) a course to taught in school if it involves an assignment on scatter-gather

If I havent done a lot of harm to my cause, would you please tell me how are they used in these interface cards if the OS does not support them ? Again, it is not a homework assignment, I happen to be a researcher with expertise in totally different area...

dz

Capt. James. T. Kirk wrote:

Reply to
drizzle

Mainly because it *sounds* like a homework question. Most questions asked on this newsgroup are very specific and are asked by engineers either asking for advice on a particular device or have a problem with a particular device.

And I know that "classes are just starting" - in your particular area and age group - how???

Scatter-gather DMA refers to the ability of a DMA engine to automatically perform a string of DMA operations from non-contiguous memory blocks in a single operation. "Scatter" refers to the ability to write to a number of non-contiguous blocks, whilst "gather" refers to the ability to read from a number of such blocks. IIUC, there were odd controllers that could do one or the other, but not both!

Typically, scatter-gather requires the DMA programmer to provide a linked-list of so-called "descriptors" each of which contain ths source and destination address of (contiguous) blocks of memory. The DMA controller is (typically) told where this list resides in host memory, and fetches each descriptor before each transfer. Once the programer hits the "go" button, the whole list is done sans-CPU by the DMA engine.

Most controllers, even if they do support scatter-gather, also support single-block transfers - not via a descriptor stored in host memory but rather a few registers implemented in the DMA controller itself - so the programmer doesn't have to go to the trouble of allocating storage for a descriptor and setting it up. Thus to do a single-block transfer, the programmer sets up a few registers and hits "go" - the controller doesn't need to fetch the addresses from host memory.

So then, if you have a scatter-gather controller, it is (usually) possible to program it without enabling scatter-gather operation.

What this means is that if the OS provides a list of non-contiguous blocks for a DMA operation, the programmer has to break that request into a series of single-block transfers and program the DMA controller one block at a time.

Scatter-gather is of course preferable as it allows larger transfers to be done without CPU intervention. Multiple short DMAs become less useful as the DMA transfer size decreases due to interrupt latency and processing.

I can only think of a couple of reasons why a scatter-gather DMA controller would only be programmed in single-transfer mode. (1) the programmers were lazy. (2) the OS only supplies contiguous blocks for whatever purpose the DMA controller is being used.

Regards, Mark

Reply to
Mark McDougall

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.