DPDK 21.11.9
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
76extern "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
122
146 size_t offset);
147
161int rte_mbuf_dynfield_lookup(const char *name,
162 struct rte_mbuf_dynfield *params);
163
184
208 unsigned int bitnum);
209
223int rte_mbuf_dynflag_lookup(const char *name,
224 struct rte_mbuf_dynflag *params);
225
229#define RTE_MBUF_DYNFIELD(m, offset, type) ((type)((uintptr_t)(m) + (offset)))
230
237void rte_mbuf_dyn_dump(FILE *out);
238
239/*
240 * Placeholder for dynamic fields and flags declarations.
241 * This is centralizing point to gather all field names
242 * and parameters together.
243 */
244
245/*
246 * The metadata dynamic field provides some extra packet information
247 * to interact with RTE Flow engine. The metadata in sent mbufs can be
248 * used to match on some Flows. The metadata in received mbufs can
249 * provide some feedback from the Flows. The metadata flag tells
250 * whether the field contains actual value to send, or received one.
251 */
252#define RTE_MBUF_DYNFIELD_METADATA_NAME "rte_flow_dynfield_metadata"
253#define RTE_MBUF_DYNFLAG_METADATA_NAME "rte_flow_dynflag_metadata"
254
264#define RTE_MBUF_DYNFIELD_TIMESTAMP_NAME "rte_dynfield_timestamp"
265typedef uint64_t rte_mbuf_timestamp_t;
266
270#define RTE_MBUF_DYNFLAG_RX_TIMESTAMP_NAME "rte_dynflag_rx_timestamp"
271
288int rte_mbuf_dyn_rx_timestamp_register(int *field_offset, uint64_t *rx_flag);
289
303#define RTE_MBUF_DYNFLAG_TX_TIMESTAMP_NAME "rte_dynflag_tx_timestamp"
304
321int rte_mbuf_dyn_tx_timestamp_register(int *field_offset, uint64_t *tx_flag);
322
323#ifdef __cplusplus
324}
325#endif
326
327#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:82
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:91
char name[RTE_MBUF_DYN_NAMESIZE]
Definition: rte_mbuf_dyn.h:88
unsigned int flags
Definition: rte_mbuf_dyn.h:99
char name[RTE_MBUF_DYN_NAMESIZE]
Definition: rte_mbuf_dyn.h:98