DPDK  22.11.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 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 #include <rte_ring_hts_elem_pvt.h>
32 
52 static __rte_always_inline unsigned int
53 rte_ring_mp_hts_enqueue_bulk_elem(struct rte_ring *r, const void *obj_table,
54  unsigned int esize, unsigned int n, unsigned int *free_space)
55 {
56  return __rte_ring_do_hts_enqueue_elem(r, obj_table, esize, n,
57  RTE_RING_QUEUE_FIXED, free_space);
58 }
59 
79 static __rte_always_inline unsigned int
80 rte_ring_mc_hts_dequeue_bulk_elem(struct rte_ring *r, void *obj_table,
81  unsigned int esize, unsigned int n, unsigned int *available)
82 {
83  return __rte_ring_do_hts_dequeue_elem(r, obj_table, esize, n,
84  RTE_RING_QUEUE_FIXED, available);
85 }
86 
106 static __rte_always_inline unsigned int
107 rte_ring_mp_hts_enqueue_burst_elem(struct rte_ring *r, const void *obj_table,
108  unsigned int esize, unsigned int n, unsigned int *free_space)
109 {
110  return __rte_ring_do_hts_enqueue_elem(r, obj_table, esize, n,
111  RTE_RING_QUEUE_VARIABLE, free_space);
112 }
113 
135 static __rte_always_inline unsigned int
136 rte_ring_mc_hts_dequeue_burst_elem(struct rte_ring *r, void *obj_table,
137  unsigned int esize, unsigned int n, unsigned int *available)
138 {
139  return __rte_ring_do_hts_dequeue_elem(r, obj_table, esize, n,
140  RTE_RING_QUEUE_VARIABLE, available);
141 }
142 
158 static __rte_always_inline unsigned int
159 rte_ring_mp_hts_enqueue_bulk(struct rte_ring *r, void * const *obj_table,
160  unsigned int n, unsigned int *free_space)
161 {
162  return rte_ring_mp_hts_enqueue_bulk_elem(r, obj_table,
163  sizeof(uintptr_t), n, free_space);
164 }
165 
181 static __rte_always_inline unsigned int
182 rte_ring_mc_hts_dequeue_bulk(struct rte_ring *r, void **obj_table,
183  unsigned int n, unsigned int *available)
184 {
185  return rte_ring_mc_hts_dequeue_bulk_elem(r, obj_table,
186  sizeof(uintptr_t), n, available);
187 }
188 
204 static __rte_always_inline unsigned int
205 rte_ring_mp_hts_enqueue_burst(struct rte_ring *r, void * const *obj_table,
206  unsigned int n, unsigned int *free_space)
207 {
208  return rte_ring_mp_hts_enqueue_burst_elem(r, obj_table,
209  sizeof(uintptr_t), n, free_space);
210 }
211 
229 static __rte_always_inline unsigned int
230 rte_ring_mc_hts_dequeue_burst(struct rte_ring *r, void **obj_table,
231  unsigned int n, unsigned int *available)
232 {
233  return rte_ring_mc_hts_dequeue_burst_elem(r, obj_table,
234  sizeof(uintptr_t), n, available);
235 }
236 
237 #ifdef __cplusplus
238 }
239 #endif
240 
241 #endif /* _RTE_RING_HTS_H_ */
#define __rte_always_inline
Definition: rte_common.h:255
static __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:182
static __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:230
static __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:205
static __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:80
static __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:136
static __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:159
static __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:53
static __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:107