DPDK  23.03.0
rte_reorder.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2010-2014 Intel Corporation
3  */
4 
5 #ifndef _RTE_REORDER_H_
6 #define _RTE_REORDER_H_
7 
18 #include <rte_compat.h>
19 #include <rte_mbuf.h>
20 #include <rte_mbuf_dyn.h>
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 struct rte_reorder_buffer;
27 
28 typedef uint32_t rte_reorder_seqn_t;
29 extern int rte_reorder_seqn_dynfield_offset;
30 
40 __rte_experimental
41 static inline rte_reorder_seqn_t *
43 {
44  return RTE_MBUF_DYNFIELD(mbuf, rte_reorder_seqn_dynfield_offset,
45  rte_reorder_seqn_t *);
46 }
47 
67 struct rte_reorder_buffer *
68 rte_reorder_create(const char *name, unsigned socket_id, unsigned int size);
69 
87 struct rte_reorder_buffer *
88 rte_reorder_init(struct rte_reorder_buffer *b, unsigned int bufsize,
89  const char *name, unsigned int size);
90 
103 struct rte_reorder_buffer *
104 rte_reorder_find_existing(const char *name);
105 
112 void
113 rte_reorder_reset(struct rte_reorder_buffer *b);
114 
122 void
123 rte_reorder_free(struct rte_reorder_buffer *b);
124 
147 int
148 rte_reorder_insert(struct rte_reorder_buffer *b, struct rte_mbuf *mbuf);
149 
167 unsigned int
168 rte_reorder_drain(struct rte_reorder_buffer *b, struct rte_mbuf **mbufs,
169  unsigned max_mbufs);
170 
192 __rte_experimental
193 unsigned int
194 rte_reorder_drain_up_to_seqn(struct rte_reorder_buffer *b, struct rte_mbuf **mbufs,
195  unsigned int max_mbufs, rte_reorder_seqn_t seqn);
196 
212 __rte_experimental
213 unsigned int
214 rte_reorder_min_seqn_set(struct rte_reorder_buffer *b, rte_reorder_seqn_t min_seqn);
215 
216 #ifdef __cplusplus
217 }
218 #endif
219 
220 #endif /* _RTE_REORDER_H_ */
unsigned int rte_reorder_drain(struct rte_reorder_buffer *b, struct rte_mbuf **mbufs, unsigned max_mbufs)
static __rte_experimental rte_reorder_seqn_t * rte_reorder_seqn(struct rte_mbuf *mbuf)
Definition: rte_reorder.h:42
int rte_reorder_insert(struct rte_reorder_buffer *b, struct rte_mbuf *mbuf)
struct rte_reorder_buffer * rte_reorder_find_existing(const char *name)
void rte_reorder_free(struct rte_reorder_buffer *b)
#define RTE_MBUF_DYNFIELD(m, offset, type)
Definition: rte_mbuf_dyn.h:227
__rte_experimental unsigned int rte_reorder_min_seqn_set(struct rte_reorder_buffer *b, rte_reorder_seqn_t min_seqn)
struct rte_reorder_buffer * rte_reorder_init(struct rte_reorder_buffer *b, unsigned int bufsize, const char *name, unsigned int size)
__rte_experimental unsigned int rte_reorder_drain_up_to_seqn(struct rte_reorder_buffer *b, struct rte_mbuf **mbufs, unsigned int max_mbufs, rte_reorder_seqn_t seqn)
struct rte_reorder_buffer * rte_reorder_create(const char *name, unsigned socket_id, unsigned int size)
void rte_reorder_reset(struct rte_reorder_buffer *b)