Data Sheet

Inline Functions—Ethernet Controller I210
299
Tx Descriptor Completion Write–Back Address High/Low Registers (TDWBAH/TDWBAL 0-3):
These registers hold a value that can be used to enable operation of head write-back operation.
When TDWBAL.Head_WB_En is set and the RS bit is set in the Tx descriptor, following
corresponding data upload into packet buffer, the I210 writes the Transmit Descriptor Head value
for this queue to the 64 bit address specified by the TDWBAH and TDWBAL registers. The
Descriptor Head value is an offset from the base, and indicates the descriptor location hardware
processed and software can utilize for new Transmit packets. See Section 7.2.3 for additional
information.
The base register indicates the start of the circular descriptor queue and the length register indicates
the maximum size of the descriptor ring. The lower seven bits of length are hard wired to 0b. Byte
addresses within the descriptor buffer are computed as follows: address = base + (ptr * 16), where ptr
is the value in the hardware head or tail register.
The size chosen for the head and tail registers permit a maximum of 65536 (64 KB) descriptors, or
approximately 16 KB packets for the transmit queue given an average of four descriptors per packet.
Once activated, hardware fetches the descriptor indicated by the hardware head register. The hardware
tail register points one descriptor beyond the last valid descriptor. Software can read and detect which
packets have already been processed by hardware as follows:
Read the head register to determine which packets (those logically before the head) have been
transferred to the on-chip FIFO or transmitted. Note that this method is not recommended as races
between the internal update of the head register and the actual write-back of descriptors might
occur.
Read the value of the head as stored at the address pointed by the TDWBAH/TDWBAL pair.
•Track the DD bits in the descriptor ring.
All the registers controlling the descriptor rings behavior should be set before transmit is enabled, apart
from the tail registers which are used during the regular flow of data.
Note: Software can determine if a packet has been sent by either of three methods: setting the RS
bit in the transmit descriptor command field or by performing a PIO read of the transmit head
register, or by reading the head value written by the I210 to the address pointed by the
TDWBAL and TDWBAH registers (see Section 7.2.3 for details). Checking the transmit
descriptor DD bit or head value in memory eliminates a potential race condition. All descriptor
data is written to the I/O bus prior to incrementing the head register, but a read of the head
register could pass the data write in systems performing I/O write buffering. Updates to
transmit descriptors use the same I/O write path and follow all data writes. Consequently,
they are not subject to the race.
In general, hardware prefetches packet data prior to transmission. Hardware typically updates the
value of the head pointer after storing data in the transmit FIFO.
7.2.2.5 Transmit Descriptor Fetching
When the TXDCTL[n].ENABLE bit is set and the on-chip descriptor cache is empty, a fetch happens as
soon as any descriptors are made available (Host increments the TDT[n] tail pointer). The descriptor
processing strategy for transmit descriptors is essentially the same as for receive descriptors except
that a different set of thresholds are used. The number of on-chip transmit descriptors per queue is 24.
When there is an on-chip descriptor buffer empty, a descriptor fetch happens as soon as any
descriptors are made available (host writes to the tail pointer). If several on-chip transmit descriptor
queues needs to fetch descriptors, descriptors from queues that are more starved are fetched. If a
number of queues have a starvation level, highest indexed queue is served first and so forth, down to
the lowest indexed queue.