DPDK  25.11.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 
72 #include <rte_stdatomic.h>
73 
74 #ifdef __cplusplus
75 extern "C" {
76 #endif
77 
81 #define RTE_MBUF_DYN_NAMESIZE 64
82 
88  size_t size;
89  size_t align;
90  unsigned int flags;
91 };
92 
98  unsigned int flags;
99 };
100 
121 
145  size_t offset);
146 
160 int rte_mbuf_dynfield_lookup(const char *name,
161  struct rte_mbuf_dynfield *params);
162 
182 int rte_mbuf_dynflag_register(const struct rte_mbuf_dynflag *params);
183 
207  unsigned int bitnum);
208 
222 int rte_mbuf_dynflag_lookup(const char *name,
223  struct rte_mbuf_dynflag *params);
224 
228 #define RTE_MBUF_DYNFIELD(m, offset, type) ((type)((uintptr_t)(m) + (offset)))
229 
236 void rte_mbuf_dyn_dump(FILE *out);
237 
238 /*
239  * Placeholder for dynamic fields and flags declarations.
240  * This is centralizing point to gather all field names
241  * and parameters together.
242  */
243 
249 #define RTE_MBUF_DYNFIELD_HISTORY_NAME "rte_mbuf_dynfield_history"
250 
259 typedef RTE_ATOMIC(uint64_t) rte_mbuf_history_t;
260 
261 /*
262  * The metadata dynamic field provides some extra packet information
263  * to interact with RTE Flow engine. The metadata in sent mbufs can be
264  * used to match on some Flows. The metadata in received mbufs can
265  * provide some feedback from the Flows. The metadata flag tells
266  * whether the field contains actual value to send, or received one.
267  */
268 #define RTE_MBUF_DYNFIELD_METADATA_NAME "rte_flow_dynfield_metadata"
269 #define RTE_MBUF_DYNFLAG_METADATA_NAME "rte_flow_dynflag_metadata"
270 
280 #define RTE_MBUF_DYNFIELD_TIMESTAMP_NAME "rte_dynfield_timestamp"
281 typedef uint64_t rte_mbuf_timestamp_t;
282 
286 #define RTE_MBUF_DYNFLAG_RX_TIMESTAMP_NAME "rte_dynflag_rx_timestamp"
287 
304 int rte_mbuf_dyn_rx_timestamp_register(int *field_offset, uint64_t *rx_flag);
305 
319 #define RTE_MBUF_DYNFLAG_TX_TIMESTAMP_NAME "rte_dynflag_tx_timestamp"
320 
337 int rte_mbuf_dyn_tx_timestamp_register(int *field_offset, uint64_t *tx_flag);
338 
345 #define RTE_MBUF_DYNFIELD_IP_REASSEMBLY_NAME "rte_dynfield_ip_reassembly"
346 #define RTE_MBUF_DYNFLAG_IP_REASSEMBLY_INCOMPLETE_NAME "rte_dynflag_ip_reassembly_incomplete"
347 
348 #ifdef __cplusplus
349 }
350 #endif
351 
352 #endif /* _RTE_MBUF_DYN_H_ */
int rte_mbuf_dyn_rx_timestamp_register(int *field_offset, uint64_t *rx_flag)
int rte_mbuf_dynfield_register(const struct rte_mbuf_dynfield *params)
int rte_mbuf_dynfield_register_offset(const struct rte_mbuf_dynfield *params, size_t offset)
#define RTE_MBUF_DYN_NAMESIZE
Definition: rte_mbuf_dyn.h:81
int rte_mbuf_dynflag_lookup(const char *name, struct rte_mbuf_dynflag *params)
void rte_mbuf_dyn_dump(FILE *out)
int rte_mbuf_dyn_tx_timestamp_register(int *field_offset, uint64_t *tx_flag)
int rte_mbuf_dynflag_register(const struct rte_mbuf_dynflag *params)
int rte_mbuf_dynflag_register_bitnum(const struct rte_mbuf_dynflag *params, unsigned int bitnum)
int rte_mbuf_dynfield_lookup(const char *name, struct rte_mbuf_dynfield *params)
unsigned int flags
Definition: rte_mbuf_dyn.h:90
char name[RTE_MBUF_DYN_NAMESIZE]
Definition: rte_mbuf_dyn.h:87
unsigned int flags
Definition: rte_mbuf_dyn.h:98
char name[RTE_MBUF_DYN_NAMESIZE]
Definition: rte_mbuf_dyn.h:97