DPDK  21.08.0
rte_mbuf_dyn.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright 2019 6WIND S.A.
3  */
4 
5 #ifndef _RTE_MBUF_DYN_H_
6 #define _RTE_MBUF_DYN_H_
7 
69 #include <stdio.h>
70 #include <stdint.h>
71 #include <sys/types.h>
72 
73 #include <rte_compat.h>
74 
75 #ifdef __cplusplus
76 extern "C" {
77 #endif
78 
82 #define RTE_MBUF_DYN_NAMESIZE 64
83 
89  size_t size;
90  size_t align;
91  unsigned int flags;
92 };
93 
99  unsigned int flags;
100 };
101 
121 __rte_experimental
122 int rte_mbuf_dynfield_register(const struct rte_mbuf_dynfield *params);
123 
146 __rte_experimental
148  size_t offset);
149 
163 __rte_experimental
164 int rte_mbuf_dynfield_lookup(const char *name,
165  struct rte_mbuf_dynfield *params);
166 
186 __rte_experimental
187 int rte_mbuf_dynflag_register(const struct rte_mbuf_dynflag *params);
188 
211 __rte_experimental
212 int rte_mbuf_dynflag_register_bitnum(const struct rte_mbuf_dynflag *params,
213  unsigned int bitnum);
214 
228 __rte_experimental
229 int rte_mbuf_dynflag_lookup(const char *name,
230  struct rte_mbuf_dynflag *params);
231 
235 #define RTE_MBUF_DYNFIELD(m, offset, type) ((type)((uintptr_t)(m) + (offset)))
236 
243 __rte_experimental
244 void rte_mbuf_dyn_dump(FILE *out);
245 
246 /*
247  * Placeholder for dynamic fields and flags declarations.
248  * This is centralizing point to gather all field names
249  * and parameters together.
250  */
251 
252 /*
253  * The metadata dynamic field provides some extra packet information
254  * to interact with RTE Flow engine. The metadata in sent mbufs can be
255  * used to match on some Flows. The metadata in received mbufs can
256  * provide some feedback from the Flows. The metadata flag tells
257  * whether the field contains actual value to send, or received one.
258  */
259 #define RTE_MBUF_DYNFIELD_METADATA_NAME "rte_flow_dynfield_metadata"
260 #define RTE_MBUF_DYNFLAG_METADATA_NAME "rte_flow_dynflag_metadata"
261 
271 #define RTE_MBUF_DYNFIELD_TIMESTAMP_NAME "rte_dynfield_timestamp"
272 typedef uint64_t rte_mbuf_timestamp_t;
273 
277 #define RTE_MBUF_DYNFLAG_RX_TIMESTAMP_NAME "rte_dynflag_rx_timestamp"
278 
298 __rte_experimental
299 int rte_mbuf_dyn_rx_timestamp_register(int *field_offset, uint64_t *rx_flag);
300 
314 #define RTE_MBUF_DYNFLAG_TX_TIMESTAMP_NAME "rte_dynflag_tx_timestamp"
315 
335 __rte_experimental
336 int rte_mbuf_dyn_tx_timestamp_register(int *field_offset, uint64_t *tx_flag);
337 
338 #ifdef __cplusplus
339 }
340 #endif
341 
342 #endif /* _RTE_MBUF_DYN_H_ */
__rte_experimental int rte_mbuf_dyn_rx_timestamp_register(int *field_offset, uint64_t *rx_flag)
__rte_experimental int rte_mbuf_dynflag_lookup(const char *name, struct rte_mbuf_dynflag *params)
unsigned int flags
Definition: rte_mbuf_dyn.h:91
char name[RTE_MBUF_DYN_NAMESIZE]
Definition: rte_mbuf_dyn.h:88
unsigned int flags
Definition: rte_mbuf_dyn.h:99
__rte_experimental int rte_mbuf_dynflag_register(const struct rte_mbuf_dynflag *params)
#define RTE_MBUF_DYN_NAMESIZE
Definition: rte_mbuf_dyn.h:82
__rte_experimental void rte_mbuf_dyn_dump(FILE *out)
__rte_experimental int rte_mbuf_dyn_tx_timestamp_register(int *field_offset, uint64_t *tx_flag)
__rte_experimental int rte_mbuf_dynfield_lookup(const char *name, struct rte_mbuf_dynfield *params)
__rte_experimental int rte_mbuf_dynfield_register(const struct rte_mbuf_dynfield *params)
__rte_experimental int rte_mbuf_dynfield_register_offset(const struct rte_mbuf_dynfield *params, size_t offset)
__rte_experimental int rte_mbuf_dynflag_register_bitnum(const struct rte_mbuf_dynflag *params, unsigned int bitnum)