Data Sheet

Ethernet Controller I210 —Inline Functions
276
Software inserts receive descriptors by advancing the tail pointer(s) to refer to the address of the entry
just beyond the last valid descriptor. This is accomplished by writing the descriptor tail register(s) with
the offset of the entry beyond the last valid descriptor. The hardware adjusts its internal tail pointer(s)
accordingly. As packets arrive, they are stored in memory and the head pointer(s) is incremented by
hardware. When the head pointer(s) is equal to the tail pointer(s), the queue(s) is empty. Hardware
stops storing packets in system memory until software advances the tail pointer(s), making more
receive buffers available.
The receive descriptor head and tail pointers reference to 16-byte blocks of memory. Shaded boxes in
Figure 7-7 represent descriptors that have stored incoming packets but have not yet been recognized
by software. Software can determine if a receive buffer is valid by reading the descriptors in memory.
Any descriptor with a non-zero DD value has been processed by the hardware and is ready to be
handled by the software.
Note: The head pointer points to the next descriptor that is written back. After the descriptor write-
back operation completes, this pointer is incremented by the number of descriptors written
back. Hardware owns all descriptors between [head... tail]. Any descriptor not in this range is
owned by software.
The receive descriptor rings are described by the following registers:
Receive Descriptor Base Address (RDBA3 to RDBA0) register:
This register indicates the start of the descriptor ring buffer. This 64-bit address is aligned on a 16-
byte boundary and is stored in two consecutive 32-bit registers. Note that hardware ignores the
lower 4 bits.
Receive Descriptor Length (RDLEN3 to RDLEN0) registers:
This register determines the number of bytes allocated to the circular buffer. This value must be a
multiple of 128 (the maximum cache-line size). Since each descriptor is 16 bytes in length, the
total number of receive descriptors is always a multiple of eight.
Receive Descriptor Head (RDH3 to RDH0) registers:
This register holds a value that is an offset from the base and indicates the in-progress descriptor.
There can be up to 64 KB, 8 KB descriptors in the circular buffer. Hardware maintains a shadow
copy that includes those descriptors completed but not yet stored in memory.
Receive Descriptor Tail (RDT3 to RDT0) registers:
This register holds a value that is an offset from the base and identifies the location beyond the last
descriptor hardware can process. This is the location where software writes the first new descriptor.
If software statically allocates buffers, uses legacy receive descriptors, and uses memory read to check
for completed descriptors, it has to zero the status byte in the descriptor before bumping the tail
pointer to make it ready for reuse by hardware. Zeroing the status byte is not a hardware requirement
but is necessary for performing an in-memory scan.
All the registers controlling the descriptor rings behavior should be set before receive is enabled, apart
from the tail registers that are used during the regular flow of data.
7.1.4.5.1 Low Receive Descriptors Threshold
As described above, the size of the receive queues is measured by the number of receive descriptors.
During run time the software processes completed descriptors and then increments the Receive
Descriptor Tail registers (RDT). At the same time, hardware might post new packets received from the
LAN incrementing the Receive Descriptor Head registers (RDH) for each used descriptor.
The number of usable (free) descriptors for the hardware is the distance between Tail and Head
registers. When the Tail reaches the Head, there are no free descriptors and further packets might be
either dropped or block the receive FIFO. In order to avoid this behavior, the I210 might generate a low