4 * Copyright(c) 2010-2012 Intel Corporation. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
17 * * Neither the name of Intel Corporation nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 * Derived from FreeBSD's bufring.h
38 **************************************************************************
40 * Copyright (c) 2007-2009 Kip Macy kmacy@freebsd.org
41 * All rights reserved.
43 * Redistribution and use in source and binary forms, with or without
44 * modification, are permitted provided that the following conditions are met:
46 * 1. Redistributions of source code must retain the above copyright notice,
47 * this list of conditions and the following disclaimer.
49 * 2. The name of Kip Macy nor the names of other
50 * contributors may be used to endorse or promote products derived from
51 * this software without specific prior written permission.
53 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
54 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
55 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
56 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
57 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
58 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
59 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
60 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
61 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
62 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
63 * POSSIBILITY OF SUCH DAMAGE.
65 ***************************************************************************/
74 * The Ring Manager is a fixed-size queue, implemented as a table of
75 * pointers. Head and tail pointers are modified atomically, allowing
76 * concurrent access to it. It has the following features:
78 * - FIFO (First In First Out)
79 * - Maximum size is fixed; the pointers are stored in a table.
80 * - Lockless implementation.
81 * - Multi- or single-consumer dequeue.
82 * - Multi- or single-producer enqueue.
86 * Note: the ring implementation is not preemptable. A lcore must not
87 * be interrupted by another task that uses the same ring.
96 #include <sys/queue.h>
98 #include <rte_common.h>
99 #include <rte_memory.h>
100 #include <rte_lcore.h>
101 #include <rte_atomic.h>
102 #include <rte_branch_prediction.h>
105 #ifdef RTE_LIBRTE_RING_DEBUG
107 * A structure that stores the ring statistics (per-lcore).
109 struct rte_ring_debug_stats {
110 uint64_t enq_success_bulk; /**< Successful enqueues number. */
111 uint64_t enq_success_objs; /**< Objects successfully enqueued. */
112 uint64_t enq_quota_bulk; /**< Successful enqueues above watermark. */
113 uint64_t enq_quota_objs; /**< Objects enqueued above watermark. */
114 uint64_t enq_fail_bulk; /**< Failed enqueues number. */
115 uint64_t enq_fail_objs; /**< Objects that failed to be enqueued. */
116 uint64_t deq_success_bulk; /**< Successful dequeues number. */
117 uint64_t deq_success_objs; /**< Objects successfully dequeued. */
118 uint64_t deq_fail_bulk; /**< Failed dequeues number. */
119 uint64_t deq_fail_objs; /**< Objects that failed to be dequeued. */
120 } __rte_cache_aligned;
123 #define RTE_RING_NAMESIZE 32 /**< The maximum length of a ring name. */
126 * An RTE ring structure.
128 * The producer and the consumer have a head and a tail index. The particularity
129 * of these index is that they are not between 0 and size(ring). These indexes
130 * are between 0 and 2^32, and we mask their value when we access the ring[]
131 * field. Thanks to this assumption, we can do subtractions between 2 index
132 * values in a modulo-32bit base: that's why the overflow of the indexes is not
136 TAILQ_ENTRY(rte_ring) next; /**< Next in list. */
138 char name[RTE_RING_NAMESIZE]; /**< Name of the ring. */
139 int flags; /**< Flags supplied at creation. */
141 /** Ring producer status. */
143 volatile uint32_t bulk_default; /**< Default bulk count. */
144 uint32_t watermark; /**< Maximum items before EDQUOT. */
145 uint32_t sp_enqueue; /**< True, if single producer. */
146 uint32_t size; /**< Size of ring. */
147 uint32_t mask; /**< Mask (size-1) of ring. */
148 volatile uint32_t head; /**< Producer head. */
149 volatile uint32_t tail; /**< Producer tail. */
150 } prod __rte_cache_aligned;
152 /** Ring consumer status. */
154 volatile uint32_t bulk_default; /**< Default bulk count. */
155 uint32_t sc_dequeue; /**< True, if single consumer. */
156 uint32_t size; /**< Size of the ring. */
157 uint32_t mask; /**< Mask (size-1) of ring. */
158 volatile uint32_t head; /**< Consumer head. */
159 volatile uint32_t tail; /**< Consumer tail. */
160 } cons __rte_cache_aligned;
163 #ifdef RTE_LIBRTE_RING_DEBUG
164 struct rte_ring_debug_stats stats[RTE_MAX_LCORE];
167 void * volatile ring[0] \
168 __rte_cache_aligned; /**< Memory space of ring starts here. */
171 #define RING_F_SP_ENQ 0x0001 /**< The default enqueue is "single-producer". */
172 #define RING_F_SC_DEQ 0x0002 /**< The default dequeue is "single-consumer". */
175 * When debug is enabled, store ring statistics.
177 * A pointer to the ring.
179 * The name of the statistics field to increment in the ring.
181 * The number to add to the object-oriented statistics.
183 #ifdef RTE_LIBRTE_RING_DEBUG
184 #define __RING_STAT_ADD(r, name, n) do { \
185 unsigned __lcore_id = rte_lcore_id(); \
186 r->stats[__lcore_id].name##_objs += n; \
187 r->stats[__lcore_id].name##_bulk += 1; \
190 #define __RING_STAT_ADD(r, name, n) do {} while(0)
194 * Create a new ring named *name* in memory.
196 * This function uses ``memzone_reserve()`` to allocate memory. Its size is
197 * set to *count*, which must be a power of two. Water marking is
198 * disabled by default. The default bulk count is initialized to 1.
199 * Note that the real usable ring size is *count-1* instead of
203 * The name of the ring.
205 * The size of the ring (must be a power of 2).
207 * The *socket_id* argument is the socket identifier in case of
208 * NUMA. The value can be *SOCKET_ID_ANY* if there is no NUMA
209 * constraint for the reserved zone.
211 * An OR of the following:
212 * - RING_F_SP_ENQ: If this flag is set, the default behavior when
213 * using ``rte_ring_enqueue()`` or ``rte_ring_enqueue_bulk()``
214 * is "single-producer". Otherwise, it is "multi-producers".
215 * - RING_F_SC_DEQ: If this flag is set, the default behavior when
216 * using ``rte_ring_dequeue()`` or ``rte_ring_dequeue_bulk()``
217 * is "single-consumer". Otherwise, it is "multi-consumers".
219 * On success, the pointer to the new allocated ring. NULL on error with
220 * rte_errno set appropriately. Possible errno values include:
221 * - E_RTE_NO_CONFIG - function could not get pointer to rte_config structure
222 * - E_RTE_SECONDARY - function was called from a secondary process instance
223 * - E_RTE_NO_TAILQ - no tailq list could be got for the ring list
224 * - EINVAL - count provided is not a power of 2
225 * - ENOSPC - the maximum number of memzones has already been allocated
226 * - EEXIST - a memzone with the same name already exists
227 * - ENOMEM - no appropriate memory area found in which to create memzone
229 struct rte_ring *rte_ring_create(const char *name, unsigned count,
230 int socket_id, unsigned flags);
233 * Set the default bulk count for enqueue/dequeue.
235 * The parameter *count* is the default number of bulk elements to
236 * get/put when using ``rte_ring_*_{en,de}queue_bulk()``. It must be
237 * greater than 0 and less than half of the ring size.
240 * A pointer to the ring structure.
242 * A new water mark value.
244 * - 0: Success; default_bulk_count changed.
245 * - -EINVAL: Invalid count value.
248 rte_ring_set_bulk_count(struct rte_ring *r, unsigned count)
250 if (unlikely(count == 0 || count >= r->prod.size))
253 r->prod.bulk_default = r->cons.bulk_default = count;
258 * Get the default bulk count for enqueue/dequeue.
261 * A pointer to the ring structure.
263 * The default bulk count for enqueue/dequeue.
265 static inline unsigned
266 rte_ring_get_bulk_count(struct rte_ring *r)
268 return r->prod.bulk_default;
272 * Change the high water mark.
274 * If *count* is 0, water marking is disabled. Otherwise, it is set to the
275 * *count* value. The *count* value must be greater than 0 and less
276 * than the ring size.
278 * This function can be called at any time (not necessarilly at
282 * A pointer to the ring structure.
284 * The new water mark value.
286 * - 0: Success; water mark changed.
287 * - -EINVAL: Invalid water mark value.
289 int rte_ring_set_water_mark(struct rte_ring *r, unsigned count);
292 * Dump the status of the ring to the console.
295 * A pointer to the ring structure.
297 void rte_ring_dump(const struct rte_ring *r);
300 * Enqueue several objects on the ring (multi-producers safe).
302 * This function uses a "compare and set" instruction to move the
303 * producer index atomically.
306 * A pointer to the ring structure.
308 * A pointer to a table of void * pointers (objects).
310 * The number of objects to add in the ring from the obj_table. The
311 * value must be strictly positive.
313 * - 0: Success; objects enqueue.
314 * - -EDQUOT: Quota exceeded. The objects have been enqueued, but the
315 * high water mark is exceeded.
316 * - -ENOBUFS: Not enough room in the ring to enqueue, no object is enqueued.
319 rte_ring_mp_enqueue_bulk(struct rte_ring *r, void * const *obj_table,
322 uint32_t prod_head, prod_next;
323 uint32_t cons_tail, free_entries;
326 uint32_t mask = r->prod.mask;
329 /* move prod.head atomically */
331 prod_head = r->prod.head;
332 cons_tail = r->cons.tail;
333 /* The subtraction is done between two unsigned 32bits value
334 * (the result is always modulo 32 bits even if we have
335 * prod_head > cons_tail). So 'free_entries' is always between 0
336 * and size(ring)-1. */
337 free_entries = (mask + cons_tail - prod_head);
339 /* check that we have enough room in ring */
340 if (unlikely(n > free_entries)) {
341 __RING_STAT_ADD(r, enq_fail, n);
345 prod_next = prod_head + n;
346 success = rte_atomic32_cmpset(&r->prod.head, prod_head,
348 } while (unlikely(success == 0));
350 /* write entries in ring */
351 for (i = 0; likely(i < n); i++)
352 r->ring[(prod_head + i) & mask] = obj_table[i];
355 /* return -EDQUOT if we exceed the watermark */
356 if (unlikely(((mask + 1) - free_entries + n) > r->prod.watermark)) {
358 __RING_STAT_ADD(r, enq_quota, n);
362 __RING_STAT_ADD(r, enq_success, n);
366 * If there are other enqueues in progress that preceeded us,
367 * we need to wait for them to complete
369 while (unlikely(r->prod.tail != prod_head))
372 r->prod.tail = prod_next;
377 * Enqueue several objects on a ring (NOT multi-producers safe).
380 * A pointer to the ring structure.
382 * A pointer to a table of void * pointers (objects).
384 * The number of objects to add in the ring from the obj_table. The
385 * value must be strictly positive.
387 * - 0: Success; objects enqueued.
388 * - -EDQUOT: Quota exceeded. The objects have been enqueued, but the
389 * high water mark is exceeded.
390 * - -ENOBUFS: Not enough room in the ring to enqueue; no object is enqueued.
393 rte_ring_sp_enqueue_bulk(struct rte_ring *r, void * const *obj_table,
396 uint32_t prod_head, cons_tail;
397 uint32_t prod_next, free_entries;
399 uint32_t mask = r->prod.mask;
402 prod_head = r->prod.head;
403 cons_tail = r->cons.tail;
404 /* The subtraction is done between two unsigned 32bits value
405 * (the result is always modulo 32 bits even if we have
406 * prod_head > cons_tail). So 'free_entries' is always between 0
407 * and size(ring)-1. */
408 free_entries = mask + cons_tail - prod_head;
410 /* check that we have enough room in ring */
411 if (unlikely(n > free_entries)) {
412 __RING_STAT_ADD(r, enq_fail, n);
416 prod_next = prod_head + n;
417 r->prod.head = prod_next;
419 /* write entries in ring */
420 for (i = 0; likely(i < n); i++)
421 r->ring[(prod_head + i) & mask] = obj_table[i];
424 /* return -EDQUOT if we exceed the watermark */
425 if (unlikely(((mask + 1) - free_entries + n) > r->prod.watermark)) {
427 __RING_STAT_ADD(r, enq_quota, n);
431 __RING_STAT_ADD(r, enq_success, n);
434 r->prod.tail = prod_next;
439 * Enqueue several objects on a ring.
441 * This function calls the multi-producer or the single-producer
442 * version depending on the default behavior that was specified at
443 * ring creation time (see flags).
446 * A pointer to the ring structure.
448 * A pointer to a table of void * pointers (objects).
450 * The number of objects to add in the ring from the obj_table.
452 * - 0: Success; objects enqueued.
453 * - -EDQUOT: Quota exceeded. The objects have been enqueued, but the
454 * high water mark is exceeded.
455 * - -ENOBUFS: Not enough room in the ring to enqueue; no object is enqueued.
458 rte_ring_enqueue_bulk(struct rte_ring *r, void * const *obj_table,
461 if (r->prod.sp_enqueue)
462 return rte_ring_sp_enqueue_bulk(r, obj_table, n);
464 return rte_ring_mp_enqueue_bulk(r, obj_table, n);
468 * Enqueue one object on a ring (multi-producers safe).
470 * This function uses a "compare and set" instruction to move the
471 * producer index atomically.
474 * A pointer to the ring structure.
476 * A pointer to the object to be added.
478 * - 0: Success; objects enqueued.
479 * - -EDQUOT: Quota exceeded. The objects have been enqueued, but the
480 * high water mark is exceeded.
481 * - -ENOBUFS: Not enough room in the ring to enqueue; no object is enqueued.
484 rte_ring_mp_enqueue(struct rte_ring *r, void *obj)
486 return rte_ring_mp_enqueue_bulk(r, &obj, 1);
490 * Enqueue one object on a ring (NOT multi-producers safe).
493 * A pointer to the ring structure.
495 * A pointer to the object to be added.
497 * - 0: Success; objects enqueued.
498 * - -EDQUOT: Quota exceeded. The objects have been enqueued, but the
499 * high water mark is exceeded.
500 * - -ENOBUFS: Not enough room in the ring to enqueue; no object is enqueued.
503 rte_ring_sp_enqueue(struct rte_ring *r, void *obj)
505 return rte_ring_sp_enqueue_bulk(r, &obj, 1);
509 * Enqueue one object on a ring.
511 * This function calls the multi-producer or the single-producer
512 * version, depending on the default behaviour that was specified at
513 * ring creation time (see flags).
516 * A pointer to the ring structure.
518 * A pointer to the object to be added.
520 * - 0: Success; objects enqueued.
521 * - -EDQUOT: Quota exceeded. The objects have been enqueued, but the
522 * high water mark is exceeded.
523 * - -ENOBUFS: Not enough room in the ring to enqueue; no object is enqueued.
526 rte_ring_enqueue(struct rte_ring *r, void *obj)
528 if (r->prod.sp_enqueue)
529 return rte_ring_sp_enqueue(r, obj);
531 return rte_ring_mp_enqueue(r, obj);
535 * Dequeue several objects from a ring (multi-consumers safe).
537 * This function uses a "compare and set" instruction to move the
538 * consumer index atomically.
541 * A pointer to the ring structure.
543 * A pointer to a table of void * pointers (objects) that will be filled.
545 * The number of objects to dequeue from the ring to the obj_table,
546 * must be strictly positive
548 * - 0: Success; objects dequeued.
549 * - -ENOENT: Not enough entries in the ring to dequeue; no object is
553 rte_ring_mc_dequeue_bulk(struct rte_ring *r, void **obj_table, unsigned n)
555 uint32_t cons_head, prod_tail;
556 uint32_t cons_next, entries;
559 uint32_t mask = r->prod.mask;
561 /* move cons.head atomically */
563 cons_head = r->cons.head;
564 prod_tail = r->prod.tail;
565 /* The subtraction is done between two unsigned 32bits value
566 * (the result is always modulo 32 bits even if we have
567 * cons_head > prod_tail). So 'entries' is always between 0
568 * and size(ring)-1. */
569 entries = (prod_tail - cons_head);
571 /* check that we have enough entries in ring */
572 if (unlikely(n > entries)) {
573 __RING_STAT_ADD(r, deq_fail, n);
577 cons_next = cons_head + n;
578 success = rte_atomic32_cmpset(&r->cons.head, cons_head,
580 } while (unlikely(success == 0));
584 for (i = 0; likely(i < n); i++) {
585 obj_table[i] = r->ring[(cons_head + i) & mask];
589 * If there are other dequeues in progress that preceeded us,
590 * we need to wait for them to complete
592 while (unlikely(r->cons.tail != cons_head))
595 __RING_STAT_ADD(r, deq_success, n);
596 r->cons.tail = cons_next;
601 * Dequeue several objects from a ring (NOT multi-consumers safe).
604 * A pointer to the ring structure.
606 * A pointer to a table of void * pointers (objects) that will be filled.
608 * The number of objects to dequeue from the ring to the obj_table,
609 * must be strictly positive.
611 * - 0: Success; objects dequeued.
612 * - -ENOENT: Not enough entries in the ring to dequeue; no object is
616 rte_ring_sc_dequeue_bulk(struct rte_ring *r, void **obj_table, unsigned n)
618 uint32_t cons_head, prod_tail;
619 uint32_t cons_next, entries;
621 uint32_t mask = r->prod.mask;
623 cons_head = r->cons.head;
624 prod_tail = r->prod.tail;
625 /* The subtraction is done between two unsigned 32bits value
626 * (the result is always modulo 32 bits even if we have
627 * cons_head > prod_tail). So 'entries' is always between 0
628 * and size(ring)-1. */
629 entries = prod_tail - cons_head;
631 /* check that we have enough entries in ring */
632 if (unlikely(n > entries)) {
633 __RING_STAT_ADD(r, deq_fail, n);
637 cons_next = cons_head + n;
638 r->cons.head = cons_next;
642 for (i = 0; likely(i < n); i++) {
643 obj_table[i] = r->ring[(cons_head + i) & mask];
646 __RING_STAT_ADD(r, deq_success, n);
647 r->cons.tail = cons_next;
652 * Dequeue several objects from a ring.
654 * This function calls the multi-consumers or the single-consumer
655 * version, depending on the default behaviour that was specified at
656 * ring creation time (see flags).
659 * A pointer to the ring structure.
661 * A pointer to a table of void * pointers (objects) that will be filled.
663 * The number of objects to dequeue from the ring to the obj_table.
665 * - 0: Success; objects dequeued.
666 * - -ENOENT: Not enough entries in the ring to dequeue, no object is
670 rte_ring_dequeue_bulk(struct rte_ring *r, void **obj_table, unsigned n)
672 if (r->cons.sc_dequeue)
673 return rte_ring_sc_dequeue_bulk(r, obj_table, n);
675 return rte_ring_mc_dequeue_bulk(r, obj_table, n);
679 * Dequeue one object from a ring (multi-consumers safe).
681 * This function uses a "compare and set" instruction to move the
682 * consumer index atomically.
685 * A pointer to the ring structure.
687 * A pointer to a void * pointer (object) that will be filled.
689 * - 0: Success; objects dequeued.
690 * - -ENOENT: Not enough entries in the ring to dequeue; no object is
694 rte_ring_mc_dequeue(struct rte_ring *r, void **obj_p)
696 return rte_ring_mc_dequeue_bulk(r, obj_p, 1);
700 * Dequeue one object from a ring (NOT multi-consumers safe).
703 * A pointer to the ring structure.
705 * A pointer to a void * pointer (object) that will be filled.
707 * - 0: Success; objects dequeued.
708 * - -ENOENT: Not enough entries in the ring to dequeue, no object is
712 rte_ring_sc_dequeue(struct rte_ring *r, void **obj_p)
714 return rte_ring_sc_dequeue_bulk(r, obj_p, 1);
718 * Dequeue one object from a ring.
720 * This function calls the multi-consumers or the single-consumer
721 * version depending on the default behaviour that was specified at
722 * ring creation time (see flags).
725 * A pointer to the ring structure.
727 * A pointer to a void * pointer (object) that will be filled.
729 * - 0: Success, objects dequeued.
730 * - -ENOENT: Not enough entries in the ring to dequeue, no object is
734 rte_ring_dequeue(struct rte_ring *r, void **obj_p)
736 if (r->cons.sc_dequeue)
737 return rte_ring_sc_dequeue(r, obj_p);
739 return rte_ring_mc_dequeue(r, obj_p);
743 * Test if a ring is full.
746 * A pointer to the ring structure.
748 * - 1: The ring is full.
749 * - 0: The ring is not full.
752 rte_ring_full(const struct rte_ring *r)
754 uint32_t prod_tail = r->prod.tail;
755 uint32_t cons_tail = r->cons.tail;
756 return (((cons_tail - prod_tail - 1) & r->prod.mask) == 0);
760 * Test if a ring is empty.
763 * A pointer to the ring structure.
765 * - 1: The ring is empty.
766 * - 0: The ring is not empty.
769 rte_ring_empty(const struct rte_ring *r)
771 uint32_t prod_tail = r->prod.tail;
772 uint32_t cons_tail = r->cons.tail;
773 return !!(cons_tail == prod_tail);
777 * Return the number of entries in a ring.
780 * A pointer to the ring structure.
782 * The number of entries in the ring.
784 static inline unsigned
785 rte_ring_count(const struct rte_ring *r)
787 uint32_t prod_tail = r->prod.tail;
788 uint32_t cons_tail = r->cons.tail;
789 return ((prod_tail - cons_tail) & r->prod.mask);
793 * Return the number of free entries in a ring.
796 * A pointer to the ring structure.
798 * The number of free entries in the ring.
800 static inline unsigned
801 rte_ring_free_count(const struct rte_ring *r)
803 uint32_t prod_tail = r->prod.tail;
804 uint32_t cons_tail = r->cons.tail;
805 return ((cons_tail - prod_tail - 1) & r->prod.mask);
809 * Dump the status of all rings on the console
811 void rte_ring_list_dump(void);
814 * Search a ring from its name
817 * The name of the ring.
819 * The pointer to the ring matching the name, or NULL if not found,
820 * with rte_errno set appropriately. Possible rte_errno values include:
821 * - ENOENT - required entry not available to return.
823 struct rte_ring *rte_ring_lookup(const char *name);
829 #endif /* _RTE_RING_H_ */