The ring accelerator (RINGACC or RA) is a hardware module that is responsible for accelerating management of various types of queues in the system. The RA accelerates passing of packets between a producer and consumer in normal system memory (including cached memory). The RA is capable of accelerating the read/write pointer maintenance and occupancy tracking operations.
The ring accelerator operates like a bus infrastructure bridge in that it passes transactions through it between a source and destination interface. As transactions are passed, the RA modifies the address, byte count, and transaction identifiers and internally updates the occupancies/pointers.
Each queue that the RA provides can operate in either exposed-ring-mode or private-queue-mode.
- The exposed ring mode allows software to directly access the underlying ring structure to add or remove items from the tail or head of the ring respectively. Whenever items are added or removed from a ring, the host software is required to write to a corresponding doorbell register to increment or decrement the ring occupancy. When using the exposed ring mode, no proxy is required between the software and the RA but all queue add operations require a memory fence to be performed to ensure that the data has landed in a snoopable cache before the doorbell register is written.
- The private queue mode provides an abstract view of the ring so that the host software does not need to know the actual physical address location or current read or write indexes of the ring. The private queue mode provides a memory window for each ring which when written redirects the write to the address pointed to by the write pointer and when read redirects the read to the address pointed to by the read pointer. The same address range is always used to push or pop elements from a given queue.
Rings are an implementation of a logical queue with the following limitations:
- Each ring has a finite size. When rings are used in exposed ring mode the following conditions apply:
- A separate operation is required to write/read the contents of a ring and to update the occupancy of the ring
- It is not straightforward to allow multiple producers to write to a ring or multiple consumers to read from a ring. Additional synchronization and pointer passing is required since rings require software to manage one of the pointers for the queue.
- An exposed ring cannot be used when software or hardware needs to both read and write the same queue (such as for a DMA RX free queue where errors can have the DMA write the element back onto the same RX free queue). Since software owns one side of the pointers and hardware owns the other, they cannot be kept coherent if either side needs to update either at any time.
The RA allows each ring to be configured to a different primary element size. Element sized chunks of data are placed onto and retrieved from rings when queuing or de-queueing occurs. Element sizes can be as small as 4 bytes or as large as 256 bytes.