The Host to Card (H2C) and Card to Host (C2H) descriptors are fetched by the Descriptor Engine in one of two modes: Internal mode, and Descriptor bypass mode. The descriptor engine maintains per queue contexts where it tracks software (SW) producer index pointer (PIDX), consumer index pointer (CIDX), base address of the queue (BADDR), and queue configurations for each queue. The descriptor engine uses a round robin algorithm for fetching the descriptors. The descriptor engine has separate buffers for H2C and C2H queues, and ensures it never fetches more descriptors than available space. The descriptor engine will have only one DMA read outstanding per queue at a time and can read as many descriptors as can fit in a MRRS. The descriptor engine is responsible for reordering the out of order completions and ensures that descriptors for queues are always in order.
The descriptor bypass can be enabled on a per-queue basis and the fetched descriptors, after buffering, are sent to the respective bypass output interface instead of directly to the H2C or C2H engine. In internal mode, based on the context settings the descriptors are sent to delete per H2C memory mapped (MM), C2H MM, H2C Stream, or C2H Stream engines.
The descriptor engine is also responsible for generating the status descriptor for the completion of the DMA operations. With the exception of C2H Stream mode, all modes use this mechanism to convey completion of each DMA operation so that software can reclaim descriptors and free up any associated buffers. This is indicated by the CIDX field of the status descriptor.
To put a limit on the number of fetched descriptors (for example, to limit
the amount of buffering required to store the descriptor), it is possible to turn-on and
throttle credit on a per-queue basis. In this mode, the descriptor engine fetches the
descriptors up to available credit, and the total number of descriptors fetched per
queue is limited to the credit provided. The user logic can return the credit through
the dsc_crdt
interface. The credit is in the granularity
of the size of the descriptor.
To help a user-developed traffic manager prioritize the workload, the
available descriptor to be fetched (incremental PIDX value) of the PIDX update is sent
to the user logic on the tm_dsc_sts
interface. Using
this interface it is possible to implement a design that can prioritize and optimize the
descriptor storage.