DPDK
25.11.0
Toggle main menu visibility
Loading...
Searching...
No Matches
rte_node_mbuf_dynfield.h
Go to the documentation of this file.
1
/* SPDX-License-Identifier: BSD-3-Clause
2
* Copyright(C) 2025 Marvell International Ltd.
3
*/
4
5
#ifndef _RTE_GRAPH_MBUF_DYNFIELD_H_
6
#define _RTE_GRAPH_MBUF_DYNFIELD_H_
7
8
#include <
rte_common.h
>
9
#include <
rte_mbuf.h
>
10
#include <
rte_mbuf_dyn.h
>
11
22
23
#ifdef __cplusplus
24
extern
"C"
{
25
#endif
26
27
#ifndef RTE_NODE_MBUF_PERSISTENT_FIELDS_SIZE
29
#define RTE_NODE_MBUF_PERSISTENT_FIELDS_SIZE (0)
30
#endif
/* !RTE_NODE_MBUF_PERSISTENT_FIELDS_SIZE */
31
32
#ifndef RTE_NODE_MBUF_OVERLOADABLE_FIELDS_SIZE
34
#define RTE_NODE_MBUF_OVERLOADABLE_FIELDS_SIZE (8)
35
#endif
/* !RTE_NODE_MBUF_OVERLOADABLE_FIELDS_SIZE */
36
38
#define RTE_NODE_MBUF_DYNFIELD_SIZE \
39
(RTE_NODE_MBUF_PERSISTENT_FIELDS_SIZE + RTE_NODE_MBUF_OVERLOADABLE_FIELDS_SIZE)
40
48
typedef
struct
rte_node_mbuf_overload_fields
{
49
union
{
50
/* Following fields used by ip[4|6]-lookup -> ip[4|6]-rewrite nodes */
51
union
{
52
struct
{
53
uint16_t nh;
54
uint16_t ttl;
55
uint32_t cksum;
56
};
57
uint64_t u;
58
};
59
uint8_t data[
RTE_NODE_MBUF_OVERLOADABLE_FIELDS_SIZE
];
60
};
61
}
rte_node_mbuf_overload_fields_t
;
62
71
typedef
struct
rte_node_mbuf_dynfield
{
72
#if RTE_NODE_MBUF_PERSISTENT_FIELDS_SIZE > 0
79
union
{
80
uint8_t persistent_data[
RTE_NODE_MBUF_PERSISTENT_FIELDS_SIZE
];
81
};
82
#endif
92
rte_node_mbuf_overload_fields_t
overloadable_data
;
93
}
rte_node_mbuf_dynfield_t
;
94
105
__rte_experimental
106
static
__rte_always_inline
rte_node_mbuf_dynfield_t
*
107
rte_node_mbuf_dynfield_get
(
struct
rte_mbuf
*m,
const
int
offset)
108
{
109
return
RTE_MBUF_DYNFIELD
(m, offset,
struct
rte_node_mbuf_dynfield
*);
110
}
111
123
__rte_experimental
124
static
__rte_always_inline
rte_node_mbuf_overload_fields_t
*
125
rte_node_mbuf_overload_fields_get
(
struct
rte_mbuf
*m,
const
int
offset)
126
{
127
rte_node_mbuf_dynfield_t
*f = NULL;
128
129
f =
RTE_MBUF_DYNFIELD
(m, offset,
rte_node_mbuf_dynfield_t
*);
130
131
return
&(f->
overloadable_data
);
132
}
133
151
__rte_experimental
152
int
rte_node_mbuf_dynfield_register
(
void
);
153
154
#ifdef __cplusplus
155
}
156
#endif
157
158
#endif
/* _RTE_GRAPH_MBUF_DYNFIELD_H_ */
rte_common.h
__rte_always_inline
#define __rte_always_inline
Definition
rte_common.h:490
rte_mbuf.h
rte_mbuf_dyn.h
RTE_MBUF_DYNFIELD
#define RTE_MBUF_DYNFIELD(m, offset, type)
Definition
rte_mbuf_dyn.h:228
RTE_NODE_MBUF_PERSISTENT_FIELDS_SIZE
#define RTE_NODE_MBUF_PERSISTENT_FIELDS_SIZE
Definition
rte_node_mbuf_dynfield.h:29
rte_node_mbuf_overload_fields_t
struct rte_node_mbuf_overload_fields rte_node_mbuf_overload_fields_t
rte_node_mbuf_dynfield_register
__rte_experimental int rte_node_mbuf_dynfield_register(void)
RTE_NODE_MBUF_OVERLOADABLE_FIELDS_SIZE
#define RTE_NODE_MBUF_OVERLOADABLE_FIELDS_SIZE
Definition
rte_node_mbuf_dynfield.h:34
rte_node_mbuf_dynfield_get
static __rte_experimental __rte_always_inline rte_node_mbuf_dynfield_t * rte_node_mbuf_dynfield_get(struct rte_mbuf *m, const int offset)
Definition
rte_node_mbuf_dynfield.h:107
rte_node_mbuf_dynfield_t
struct rte_node_mbuf_dynfield rte_node_mbuf_dynfield_t
rte_node_mbuf_overload_fields_get
static __rte_experimental __rte_always_inline rte_node_mbuf_overload_fields_t * rte_node_mbuf_overload_fields_get(struct rte_mbuf *m, const int offset)
Definition
rte_node_mbuf_dynfield.h:125
rte_mbuf
Definition
rte_mbuf_core.h:475
rte_node_mbuf_dynfield
Definition
rte_node_mbuf_dynfield.h:71
rte_node_mbuf_dynfield::overloadable_data
rte_node_mbuf_overload_fields_t overloadable_data
Definition
rte_node_mbuf_dynfield.h:92
rte_node_mbuf_overload_fields
Definition
rte_node_mbuf_dynfield.h:48
lib
node
rte_node_mbuf_dynfield.h
Generated by
1.17.0