Blog
Community
Development
Documentation
CNDP
22.08.0
node_private.h
1
/* SPDX-License-Identifier: BSD-3-Clause
2
* Copyright (c) 2020 Marvell International Ltd.
3
*/
4
5
#ifndef __NODE_PRIVATE_H__
6
#define __NODE_PRIVATE_H__
7
8
#include <
cne_common.h
>
9
#include <
cne_log.h
>
10
#include <
pktmbuf.h
>
11
12
#define NODE_LOG(level, node_name, ...) \
13
cne_log(CNE_LOG_##level, __func__, __LINE__, \
14
CNE_FMT("NODE: %s: "
CNE_FMT_HEAD(__VA_ARGS__, ) "\n", node_name, \
15
CNE_FMT_TAIL(__VA_ARGS__, )))
16
17
#define node_err(node_name, ...) NODE_LOG(ERR, node_name, __VA_ARGS__)
18
#define node_info(node_name, ...) NODE_LOG(INFO, node_name, __VA_ARGS__)
19
#define node_dbg(node_name, ...) NODE_LOG(DEBUG, node_name, __VA_ARGS__)
20
24
struct
node_mbuf_priv1
{
25
union
{
26
/* IP4 rewrite */
27
struct
{
28
uint16_t nh;
29
uint16_t ttl;
30
uint32_t cksum;
31
};
32
33
uint64_t u;
34
};
35
};
36
37
extern
int
node_mbuf_priv1_dynfield_offset;
38
42
struct
node_mbuf_priv2
{
43
uint64_t priv_data;
44
}
__cne_cache_aligned
;
45
46
#define NODE_MBUF_PRIV2_SIZE sizeof(struct node_mbuf_priv2)
47
48
#define OBJS_PER_CLINE (CNE_CACHE_LINE_SIZE / sizeof(void *))
49
59
static
__cne_always_inline
struct
node_mbuf_priv1
*
60
node_mbuf_priv1
(
pktmbuf_t
*m,
const
int
offset)
61
{
62
return
(
struct
node_mbuf_priv1
*)((
char
*)m + offset);
63
}
64
74
static
__cne_always_inline
struct
node_mbuf_priv2
*
75
node_mbuf_priv2
(
pktmbuf_t
*m)
76
{
77
return
(
struct
node_mbuf_priv2
*)((
char
*)
pktmbuf_udata64
(m) +
sizeof
(uint64_t));
78
}
79
80
#endif
/* __NODE_PRIVATE_H__ */
cne_common.h
__cne_cache_aligned
#define __cne_cache_aligned
Definition:
cne_common.h:379
__cne_always_inline
#define __cne_always_inline
Definition:
cne_common.h:218
cne_log.h
pktmbuf.h
pktmbuf_udata64
#define pktmbuf_udata64(m)
Definition:
pktmbuf.h:362
node_mbuf_priv1
Definition:
node_private.h:24
node_mbuf_priv2
Definition:
node_private.h:42
pktmbuf_s
Definition:
pktmbuf.h:102
lib
usr
clib
nodes
node_private.h
Generated by
1.9.1