* Enqueue one object on a ring. * * This function calls the multi-producer or the single-producer * version, depending on the default behaviour that was specified at * ring creation time (see flags). * * @param r * A pointer to the ring structure. * @param obj * A pointer to the object to be added. * @param esize * The size of ring element, in bytes. It must be a multiple of 4. *
| 285 | * - -ENOBUFS: Not enough room in the ring to enqueue; no object is enqueued. |
| 286 | */ |
| 287 | static __rte_always_inline int |
| 288 | rte_ring_enqueue_elem(struct rte_ring *r, void *obj, unsigned int esize) |
| 289 | { |
| 290 | return rte_ring_enqueue_bulk_elem(r, obj, esize, 1, NULL) ? 0 : |
| 291 | -ENOBUFS; |
| 292 | } |
| 293 | |
| 294 | /** |
| 295 | * Dequeue several objects from a ring (multi-consumers safe). |