ring: support configurable element size
[dpdk.git] / lib / librte_ring / rte_ring.h
index e5a175c..18fc5d8 100644 (file)
@@ -216,6 +216,7 @@ int rte_ring_init(struct rte_ring *r, const char *name, unsigned count,
  */
 struct rte_ring *rte_ring_create(const char *name, unsigned count,
                                 int socket_id, unsigned flags);
+
 /**
  * De-allocate all memory used by the ring.
  *
@@ -668,6 +669,23 @@ rte_ring_dequeue(struct rte_ring *r, void **obj_p)
        return rte_ring_dequeue_bulk(r, obj_p, 1, NULL) ? 0 : -ENOENT;
 }
 
+/**
+ * Flush a ring.
+ *
+ * This function flush all the elements in a ring
+ *
+ * @b EXPERIMENTAL: this API may change without prior notice
+ *
+ * @warning
+ * Make sure the ring is not in use while calling this function.
+ *
+ * @param r
+ *   A pointer to the ring structure.
+ */
+__rte_experimental
+void
+rte_ring_reset(struct rte_ring *r);
+
 /**
  * Return the number of entries in a ring.
  *