DPDK  21.02.0
rte_ring_hts.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  *
3  * Copyright (c) 2010-2020 Intel Corporation
4  * Copyright (c) 2007-2009 Kip Macy kmacy@freebsd.org
5  * All rights reserved.
6  * Derived from FreeBSD's bufring.h
7  * Used as BSD-3 Licensed with permission from Kip Macy.
8  */
9 
10 #ifndef _RTE_RING_HTS_H_
11 #define _RTE_RING_HTS_H_
12 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 #include <rte_ring_hts_elem_pvt.h>
33 
53 __rte_experimental
54 static __rte_always_inline unsigned int
55 rte_ring_mp_hts_enqueue_bulk_elem(struct rte_ring *r, const void *obj_table,
56  unsigned int esize, unsigned int n, unsigned int *free_space)
57 {
58  return __rte_ring_do_hts_enqueue_elem(r, obj_table, esize, n,
59  RTE_RING_QUEUE_FIXED, free_space);
60 }
61 
81 __rte_experimental
82 static __rte_always_inline unsigned int
83 rte_ring_mc_hts_dequeue_bulk_elem(struct rte_ring *r, void *obj_table,
84  unsigned int esize, unsigned int n, unsigned int *available)
85 {
86  return __rte_ring_do_hts_dequeue_elem(r, obj_table, esize, n,
87  RTE_RING_QUEUE_FIXED, available);
88 }
89 
109 __rte_experimental
110 static __rte_always_inline unsigned int
111 rte_ring_mp_hts_enqueue_burst_elem(struct rte_ring *r, const void *obj_table,
112  unsigned int esize, unsigned int n, unsigned int *free_space)
113 {
114  return __rte_ring_do_hts_enqueue_elem(r, obj_table, esize, n,
115  RTE_RING_QUEUE_VARIABLE, free_space);
116 }
117 
139 __rte_experimental
140 static __rte_always_inline unsigned int
141 rte_ring_mc_hts_dequeue_burst_elem(struct rte_ring *r, void *obj_table,
142  unsigned int esize, unsigned int n, unsigned int *available)
143 {
144  return __rte_ring_do_hts_dequeue_elem(r, obj_table, esize, n,
145  RTE_RING_QUEUE_VARIABLE, available);
146 }
147 
163 __rte_experimental
164 static __rte_always_inline unsigned int
165 rte_ring_mp_hts_enqueue_bulk(struct rte_ring *r, void * const *obj_table,
166  unsigned int n, unsigned int *free_space)
167 {
168  return rte_ring_mp_hts_enqueue_bulk_elem(r, obj_table,
169  sizeof(uintptr_t), n, free_space);
170 }
171 
187 __rte_experimental
188 static __rte_always_inline unsigned int
189 rte_ring_mc_hts_dequeue_bulk(struct rte_ring *r, void **obj_table,
190  unsigned int n, unsigned int *available)
191 {
192  return rte_ring_mc_hts_dequeue_bulk_elem(r, obj_table,
193  sizeof(uintptr_t), n, available);
194 }
195 
211 __rte_experimental
212 static __rte_always_inline unsigned int
213 rte_ring_mp_hts_enqueue_burst(struct rte_ring *r, void * const *obj_table,
214  unsigned int n, unsigned int *free_space)
215 {
216  return rte_ring_mp_hts_enqueue_burst_elem(r, obj_table,
217  sizeof(uintptr_t), n, free_space);
218 }
219 
237 __rte_experimental
238 static __rte_always_inline unsigned int
239 rte_ring_mc_hts_dequeue_burst(struct rte_ring *r, void **obj_table,
240  unsigned int n, unsigned int *available)
241 {
242  return rte_ring_mc_hts_dequeue_burst_elem(r, obj_table,
243  sizeof(uintptr_t), n, available);
244 }
245 
246 #ifdef __cplusplus
247 }
248 #endif
249 
250 #endif /* _RTE_RING_HTS_H_ */
static __rte_experimental __rte_always_inline unsigned int rte_ring_mp_hts_enqueue_bulk(struct rte_ring *r, void *const *obj_table, unsigned int n, unsigned int *free_space)
Definition: rte_ring_hts.h:165
#define __rte_always_inline
Definition: rte_common.h:226
static __rte_experimental __rte_always_inline unsigned int rte_ring_mp_hts_enqueue_burst_elem(struct rte_ring *r, const void *obj_table, unsigned int esize, unsigned int n, unsigned int *free_space)
Definition: rte_ring_hts.h:111
static __rte_experimental __rte_always_inline unsigned int rte_ring_mp_hts_enqueue_bulk_elem(struct rte_ring *r, const void *obj_table, unsigned int esize, unsigned int n, unsigned int *free_space)
Definition: rte_ring_hts.h:55
static __rte_experimental __rte_always_inline unsigned int rte_ring_mp_hts_enqueue_burst(struct rte_ring *r, void *const *obj_table, unsigned int n, unsigned int *free_space)
Definition: rte_ring_hts.h:213
static __rte_experimental __rte_always_inline unsigned int rte_ring_mc_hts_dequeue_bulk(struct rte_ring *r, void **obj_table, unsigned int n, unsigned int *available)
Definition: rte_ring_hts.h:189
static __rte_experimental __rte_always_inline unsigned int rte_ring_mc_hts_dequeue_bulk_elem(struct rte_ring *r, void *obj_table, unsigned int esize, unsigned int n, unsigned int *available)
Definition: rte_ring_hts.h:83
static __rte_experimental __rte_always_inline unsigned int rte_ring_mc_hts_dequeue_burst_elem(struct rte_ring *r, void *obj_table, unsigned int esize, unsigned int n, unsigned int *available)
Definition: rte_ring_hts.h:141
static __rte_experimental __rte_always_inline unsigned int rte_ring_mc_hts_dequeue_burst(struct rte_ring *r, void **obj_table, unsigned int n, unsigned int *available)
Definition: rte_ring_hts.h:239