Descriptor Rings
BCM5718 Programmer’s Guide
Broadcom
®
January 29, 2016 • 5718-PG108-R
Page 70
Producer and Consumer Indices
The Producer Index and the Consumer Index control which descriptors are valid for a given ring. Each ring will
have its own separate Producer and Consumer Indices. When incremented, the Producer Index can be used to
add elements to the ring. Conversely, when incremented, the Consumer Index is used to remove elements from
the ring. The difference between the Producer and Consumer Indices mark which descriptors are currently valid
in the ring (see
). When the Producer and Consumer Index are equal, the ring is empty. When the
producer is one behind the consumer, the ring is considered to be full.
Figure 11: Generic Ring Diagram
The drawing shows a generic host descriptor ring (could be either a send ring or a receive ring), and
demonstrates how the consumer and producer indices are used to determine which descriptors in
the ring are valid at any given moment in time.
1st
Cons
Prod
The delta between the producer and
consumer indices is indicated by the
shaded areas. These shaded
descriptors are considered to be valid
(non-empty) and thus need to be
processed.