1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2020 Intel Corporation
5 #include "test_ring_stress_impl.h"
6 #include <rte_ring_elem.h>
9 _st_ring_dequeue_bulk(struct rte_ring *r, void **obj, uint32_t n,
14 static rte_spinlock_t lck = RTE_SPINLOCK_INITIALIZER;
16 rte_spinlock_lock(&lck);
18 m = rte_ring_dequeue_bulk_start(r, obj, n, avail);
20 rte_ring_dequeue_finish(r, n);
22 rte_spinlock_unlock(&lck);
26 static inline uint32_t
27 _st_ring_enqueue_bulk(struct rte_ring *r, void * const *obj, uint32_t n,
32 static rte_spinlock_t lck = RTE_SPINLOCK_INITIALIZER;
34 rte_spinlock_lock(&lck);
36 m = rte_ring_enqueue_bulk_start(r, n, free);
38 rte_ring_enqueue_finish(r, obj, n);
40 rte_spinlock_unlock(&lck);
45 _st_ring_init(struct rte_ring *r, const char *name, uint32_t num)
47 return rte_ring_init(r, name, num, RING_F_SP_ENQ | RING_F_SC_DEQ);
50 const struct test test_ring_st_peek_stress = {
52 .nb_case = RTE_DIM(tests),