SPRUIU1C July 2020 – February 2024 DRA821U , DRA821U-Q1
As described in the TI DMA Architecture specification, whenever the Rx DMA engine needs to read a Free Descriptor Pointer from the Ring Accelerator, it is possible that the queue may be empty. When this occurs it is referred to as buffer starvation. The Ring Accelerator provides a message interface to the UDMA which provides increment and decrement information so that the UDMA can keep a local occupancy counter for each ring that it can access from the RINGACC. When the Rx engine requires a free descriptor it will first check to see if the local occupancy for that ring is non-zero. If the occupancy is zero, starvation has occurred. When starvation occurs the Rx DMA will respond in one of two ways depending on the value of the rx_error_handling bit in Rx Flow Table entry that is currently being used for that particular packet reception opportunity. If the rx_error_handling bit is 0, the Rx DMA will drop the packet and will return any descriptors which it may have previously allocated for that packet to the respective queues from which they were allocated. If the rx_error_handling bit is set, the Rx DMA is required to retry checking to see if a Free Descriptor is available at a later time.
A timer is provided in order to control the rate at which the retry attempts will occur. All channels share the same timer and the period of the timer is set using the TIMEOUT_CNT field in the UDMA_PERF_CTRL register. The TIMEOUT_CNT field specifies in clock cycles the minimum delay between subsequent attempts to check if a Free Descriptor is available on each individual channel.
Example: If the TIMEOUT_CNT is set to 256 and channel 1 finds its Free Descriptor queue empty on cycle 10, it will be required to wait until at least cycle 266 before it can make another attempt check the queue again. The actual number of cycles which will be waited by the DMA will typically be larger than the TIMEOUT_CNT value and this is not intended to be a highly precise operation. The critical requirement is that the DMA will not attempt to bring a channel into context to check if a buffer is available at a more frequent rate than is allowed.