* Enqueue one object on a ring (multi-producers safe). * * This function uses a "compare and set" instruction to move the * producer index atomically. * * @param r * A pointer to the ring structure. * @param obj * A pointer to the object to be added. * @return * - 0: Success; objects enqueued. * - -ENOBUFS: Not enough room in the ring to enqueue; no object is enqueued. */
| 295 | * - -ENOBUFS: Not enough room in the ring to enqueue; no object is enqueued. |
| 296 | */ |
| 297 | static __rte_always_inline int |
| 298 | rte_ring_mp_enqueue(struct rte_ring *r, void *obj) |
| 299 | { |
| 300 | return rte_ring_mp_enqueue_elem(r, &obj, sizeof(void *)); |
| 301 | } |
| 302 | |
| 303 | /** |
| 304 | * Enqueue one object on a ring (NOT multi-producers safe). |