After a channel has been set up it can begin to be used to transmit packets. Packet transmission in Host mode involves the following steps:
- The Host is made aware of one or more chunks of data in memory that need to be transmitted as a packet. This may involve directly sourcing data from the Host or it may involve data which has been forwarded from another data source in the system.
- The Host allocates and populates a host packet descriptor. The host will initialize the following fields within the packet descriptor:
- Descriptor Type (set to Host)
- Packet Length indicating the total number of bytes that are to be read from all of the buffers for this packet.
- Source Tag
- Destination Tag (application specific)
- Packet Type
- Any protocol specific flags for the given packet type
- Buffer Pointer with the byte aligned address of the first chunk of buffer data
- Buffer Length with the number of bytes in the first chunk of buffer data
- Descriptor reclamation policy fields indicating the mode and queue number for recycling the packet after transmission is complete.
- The Next Descriptor Pointer with the address of the next descriptor in this packet. If this is the last chunk of data in the packet, this field must be set to zero
- Any protocol specific descriptor sections that are required for the given packet type or system configuration
- The Host allocates and populates host buffer descriptors as necessary to point to any remaining chunks of data that belong to this packet. The host will initialize the following fields within the host buffer descriptor:
- Buffer Descriptor reclamation policy fields (if the intention is to have the DMA automatically recycle the buffer descriptors as they are transmitted).
- Buffer Pointer with the byte aligned address of the given chunk of buffer data
- Buffer Length with the number of bytes in the given chunk of buffer data
- The Next Descriptor Pointer with the address of the next descriptor in this packet. If this is the last chunk of data in the packet, this field must be set to zero
- The Host writes queues the packet onto one of the Transmit Queues for the desired DMA channel. Channels may provide more than one Tx Queue and may provide a particular prioritization policy between the queues. This behavior is application specific and is controlled by the DMA controller/scheduler implementation.
- The Ring Accelerator provides a level sensitive status signal for the queue which indicates if any packets are currently pending. This level sensitive status line is sent to the hardware block which is responsible for scheduling DMA operations.
- The DMA controller is eventually brought into context for the corresponding channel and begins to process the packet.
- The DMA controller reads the packet descriptor pointer from the Ring Accelerator
- The DMA controller reads the packet descriptor from memory
- Step 9:
- If the return policy bit (PD Word 2, bit 15) is
cleared, the DMA controller empties each buffer in sequence by
transmitting the contents in one or more block data moves. As each
buffer is emptied, the DMA will read the next buffer descriptor to
obtain the pointer and size of the data buffer as well as the pointer to
the next descriptor in the chain.
- If the return policy bit is set, the DMA controller
empties each buffer in sequence by transmitting the contents in one or
more block data moves.
- Step 10:
- If the return policy bit
(PD Word 2, bit 15) is cleared, when all data for the packet has been
transmitted as specified in the packet size field, the DMA will write
the pointer to the packet descriptor to the queue specified in the
return queue number fields of the packet descriptor.
- If the return policy bit
is set, as each buffer is emptied the DMA will write the buffer
descriptor pointer to the queue specified in the return queue number
field of the buffer descriptor. The DMA will also read the next buffer
descriptor to obtain the pointer and size of the data buffer, the return
queue information for the descriptor, as well as the pointer to the next
descriptor in the chain.
- Step 11:
- If the return policy bit
(PD Word 2, bit 15) is cleared, after the Packet Descriptor pointer has
been written, the Ring Accelerator will indicate the status of the Tx
Completion Queue by sending an up event .
- If the return policy bit
is set, when all data for the packet has been transmitted as specified
in the packet size field, if the current buffer is not marked as end of
packet (via a null next descriptor pointer), the DMA will continue to
walk the list returning buffer descriptors to the appropriate queues as
described in step 10.
- Step 12:
- If the return policy bit
(PD Word 2, bit 15) is cleared, the Interrupt Aggregator receives the up
event and sets the corresponding bit in the interrupt status register as
programmed in the interrupt mapping registers. This in turn causes an
interrupt to the Host to be generated.
- If the return policy bit
is set, when all buffers have been returned, the DMA will write the
pointer to the packet descriptor to the queue specified in the return
queue number fields of the packet descriptor.
- If the return policy bit (PD Word 2, bit 15) is
cleared, host responds to status change from the Ring Accelerator (via the
Interrupt Aggregator) and performs garbage collection as necessary for the
packet.
- If the return policy bit (PD Word 2, bit 15) is
cleared, once the garbage collection causes the queue to become empty, the Ring
Accelerator will send a down event to the Interrupt Aggregator which will clear
the corresponding bit in the Interrupt Status Register and potentially de-assert
the interrupt line.
If the return policy bit (PD Word 2, bit 15) is cleared, the complete process is illustrated on Figure 10-8.
If the return policy bit is set, the complete process is illustrated on Figure 10-9.
Figure 10-8 shows a diagram of the host packet transmit operation – complete packet return.
Figure 10-9 shows a diagram of the host packet transmit operation – automatic buffer recycling packet return.