]> git.droids-corp.org - dpdk.git/blobdiff - lib/librte_ring/rte_ring.h
ring: add reset function for flushing
[dpdk.git] / lib / librte_ring / rte_ring.h
index e5a175cb3900147cd8295849bb58c89d09163b0c..2a9f768a1cafc64c2c279b3bf1122d5ae35e7d46 100644 (file)
@@ -668,6 +668,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.
  *