|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
29 #define foreach_vxlan_gpe_encap_error \
30 _(ENCAPSULATED, "good packets encapsulated")
36 #define _(sym,string) string,
46 #define _(sym,str) VXLAN_GPE_ENCAP_ERROR_##sym,
94 ASSERT (
sizeof (ip4_vxlan_gpe_header_t) == 36);
95 ASSERT (
sizeof (ip6_vxlan_gpe_header_t) == 56);
118 u32 * next1,
u8 is_v4)
120 ASSERT (
sizeof (ip4_vxlan_gpe_header_t) == 36);
121 ASSERT (
sizeof (ip6_vxlan_gpe_header_t) == 56);
154 u32 pkts_encapsulated = 0;
156 u32 stats_sw_if_index, stats_n_packets, stats_n_bytes;
163 stats_sw_if_index =
node->runtime_data[0];
164 stats_n_packets = stats_n_bytes = 0;
170 u32 sw_if_index0 = ~0, sw_if_index1 = ~0, len0, len1;
173 u8 is_ip4_0 = 0, is_ip4_1 = 0;
221 sw_if_index1 = sw_if_index0;
254 pkts_encapsulated += 2;
258 stats_n_packets += 2;
259 stats_n_bytes += len0 + len1;
266 || (sw_if_index1 != stats_sw_if_index)))
268 stats_n_packets -= 2;
269 stats_n_bytes -= len0 + len1;
270 if (sw_if_index0 == sw_if_index1)
276 stats_sw_if_index, stats_n_packets, stats_n_bytes);
277 stats_sw_if_index = sw_if_index0;
279 stats_n_bytes = len0 + len1;
312 n_left_to_next, bi0, bi1, next0,
350 stats_n_packets += 1;
351 stats_n_bytes += len0;
359 stats_n_packets -= 1;
360 stats_n_bytes -= len0;
369 stats_n_bytes = len0;
370 stats_sw_if_index = sw_if_index0;
381 n_left_to_next, bi0, next0);
387 VXLAN_GPE_ENCAP_ERROR_ENCAPSULATED,
395 stats_n_packets, stats_n_bytes);
396 node->runtime_data[0] = stats_sw_if_index;
405 .name =
"vxlan-gpe-encap",
406 .vector_size =
sizeof (
u32),
vnet_interface_main_t * im
vlib_buffer_t * bufs[VLIB_FRAME_SIZE]
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
vlib_node_registration_t vxlan_gpe_encap_node
(constructor) VLIB_REGISTER_NODE (vxlan_gpe_encap_node)
@ VNET_INTERFACE_COUNTER_TX
nat44_ei_hairpin_src_next_t next_index
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
vlib_get_buffers(vm, from, b, n_left_from)
@ VLIB_NODE_TYPE_INTERNAL
vlib_main_t vlib_node_runtime_t * node
u8 rewrite_size
rewrite size for dynamic plugins like iOAM
Struct for VXLAN GPE node state.
static uword vxlan_gpe_encap(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Common processing for IPv4 and IPv6 VXLAN GPE encap dispatch functions.
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
vnet_main_t * vnet_main
State convenience vnet_main_t.
@ VXLAN_GPE_ENCAP_N_ERROR
vlib_main_t vlib_node_runtime_t vlib_frame_t * from_frame
u32 encap_fib_index
FIB indices - tunnel partner lookup here.
vxlan_gpe_encap_error_t
Struct for VXLAN GPE errors/counters.
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
static void ip_udp_encap_one(vlib_main_t *vm, vlib_buffer_t *b0, u8 *ec0, word ec_len, u8 is_ip4)
#define CLIB_PREFETCH(addr, size, type)
static void vxlan_gpe_encap_two_inline(vxlan_gpe_main_t *ngm, vlib_buffer_t *b0, vlib_buffer_t *b1, vxlan_gpe_tunnel_t *t0, vxlan_gpe_tunnel_t *t1, u32 *next0, u32 *next1, u8 is_v4)
Instantiates UDP + VXLAN-GPE header then set next node to IP4|6 lookup for two packets.
static char * vxlan_gpe_encap_error_strings[]
VXLAN GPE encap error strings.
#define VXLAN_GPE_TUNNEL_IS_IPV4
Flags for vxlan_gpe_tunnel_t.
vxlan_gpe_main_t vxlan_gpe_main
u8 * rewrite
Rewrite string.
static void vxlan_gpe_encap_one_inline(vxlan_gpe_main_t *ngm, vlib_buffer_t *b0, vxlan_gpe_tunnel_t *t0, u32 *next0, u8 is_v4)
Instantiates UDP + VXLAN-GPE header then set next node to IP4|6 lookup.
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
Struct for VXLAN GPE tunnel.
@ VXLAN_GPE_ENCAP_NEXT_IP6_LOOKUP
vxlan_gpe_tunnel_t * tunnels
vector of encap tunnel instances
#define CLIB_CACHE_LINE_BYTES
@ VXLAN_GPE_ENCAP_NEXT_IP4_LOOKUP
struct _vlib_node_registration vlib_node_registration_t
vlib_combined_counter_main_t * combined_sw_if_counters
uword encap_next_node
Next node after VxLAN-GPE encap.
#define vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next, n_left_to_next, bi0, next0)
Finish enqueueing one buffer forward in the graph.
u8 * format_vxlan_gpe_encap_trace(u8 *s, va_list *args)
Trace of packets encapsulated in VXLAN GPE.
description fragment has unexpected format
Struct for tracing VXLAN GPE encapsulated packets.
vlib_put_next_frame(vm, node, next_index, 0)
static vnet_hw_interface_t * vnet_get_sup_hw_interface(vnet_main_t *vnm, u32 sw_if_index)
vlib_main_t * vlib_main
State convenience vlib_main_t.
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
@ VXLAN_GPE_ENCAP_NEXT_DROP
#define foreach_vxlan_gpe_encap_error
Statistics (not really errors)
#define vlib_validate_buffer_enqueue_x2(vm, node, next_index, to_next, n_left_to_next, bi0, bi1, next0, next1)
Finish enqueueing two buffers forward in the graph.
vl_api_interface_index_t sw_if_index
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
Get pointer to next frame vector data by (vlib_node_runtime_t, next_index).
vl_api_fib_path_type_t type
vnet_interface_main_t interface_main
vlib_increment_combined_counter(ccm, ti, sw_if_index, n_buffers, n_bytes)
VLIB buffer representation.
#define VLIB_REGISTER_NODE(x,...)
vl_api_wireguard_peer_flags_t flags