|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
40 #ifndef included_vnet_buffer_h
41 #define included_vnet_buffer_h
49 #define foreach_vnet_buffer_flag \
50 _ (1, L4_CHECKSUM_COMPUTED, "l4-cksum-computed", 1) \
51 _ (2, L4_CHECKSUM_CORRECT, "l4-cksum-correct", 1) \
52 _ (3, VLAN_2_DEEP, "vlan-2-deep", 1) \
53 _ (4, VLAN_1_DEEP, "vlan-1-deep", 1) \
54 _ (5, SPAN_CLONE, "span-clone", 1) \
55 _ (6, LOOP_COUNTER_VALID, "loop-counter-valid", 0) \
56 _ (7, LOCALLY_ORIGINATED, "local", 1) \
57 _ (8, IS_IP4, "ip4", 1) \
58 _ (9, IS_IP6, "ip6", 1) \
59 _ (10, OFFLOAD, "offload", 0) \
60 _ (11, IS_NATED, "natted", 1) \
61 _ (12, L2_HDR_OFFSET_VALID, "l2_hdr_offset_valid", 0) \
62 _ (13, L3_HDR_OFFSET_VALID, "l3_hdr_offset_valid", 0) \
63 _ (14, L4_HDR_OFFSET_VALID, "l4_hdr_offset_valid", 0) \
64 _ (15, FLOW_REPORT, "flow-report", 1) \
65 _ (16, IS_DVR, "dvr", 1) \
66 _ (17, QOS_DATA_VALID, "qos-data-valid", 0) \
67 _ (18, GSO, "gso", 0) \
68 _ (19, AVAIL1, "avail1", 1) \
69 _ (20, AVAIL2, "avail2", 1) \
70 _ (21, AVAIL3, "avail3", 1) \
71 _ (22, AVAIL4, "avail4", 1) \
72 _ (23, AVAIL5, "avail5", 1) \
73 _ (24, AVAIL6, "avail6", 1) \
74 _ (25, AVAIL7, "avail7", 1) \
75 _ (26, AVAIL8, "avail8", 1) \
76 _ (27, AVAIL9, "avail9", 1)
84 #define VNET_BUFFER_FLAGS_ALL_AVAIL \
85 (VNET_BUFFER_F_AVAIL1 | VNET_BUFFER_F_AVAIL2 | VNET_BUFFER_F_AVAIL3 | \
86 VNET_BUFFER_F_AVAIL4 | VNET_BUFFER_F_AVAIL5 | VNET_BUFFER_F_AVAIL6 | \
87 VNET_BUFFER_F_AVAIL7 | VNET_BUFFER_F_AVAIL8 | VNET_BUFFER_F_AVAIL9)
89 #define VNET_BUFFER_FLAGS_VLAN_BITS \
90 (VNET_BUFFER_F_VLAN_1_DEEP | VNET_BUFFER_F_VLAN_2_DEEP)
94 #define _(bit, name, s, v) VNET_BUFFER_F_##name = (1 << LOG2_VLIB_BUFFER_FLAG_USER(bit)),
101 #define _(bit, name, s, v) VNET_BUFFER_F_LOG2_##name = LOG2_VLIB_BUFFER_FLAG_USER(bit),
108 "VLIB / VNET buffer flags overlap");
110 #define foreach_vnet_buffer_offload_flag \
111 _ (0, IP_CKSUM, "offload-ip-cksum", 1) \
112 _ (1, TCP_CKSUM, "offload-tcp-cksum", 1) \
113 _ (2, UDP_CKSUM, "offload-udp-cksum", 1) \
114 _ (3, OUTER_IP_CKSUM, "offload-outer-ip-cksum", 1) \
115 _ (4, OUTER_TCP_CKSUM, "offload-outer-tcp-cksum", 1) \
116 _ (5, OUTER_UDP_CKSUM, "offload-outer-udp-cksum", 1)
120 #define _(bit, name, s, v) VNET_BUFFER_OFFLOAD_F_##name = (1 << bit),
125 #define foreach_buffer_opaque_union_subtype \
231 u8 save_rewrite_length;
273 u8 save_rewrite_length;
407 #define VNET_REWRITE_TOTAL_BYTES (VLIB_BUFFER_PRE_DATA_SIZE)
411 ip.reass.save_rewrite_length)
413 ip.reass.save_rewrite_length) ==
418 "save_rewrite_length member must be able to hold the max value of rewrite length");
422 ip.reass.save_rewrite_length)
426 ip.reass.save_rewrite_length),
427 "save_rewrite_length must be aligned so that reass doesn't overwrite it");
435 "VNET buffer meta-data too large for vlib_buffer");
437 #define vnet_buffer(b) ((vnet_buffer_opaque_t *) (b)->opaque)
499 #define vnet_buffer2(b) ((vnet_buffer_opaque2_t *) (b)->opaque2)
507 "VNET buffer opaque2 meta-data too large for vlib_buffer");
509 #define gso_mtu_sz(b) (vnet_buffer2(b)->gso_size + \
510 vnet_buffer2(b)->gso_l4_hdr_sz + \
511 vnet_buffer(b)->l4_hdr_offset - \
512 vnet_buffer (b)->l3_hdr_offset)
524 if (
b->
flags & VNET_BUFFER_F_OFFLOAD)
533 b->
flags |= VNET_BUFFER_F_OFFLOAD;
542 b->
flags &= ~VNET_BUFFER_F_OFFLOAD;
#define VNET_BUFFER_FLAGS_ALL_AVAIL
nat44_ei_hairpin_src_next_t next_index
format_function_t format_vnet_buffer_offload
format_function_t format_vnet_buffer_opaque
static_always_inline void vnet_buffer_offload_flags_set(vlib_buffer_t *b, vnet_buffer_oflags_t oflags)
#define VLIB_BUFFER_FLAGS_ALL
#define STRUCT_OFFSET_OF(t, f)
#define VNET_REWRITE_TOTAL_BYTES
#define foreach_vnet_buffer_offload_flag
static_always_inline void vnet_buffer_offload_flags_clear(vlib_buffer_t *b, vnet_buffer_oflags_t oflags)
STATIC_ASSERT(((VNET_BUFFER_FLAGS_ALL_AVAIL &VLIB_BUFFER_FLAGS_ALL)==0), "VLIB / VNET buffer flags overlap")
#define static_always_inline
u32 cached_dst_nat_session_index
vnet_buffer_oflags_t oflags
u32 required_thread_index
#define foreach_vnet_buffer_flag
Flags that are set in the high order bits of ((vlib_buffer*)b)->flags.
u16 hdr_offset
offset relative to ip hdr
u16 data_offset
offset relative to ip hdr
format_function_t format_vnet_buffer_flags
u8 icmp_type_or_tcp_flags
u8 pad[3]
log2 (size of the packing page block)
vl_api_interface_index_t sw_if_index
format_function_t format_vnet_buffer_opaque2
#define STRUCT_SIZE_OF(t, f)
format_function_t format_vnet_buffer
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
VLIB buffer representation.
vl_api_wireguard_peer_flags_t flags