August, 1996
This paper describes four possible ways for a computer to move data between an adapter and PC memory.
In the two transfer methods that the paper describes first (PC DMA, and Bus Master DMA), the data completely bypasses the CPU, and the network adapter accesses PC memory directly.
In the two methods described second (Programmed Input/Output and Memory Mapped Input/Output) the CPU is central to the transfer process and indeed all of the data passes through the CPU.
Data transfer speeds are also affected by whether the data transfers use streaming or not. A transfer that uses streaming is one in which the device performing the transfer (the CPU or a network adapter, for example) does so without having to be told which memory address to use for each individual transfer that is required. Instead, the device is told which address to read to or write from first, and it simply increments the address it uses by 8-, 16-, or 32-bits (depending on the bus) for each subsequent memory access until the whole transfer is complete.
Finally, it is possible to install adapters designed for different buses into the same PC. For example, PCI computers often have an ISA bus as well as a PCI one, and can therefore use PCI or ISA adapters. Also, the EISA expansion slots in EISA computers can accept ISA adapters. An ISA adapter in an EISA slot, however, will use 16-bit transfers.
PC-controlled DMA transfers bypass the computer's CPU, and are managed by the PC's DMA Controller. When the adapter has data in its receive memory, it sends a control signal to the DMA controller to tell it that data is available. The DMA controller will have been pre-programmed by the CPU (that is, by the adapter driver) with an address in memory for received data. It tells the adapter the address it can access in memory, and the adapter writes the data to memory.
To transmit data, the CPU tells the DMA controller to move a block of data from an address in PC memory (determined by the adapter driver) to the adapter. Each time the adapter receives data from the bus it writes it to its transmit area of memory.
In Bus Master DMA the adapter controls the whole of the data transfer. When the adapter has received data, it signals a request to the system to let it use the bus. When the system grants it the use of the bus, the adapter writes the data directly into PC memory.
Similarly, to transmit data, the adapter signals a request to the system to let it use the bus. Then, when it has the use of the bus, it performs the transfer.
Modern PC buses allow adapters to use streaming for Bus Master transfers. Streaming is where the adapter signals to the PC's memory circuitry that the data is sequential, and the memory circuitry then increments the address automatically for each memory access that the transfer requires. This speeds up transfers because it enables the adapter to put an address onto the address bus only once (for the first access) instead of once for every memory access that a transfer requires.
Each time the CPU reads data from the I/O space, a processor on the adapter performs its own read operation to recover the data from the adapter's memory. It then puts the data onto the bus for the CPU, which writes it into memory. The CPU continues to read from the adapter's location in I/O space until the transfer is completed.
The size of a single data transfer is limit
To transmit data, the CPU reads from PC memory and writes to the adapter's fixed location in I/O space. Each time it performs a write operation (with 8-, 16-, or 32-bits of data), the processor on the adapter writes the data to the transmit area in adapter memory, and the adapter transmits it onto the network.
When the CPU accesses the area of mapped memory associated with the adapter, it uses the same signals as it would use if it were really accessing a memory chip. When the adapter circuitry responds to provide or accept data it does so by faking the response signals that a memory chip would use. For each access, the adapter either reads from the receive area on the adapter (for receive operations) or writes to the transmit area (for transmit operations).
If MMIO is being used to transfer streams of data, the CPU normally accesses the data sequentially starting from the base location of the adapter's address range. If MMIO is being used only to transfer control data, the adapter can enable the CPU to perform random accesses (the technique it uses for this is similar to the technique it uses to enable the CPU to access Shared Memory).
MMIO can be faster than PIO. In some systems it is faster for a CPU to move data between two addresses in PC memory than itis for the CPU to move data between an address in memory and an address in I/O space. When it is moving data between two memory locations, the CPU can burst data between them. This means that it does not need to provide the memory circuitry with the destination address for each read or write operation of a given data transfer. Once it has the address for the first read or write operation, the memory circuitry assumes that the address for the next one will simply be the next memory address along.
Todays CPUs can also use the following Repeat String instructions: REP INS, REP OUTS, and REP MOVS. These instructions perform the same operations as those associated with the IN, OUT, and MOV instructions, except that they repeat those operations a preset number of times. This is faster than executing individual transfers a number of times.
Most adapter cards support these String CPU instructions. The 32-bit variant of the instructions gives the fastest throughput, but support for the instructions depends upon the adapter hardware. Some 32-bit PCI adapters will not support them, and some 16-bit ISA adapters will (by providing two 16-bit transfers for each 32-bit access).

![[Adapter Installation]](../../../graphics/bk_hw.gif)
![[Driver Installation]](../../../graphics/bk_sw.gif)
![[Software Utilities]](../../../graphics/bk_cfg.gif)
![[Additional Information]](../../../graphics/bk_plus.gif)
