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.
33 * version: DPDK.L.1.2.3-3
37 * Derived from FreeBSD's bufring.h
39 **************************************************************************
41 * Copyright (c) 2007-2009 Kip Macy kmacy@freebsd.org
42 * All rights reserved.
44 * Redistribution and use in source and binary forms, with or without
45 * modification, are permitted provided that the following conditions are met:
47 * 1. Redistributions of source code must retain the above copyright notice,
48 * this list of conditions and the following disclaimer.
50 * 2. The name of Kip Macy nor the names of other
51 * contributors may be used to endorse or promote products derived from
52 * this software without specific prior written permission.
54 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
55 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
56 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
57 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
58 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
59 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
60 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
61 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
62 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
63 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
64 * POSSIBILITY OF SUCH DAMAGE.
66 ***************************************************************************/
75 * The Ring Manager is a fixed-size queue, implemented as a table of
76 * pointers. Head and tail pointers are modified atomically, allowing
77 * concurrent access to it. It has the following features:
79 * - FIFO (First In First Out)
80 * - Maximum size is fixed; the pointers are stored in a table.
81 * - Lockless implementation.
82 * - Multi- or single-consumer dequeue.
83 * - Multi- or single-producer enqueue.
87 * Note: the ring implementation is not preemptable. A lcore must not
88 * be interrupted by another task that uses the same ring.
97 #include <sys/queue.h>
99 #include <rte_common.h>
100 #include <rte_memory.h>
101 #include <rte_lcore.h>
102 #include <rte_atomic.h>
103 #include <rte_branch_prediction.h>
106 #ifdef RTE_LIBRTE_RING_DEBUG
108 * A structure that stores the ring statistics (per-lcore).
110 struct rte_ring_debug_stats {
111 uint64_t enq_success_bulk; /**< Successful enqueues number. */
112 uint64_t enq_success_objs; /**< Objects successfully enqueued. */
113 uint64_t enq_quota_bulk; /**< Successful enqueues above watermark. */
114 uint64_t enq_quota_objs; /**< Objects enqueued above watermark. */
115 uint64_t enq_fail_bulk; /**< Failed enqueues number. */
116 uint64_t enq_fail_objs; /**< Objects that failed to be enqueued. */
117 uint64_t deq_success_bulk; /**< Successful dequeues number. */
118 uint64_t deq_success_objs; /**< Objects successfully dequeued. */
119 uint64_t deq_fail_bulk; /**< Failed dequeues number. */
120 uint64_t deq_fail_objs; /**< Objects that failed to be dequeued. */
121 } __rte_cache_aligned;
124 #define RTE_RING_NAMESIZE 32 /**< The maximum length of a ring name. */
127 * An RTE ring structure.
129 * The producer and the consumer have a head and a tail index. The particularity
130 * of these index is that they are not between 0 and size(ring). These indexes
131 * are between 0 and 2^32, and we mask their value when we access the ring[]
132 * field. Thanks to this assumption, we can do subtractions between 2 index
133 * values in a modulo-32bit base: that's why the overflow of the indexes is not
137 TAILQ_ENTRY(rte_ring) next; /**< Next in list. */
139 char name[RTE_RING_NAMESIZE]; /**< Name of the ring. */
140 int flags; /**< Flags supplied at creation. */
142 /** Ring producer status. */
144 volatile uint32_t bulk_default; /**< Default bulk count. */
145 uint32_t watermark; /**< Maximum items before EDQUOT. */
146 uint32_t sp_enqueue; /**< True, if single producer. */
147 uint32_t size; /**< Size of ring. */
148 uint32_t mask; /**< Mask (size-1) of ring. */
149 volatile uint32_t head; /**< Producer head. */
150 volatile uint32_t tail; /**< Producer tail. */
151 } prod __rte_cache_aligned;
153 /** Ring consumer status. */
155 volatile uint32_t bulk_default; /**< Default bulk count. */
156 uint32_t sc_dequeue; /**< True, if single consumer. */
157 uint32_t size; /**< Size of the ring. */
158 uint32_t mask; /**< Mask (size-1) of ring. */
159 volatile uint32_t head; /**< Consumer head. */
160 volatile uint32_t tail; /**< Consumer tail. */
161 } cons __rte_cache_aligned;
164 #ifdef RTE_LIBRTE_RING_DEBUG
165 struct rte_ring_debug_stats stats[RTE_MAX_LCORE];
168 void * volatile ring[0] \
169 __rte_cache_aligned; /**< Memory space of ring starts here. */
172 #define RING_F_SP_ENQ 0x0001 /**< The default enqueue is "single-producer". */
173 #define RING_F_SC_DEQ 0x0002 /**< The default dequeue is "single-consumer". */
176 * When debug is enabled, store ring statistics.
178 * A pointer to the ring.
180 * The name of the statistics field to increment in the ring.
182 * The number to add to the object-oriented statistics.
184 #ifdef RTE_LIBRTE_RING_DEBUG
185 #define __RING_STAT_ADD(r, name, n) do { \
186 unsigned __lcore_id = rte_lcore_id(); \
187 r->stats[__lcore_id].name##_objs += n; \
188 r->stats[__lcore_id].name##_bulk += 1; \
191 #define __RING_STAT_ADD(r, name, n) do {} while(0)
195 * Create a new ring named *name* in memory.
197 * This function uses ``memzone_reserve()`` to allocate memory. Its size is
198 * set to *count*, which must be a power of two. Water marking is
199 * disabled by default. The default bulk count is initialized to 1.
200 * Note that the real usable ring size is *count-1* instead of
204 * The name of the ring.
206 * The size of the ring (must be a power of 2).
208 * The *socket_id* argument is the socket identifier in case of
209 * NUMA. The value can be *SOCKET_ID_ANY* if there is no NUMA
210 * constraint for the reserved zone.
212 * An OR of the following:
213 * - RING_F_SP_ENQ: If this flag is set, the default behavior when
214 * using ``rte_ring_enqueue()`` or ``rte_ring_enqueue_bulk()``
215 * is "single-producer". Otherwise, it is "multi-producers".
216 * - RING_F_SC_DEQ: If this flag is set, the default behavior when
217 * using ``rte_ring_dequeue()`` or ``rte_ring_dequeue_bulk()``
218 * is "single-consumer". Otherwise, it is "multi-consumers".
220 * On success, the pointer to the new allocated ring. NULL on error with
221 * rte_errno set appropriately. Possible errno values include:
222 * - E_RTE_NO_CONFIG - function could not get pointer to rte_config structure
223 * - E_RTE_SECONDARY - function was called from a secondary process instance
224 * - E_RTE_NO_TAILQ - no tailq list could be got for the ring list
225 * - EINVAL - count provided is not a power of 2
226 * - ENOSPC - the maximum number of memzones has already been allocated
227 * - EEXIST - a memzone with the same name already exists
228 * - ENOMEM - no appropriate memory area found in which to create memzone
230 struct rte_ring *rte_ring_create(const char *name, unsigned count,
231 int socket_id, unsigned flags);
234 * Set the default bulk count for enqueue/dequeue.
236 * The parameter *count* is the default number of bulk elements to
237 * get/put when using ``rte_ring_*_{en,de}queue_bulk()``. It must be
238 * greater than 0 and less than half of the ring size.
241 * A pointer to the ring structure.
243 * A new water mark value.
245 * - 0: Success; default_bulk_count changed.
246 * - -EINVAL: Invalid count value.
249 rte_ring_set_bulk_count(struct rte_ring *r, unsigned count)
251 if (unlikely(count == 0 || count >= r->prod.size))
254 r->prod.bulk_default = r->cons.bulk_default = count;
259 * Get the default bulk count for enqueue/dequeue.
262 * A pointer to the ring structure.
264 * The default bulk count for enqueue/dequeue.
266 static inline unsigned
267 rte_ring_get_bulk_count(struct rte_ring *r)
269 return r->prod.bulk_default;
273 * Change the high water mark.
275 * If *count* is 0, water marking is disabled. Otherwise, it is set to the
276 * *count* value. The *count* value must be greater than 0 and less
277 * than the ring size.
279 * This function can be called at any time (not necessarilly at
283 * A pointer to the ring structure.
285 * The new water mark value.
287 * - 0: Success; water mark changed.
288 * - -EINVAL: Invalid water mark value.
290 int rte_ring_set_water_mark(struct rte_ring *r, unsigned count);
293 * Dump the status of the ring to the console.
296 * A pointer to the ring structure.
298 void rte_ring_dump(const struct rte_ring *r);
301 * Enqueue several objects on the ring (multi-producers safe).
303 * This function uses a "compare and set" instruction to move the
304 * producer index atomically.
307 * A pointer to the ring structure.
309 * A pointer to a table of void * pointers (objects).
311 * The number of objects to add in the ring from the obj_table. The
312 * value must be strictly positive.
314 * - 0: Success; objects enqueue.
315 * - -EDQUOT: Quota exceeded. The objects have been enqueued, but the
316 * high water mark is exceeded.
317 * - -ENOBUFS: Not enough room in the ring to enqueue, no object is enqueued.
320 rte_ring_mp_enqueue_bulk(struct rte_ring *r, void * const *obj_table,
323 uint32_t prod_head, prod_next;
324 uint32_t cons_tail, free_entries;
327 uint32_t mask = r->prod.mask;
330 /* move prod.head atomically */
332 prod_head = r->prod.head;
333 cons_tail = r->cons.tail;
334 /* The subtraction is done between two unsigned 32bits value
335 * (the result is always modulo 32 bits even if we have
336 * prod_head > cons_tail). So 'free_entries' is always between 0
337 * and size(ring)-1. */
338 free_entries = (mask + cons_tail - prod_head);
340 /* check that we have enough room in ring */
341 if (unlikely(n > free_entries)) {
342 __RING_STAT_ADD(r, enq_fail, n);
346 prod_next = prod_head + n;
347 success = rte_atomic32_cmpset(&r->prod.head, prod_head,
349 } while (unlikely(success == 0));
351 /* write entries in ring */
352 for (i = 0; likely(i < n); i++)
353 r->ring[(prod_head + i) & mask] = obj_table[i];
356 /* return -EDQUOT if we exceed the watermark */
357 if (unlikely(((mask + 1) - free_entries + n) > r->prod.watermark)) {
359 __RING_STAT_ADD(r, enq_quota, n);
363 __RING_STAT_ADD(r, enq_success, n);
367 * If there are other enqueues in progress that preceeded us,
368 * we need to wait for them to complete
370 while (unlikely(r->prod.tail != prod_head))
373 r->prod.tail = prod_next;
378 * Enqueue several objects on a ring (NOT multi-producers safe).
381 * A pointer to the ring structure.
383 * A pointer to a table of void * pointers (objects).
385 * The number of objects to add in the ring from the obj_table. The
386 * value must be strictly positive.
388 * - 0: Success; objects enqueued.
389 * - -EDQUOT: Quota exceeded. The objects have been enqueued, but the
390 * high water mark is exceeded.
391 * - -ENOBUFS: Not enough room in the ring to enqueue; no object is enqueued.
394 rte_ring_sp_enqueue_bulk(struct rte_ring *r, void * const *obj_table,
397 uint32_t prod_head, cons_tail;
398 uint32_t prod_next, free_entries;
400 uint32_t mask = r->prod.mask;
403 prod_head = r->prod.head;
404 cons_tail = r->cons.tail;
405 /* The subtraction is done between two unsigned 32bits value
406 * (the result is always modulo 32 bits even if we have
407 * prod_head > cons_tail). So 'free_entries' is always between 0
408 * and size(ring)-1. */
409 free_entries = mask + cons_tail - prod_head;
411 /* check that we have enough room in ring */
412 if (unlikely(n > free_entries)) {
413 __RING_STAT_ADD(r, enq_fail, n);
417 prod_next = prod_head + n;
418 r->prod.head = prod_next;
420 /* write entries in ring */
421 for (i = 0; likely(i < n); i++)
422 r->ring[(prod_head + i) & mask] = obj_table[i];
425 /* return -EDQUOT if we exceed the watermark */
426 if (unlikely(((mask + 1) - free_entries + n) > r->prod.watermark)) {
428 __RING_STAT_ADD(r, enq_quota, n);
432 __RING_STAT_ADD(r, enq_success, n);
435 r->prod.tail = prod_next;
440 * Enqueue several objects on a ring.
442 * This function calls the multi-producer or the single-producer
443 * version depending on the default behavior that was specified at
444 * ring creation time (see flags).
447 * A pointer to the ring structure.
449 * A pointer to a table of void * pointers (objects).
451 * The number of objects to add in the ring from the obj_table.
453 * - 0: Success; objects enqueued.
454 * - -EDQUOT: Quota exceeded. The objects have been enqueued, but the
455 * high water mark is exceeded.
456 * - -ENOBUFS: Not enough room in the ring to enqueue; no object is enqueued.
459 rte_ring_enqueue_bulk(struct rte_ring *r, void * const *obj_table,
462 if (r->prod.sp_enqueue)
463 return rte_ring_sp_enqueue_bulk(r, obj_table, n);
465 return rte_ring_mp_enqueue_bulk(r, obj_table, n);
469 * Enqueue one object on a ring (multi-producers safe).
471 * This function uses a "compare and set" instruction to move the
472 * producer index atomically.
475 * A pointer to the ring structure.
477 * A pointer to the object to be added.
479 * - 0: Success; objects enqueued.
480 * - -EDQUOT: Quota exceeded. The objects have been enqueued, but the
481 * high water mark is exceeded.
482 * - -ENOBUFS: Not enough room in the ring to enqueue; no object is enqueued.
485 rte_ring_mp_enqueue(struct rte_ring *r, void *obj)
487 return rte_ring_mp_enqueue_bulk(r, &obj, 1);
491 * Enqueue one object on a ring (NOT multi-producers safe).
494 * A pointer to the ring structure.
496 * A pointer to the object to be added.
498 * - 0: Success; objects enqueued.
499 * - -EDQUOT: Quota exceeded. The objects have been enqueued, but the
500 * high water mark is exceeded.
501 * - -ENOBUFS: Not enough room in the ring to enqueue; no object is enqueued.
504 rte_ring_sp_enqueue(struct rte_ring *r, void *obj)
506 return rte_ring_sp_enqueue_bulk(r, &obj, 1);
510 * Enqueue one object on a ring.
512 * This function calls the multi-producer or the single-producer
513 * version, depending on the default behaviour that was specified at
514 * ring creation time (see flags).
517 * A pointer to the ring structure.
519 * A pointer to the object to be added.
521 * - 0: Success; objects enqueued.
522 * - -EDQUOT: Quota exceeded. The objects have been enqueued, but the
523 * high water mark is exceeded.
524 * - -ENOBUFS: Not enough room in the ring to enqueue; no object is enqueued.
527 rte_ring_enqueue(struct rte_ring *r, void *obj)
529 if (r->prod.sp_enqueue)
530 return rte_ring_sp_enqueue(r, obj);
532 return rte_ring_mp_enqueue(r, obj);
536 * Dequeue several objects from a ring (multi-consumers safe).
538 * This function uses a "compare and set" instruction to move the
539 * consumer index atomically.
542 * A pointer to the ring structure.
544 * A pointer to a table of void * pointers (objects) that will be filled.
546 * The number of objects to dequeue from the ring to the obj_table,
547 * must be strictly positive
549 * - 0: Success; objects dequeued.
550 * - -ENOENT: Not enough entries in the ring to dequeue; no object is
554 rte_ring_mc_dequeue_bulk(struct rte_ring *r, void **obj_table, unsigned n)
556 uint32_t cons_head, prod_tail;
557 uint32_t cons_next, entries;
560 uint32_t mask = r->prod.mask;
562 /* move cons.head atomically */
564 cons_head = r->cons.head;
565 prod_tail = r->prod.tail;
566 /* The subtraction is done between two unsigned 32bits value
567 * (the result is always modulo 32 bits even if we have
568 * cons_head > prod_tail). So 'entries' is always between 0
569 * and size(ring)-1. */
570 entries = (prod_tail - cons_head);
572 /* check that we have enough entries in ring */
573 if (unlikely(n > entries)) {
574 __RING_STAT_ADD(r, deq_fail, n);
578 cons_next = cons_head + n;
579 success = rte_atomic32_cmpset(&r->cons.head, cons_head,
581 } while (unlikely(success == 0));
585 for (i = 0; likely(i < n); i++) {
586 obj_table[i] = r->ring[(cons_head + i) & mask];
590 * If there are other dequeues in progress that preceeded us,
591 * we need to wait for them to complete
593 while (unlikely(r->cons.tail != cons_head))
596 __RING_STAT_ADD(r, deq_success, n);
597 r->cons.tail = cons_next;
602 * Dequeue several objects from a ring (NOT multi-consumers safe).
605 * A pointer to the ring structure.
607 * A pointer to a table of void * pointers (objects) that will be filled.
609 * The number of objects to dequeue from the ring to the obj_table,
610 * must be strictly positive.
612 * - 0: Success; objects dequeued.
613 * - -ENOENT: Not enough entries in the ring to dequeue; no object is
617 rte_ring_sc_dequeue_bulk(struct rte_ring *r, void **obj_table, unsigned n)
619 uint32_t cons_head, prod_tail;
620 uint32_t cons_next, entries;
622 uint32_t mask = r->prod.mask;
624 cons_head = r->cons.head;
625 prod_tail = r->prod.tail;
626 /* The subtraction is done between two unsigned 32bits value
627 * (the result is always modulo 32 bits even if we have
628 * cons_head > prod_tail). So 'entries' is always between 0
629 * and size(ring)-1. */
630 entries = prod_tail - cons_head;
632 /* check that we have enough entries in ring */
633 if (unlikely(n > entries)) {
634 __RING_STAT_ADD(r, deq_fail, n);
638 cons_next = cons_head + n;
639 r->cons.head = cons_next;
643 for (i = 0; likely(i < n); i++) {
644 obj_table[i] = r->ring[(cons_head + i) & mask];
647 __RING_STAT_ADD(r, deq_success, n);
648 r->cons.tail = cons_next;
653 * Dequeue several objects from a ring.
655 * This function calls the multi-consumers or the single-consumer
656 * version, depending on the default behaviour that was specified at
657 * ring creation time (see flags).
660 * A pointer to the ring structure.
662 * A pointer to a table of void * pointers (objects) that will be filled.
664 * The number of objects to dequeue from the ring to the obj_table.
666 * - 0: Success; objects dequeued.
667 * - -ENOENT: Not enough entries in the ring to dequeue, no object is
671 rte_ring_dequeue_bulk(struct rte_ring *r, void **obj_table, unsigned n)
673 if (r->cons.sc_dequeue)
674 return rte_ring_sc_dequeue_bulk(r, obj_table, n);
676 return rte_ring_mc_dequeue_bulk(r, obj_table, n);
680 * Dequeue one object from a ring (multi-consumers safe).
682 * This function uses a "compare and set" instruction to move the
683 * consumer index atomically.
686 * A pointer to the ring structure.
688 * A pointer to a void * pointer (object) that will be filled.
690 * - 0: Success; objects dequeued.
691 * - -ENOENT: Not enough entries in the ring to dequeue; no object is
695 rte_ring_mc_dequeue(struct rte_ring *r, void **obj_p)
697 return rte_ring_mc_dequeue_bulk(r, obj_p, 1);
701 * Dequeue one object from a ring (NOT multi-consumers safe).
704 * A pointer to the ring structure.
706 * A pointer to a void * pointer (object) that will be filled.
708 * - 0: Success; objects dequeued.
709 * - -ENOENT: Not enough entries in the ring to dequeue, no object is
713 rte_ring_sc_dequeue(struct rte_ring *r, void **obj_p)
715 return rte_ring_sc_dequeue_bulk(r, obj_p, 1);
719 * Dequeue one object from a ring.
721 * This function calls the multi-consumers or the single-consumer
722 * version depending on the default behaviour that was specified at
723 * ring creation time (see flags).
726 * A pointer to the ring structure.
728 * A pointer to a void * pointer (object) that will be filled.
730 * - 0: Success, objects dequeued.
731 * - -ENOENT: Not enough entries in the ring to dequeue, no object is
735 rte_ring_dequeue(struct rte_ring *r, void **obj_p)
737 if (r->cons.sc_dequeue)
738 return rte_ring_sc_dequeue(r, obj_p);
740 return rte_ring_mc_dequeue(r, obj_p);
744 * Test if a ring is full.
747 * A pointer to the ring structure.
749 * - 1: The ring is full.
750 * - 0: The ring is not full.
753 rte_ring_full(const struct rte_ring *r)
755 uint32_t prod_tail = r->prod.tail;
756 uint32_t cons_tail = r->cons.tail;
757 return (((cons_tail - prod_tail - 1) & r->prod.mask) == 0);
761 * Test if a ring is empty.
764 * A pointer to the ring structure.
766 * - 1: The ring is empty.
767 * - 0: The ring is not empty.
770 rte_ring_empty(const struct rte_ring *r)
772 uint32_t prod_tail = r->prod.tail;
773 uint32_t cons_tail = r->cons.tail;
774 return !!(cons_tail == prod_tail);
778 * Return the number of entries in a ring.
781 * A pointer to the ring structure.
783 * The number of entries in the ring.
785 static inline unsigned
786 rte_ring_count(const struct rte_ring *r)
788 uint32_t prod_tail = r->prod.tail;
789 uint32_t cons_tail = r->cons.tail;
790 return ((prod_tail - cons_tail) & r->prod.mask);
794 * Return the number of free entries in a ring.
797 * A pointer to the ring structure.
799 * The number of free entries in the ring.
801 static inline unsigned
802 rte_ring_free_count(const struct rte_ring *r)
804 uint32_t prod_tail = r->prod.tail;
805 uint32_t cons_tail = r->cons.tail;
806 return ((cons_tail - prod_tail - 1) & r->prod.mask);
810 * Dump the status of all rings on the console
812 void rte_ring_list_dump(void);
815 * Search a ring from its name
818 * The name of the ring.
820 * The pointer to the ring matching the name, or NULL if not found,
821 * with rte_errno set appropriately. Possible rte_errno values include:
822 * - ENOENT - required entry not available to return.
824 struct rte_ring *rte_ring_lookup(const char *name);
830 #endif /* _RTE_RING_H_ */