+/* Wrappers around the zero-copy APIs. The wrappers match
+ * the normal enqueue/dequeue API declarations.
+ */
+static unsigned int
+test_ring_enqueue_zc_bulk(struct rte_ring *r, void * const *obj_table,
+ unsigned int n, unsigned int *free_space)
+{
+ uint32_t ret;
+ struct rte_ring_zc_data zcd;
+
+ ret = rte_ring_enqueue_zc_bulk_start(r, n, &zcd, free_space);
+ if (ret != 0) {
+ /* Copy the data to the ring */
+ test_ring_copy_to(&zcd, obj_table, sizeof(void *), ret);
+ rte_ring_enqueue_zc_finish(r, ret);
+ }
+
+ return ret;
+}
+
+static unsigned int
+test_ring_enqueue_zc_bulk_elem(struct rte_ring *r, const void *obj_table,
+ unsigned int esize, unsigned int n, unsigned int *free_space)
+{
+ unsigned int ret;
+ struct rte_ring_zc_data zcd;
+
+ ret = rte_ring_enqueue_zc_bulk_elem_start(r, esize, n,
+ &zcd, free_space);
+ if (ret != 0) {
+ /* Copy the data to the ring */
+ test_ring_copy_to(&zcd, obj_table, esize, ret);
+ rte_ring_enqueue_zc_finish(r, ret);
+ }
+
+ return ret;
+}
+
+static unsigned int
+test_ring_enqueue_zc_burst(struct rte_ring *r, void * const *obj_table,
+ unsigned int n, unsigned int *free_space)
+{
+ unsigned int ret;
+ struct rte_ring_zc_data zcd;
+
+ ret = rte_ring_enqueue_zc_burst_start(r, n, &zcd, free_space);
+ if (ret != 0) {
+ /* Copy the data to the ring */
+ test_ring_copy_to(&zcd, obj_table, sizeof(void *), ret);
+ rte_ring_enqueue_zc_finish(r, ret);
+ }
+
+ return ret;
+}
+
+static unsigned int
+test_ring_enqueue_zc_burst_elem(struct rte_ring *r, const void *obj_table,
+ unsigned int esize, unsigned int n, unsigned int *free_space)
+{
+ unsigned int ret;
+ struct rte_ring_zc_data zcd;
+
+ ret = rte_ring_enqueue_zc_burst_elem_start(r, esize, n,
+ &zcd, free_space);
+ if (ret != 0) {
+ /* Copy the data to the ring */
+ test_ring_copy_to(&zcd, obj_table, esize, ret);
+ rte_ring_enqueue_zc_finish(r, ret);
+ }
+
+ return ret;
+}
+
+static unsigned int
+test_ring_dequeue_zc_bulk(struct rte_ring *r, void **obj_table,
+ unsigned int n, unsigned int *available)
+{
+ unsigned int ret;
+ struct rte_ring_zc_data zcd;
+
+ ret = rte_ring_dequeue_zc_bulk_start(r, n, &zcd, available);
+ if (ret != 0) {
+ /* Copy the data from the ring */
+ test_ring_copy_from(&zcd, obj_table, sizeof(void *), ret);
+ rte_ring_dequeue_zc_finish(r, ret);
+ }
+
+ return ret;
+}
+
+static unsigned int
+test_ring_dequeue_zc_bulk_elem(struct rte_ring *r, void *obj_table,
+ unsigned int esize, unsigned int n, unsigned int *available)
+{
+ unsigned int ret;
+ struct rte_ring_zc_data zcd;
+
+ ret = rte_ring_dequeue_zc_bulk_elem_start(r, esize, n,
+ &zcd, available);
+ if (ret != 0) {
+ /* Copy the data from the ring */
+ test_ring_copy_from(&zcd, obj_table, esize, ret);
+ rte_ring_dequeue_zc_finish(r, ret);
+ }
+
+ return ret;
+}
+
+static unsigned int
+test_ring_dequeue_zc_burst(struct rte_ring *r, void **obj_table,
+ unsigned int n, unsigned int *available)
+{
+ unsigned int ret;
+ struct rte_ring_zc_data zcd;
+
+ ret = rte_ring_dequeue_zc_burst_start(r, n, &zcd, available);
+ if (ret != 0) {
+ /* Copy the data from the ring */
+ test_ring_copy_from(&zcd, obj_table, sizeof(void *), ret);
+ rte_ring_dequeue_zc_finish(r, ret);
+ }
+
+ return ret;
+}
+
+static unsigned int
+test_ring_dequeue_zc_burst_elem(struct rte_ring *r, void *obj_table,
+ unsigned int esize, unsigned int n, unsigned int *available)
+{
+ unsigned int ret;
+ struct rte_ring_zc_data zcd;
+
+ ret = rte_ring_dequeue_zc_burst_elem_start(r, esize, n,
+ &zcd, available);
+ if (ret != 0) {
+ /* Copy the data from the ring */
+ test_ring_copy_from(&zcd, obj_table, esize, ret);
+ rte_ring_dequeue_zc_finish(r, ret);
+ }
+
+ return ret;
+}
+