|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
49 (
u32) sizeof (t->
h) );
54 LISP_GPE_INPUT_NEXT_DROP,
55 LISP_GPE_INPUT_NEXT_IP4_INPUT,
56 LISP_GPE_INPUT_NEXT_IP6_INPUT,
57 LISP_GPE_INPUT_NEXT_L2_INPUT,
58 LISP_GPE_INPUT_NEXT_DROP
71 return LISP_GPE_INPUT_NEXT_DROP;
76 else if ((lgh->
flags & LISP_GPE_FLAGS_P) == 0)
80 return LISP_GPE_INPUT_NEXT_IP4_INPUT;
82 return LISP_GPE_INPUT_NEXT_IP6_INPUT;
84 return LISP_GPE_INPUT_NEXT_DROP;
87 return LISP_GPE_INPUT_NEXT_DROP;
93 if (LISP_GPE_INPUT_NEXT_IP4_INPUT ==
next_index
94 || LISP_GPE_INPUT_NEXT_IP6_INPUT ==
next_index)
96 else if (LISP_GPE_INPUT_NEXT_L2_INPUT ==
next_index)
100 clib_warning (
"next_index not associated to an interface!");
153 u32 n_bytes = 0, n_packets = 0, last_sw_if_index = ~0, drops = 0;
172 ip4_udp_lisp_gpe_header_t *iul4_0, *iul4_1;
173 ip6_udp_lisp_gpe_header_t *iul6_0, *iul6_1;
175 u32 next0, next1, error0, error1;
258 clib_net_to_host_u32 (lh0->
iid << 8));
260 clib_net_to_host_u32 (lh1->
iid << 8));
271 &last_sw_if_index, &n_packets, &
n_bytes);
277 next0 = LISP_GPE_INPUT_NEXT_DROP;
278 error0 = LISP_GPE_ERROR_NO_TUNNEL;
286 &last_sw_if_index, &n_packets, &
n_bytes);
292 next1 = LISP_GPE_INPUT_NEXT_DROP;
293 error1 = LISP_GPE_ERROR_NO_TUNNEL;
297 b0->
error = error0 ?
node->errors[error0] : 0;
298 b1->
error = error1 ?
node->errors[error1] : 0;
319 n_left_to_next, bi0, bi1, next0,
328 ip4_udp_lisp_gpe_header_t *iul4_0;
329 ip6_udp_lisp_gpe_header_t *iul6_0;
392 clib_net_to_host_u32 (lh0->
iid << 8));
401 &last_sw_if_index, &n_packets, &
n_bytes);
407 next0 = LISP_GPE_INPUT_NEXT_DROP;
408 error0 = LISP_GPE_ERROR_NO_TUNNEL;
413 b0->
error = error0 ?
node->errors[error0] : 0;
425 n_left_to_next, bi0, next0);
435 LISP_GPE_ERROR_NO_TUNNEL, drops);
454 #define lisp_gpe_error(n,s) s,
456 #undef lisp_gpe_error
462 .name =
"lisp-gpe-ip4-input",
464 .vector_size =
sizeof (
u32),
467 #define _(s,n) [LISP_GPE_INPUT_NEXT_##s] = n,
484 .name =
"lisp-gpe-ip6-input",
486 .vector_size =
sizeof (
u32),
489 #define _(s,n) [LISP_GPE_INPUT_NEXT_##s] = n,
515 != LISP_GPE_INPUT_NEXT_DROP)
556 "lisp gpe placeholder nsh decap",
562 .name =
"lisp-gpe-nsh-placeholder-input",
563 .vector_size =
sizeof (
u32),
591 .path =
"test one nsh add-placeholder-decap-node",
vnet_interface_main_t * im
u8 * format_lisp_gpe_header_with_length(u8 *s, va_list *args)
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
static uword vlib_node_add_next(vlib_main_t *vm, uword node, uword next_node)
nat44_ei_hairpin_src_next_t next_index
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
static clib_error_t * lisp_add_placeholder_nsh_node_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
@ VLIB_NODE_TYPE_INTERNAL
gpe_encap_mode_t encap_mode
vlib_main_t vlib_node_runtime_t * node
@ LISP_GPE_NEXT_PROTO_NSH
static u8 * format_lisp_gpe_rx_trace(u8 *s, va_list *args)
#define vlib_call_init_function(vm, x)
static uword lisp_gpe_ip6_input(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
vlib_main_t vlib_node_runtime_t vlib_frame_t * from_frame
static u32 next_proto_to_next_index[LISP_GPE_NEXT_PROTOS]
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
tunnel_lookup_t nsh_ifaces
uword vlib_node_add_next_with_slot(vlib_main_t *vm, uword node_index, uword next_node_index, uword slot)
static lisp_gpe_main_t * vnet_lisp_gpe_get_main()
#define CLIB_PREFETCH(addr, size, type)
tunnel_lookup_t l3_ifaces
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
vlib_error_t error
Error code for buffers to be enqueued to error handler.
static_always_inline void incr_decap_stats(vnet_main_t *vnm, u32 thread_index, u32 length, u32 sw_if_index, u32 *last_sw_if_index, u32 *n_packets, u32 *n_bytes)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
clib_error_t * lisp_gpe_init(vlib_main_t *vm)
LISP-GPE init function.
#define static_always_inline
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
#define VLIB_CLI_COMMAND(x,...)
static char * lisp_gpe_ip4_input_error_strings[]
@ VNET_INTERFACE_COUNTER_RX
static uword lisp_gpe_ip4_input(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
#define CLIB_CACHE_LINE_BYTES
struct _vlib_node_registration vlib_node_registration_t
vlib_combined_counter_main_t * combined_sw_if_counters
static uword lisp_gpe_input_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame, u8 is_v4)
LISP-GPE decap dispatcher.
static void gpe_add_arc_from_input_to_nsh()
Adds arc from lisp-gpe-input to nsh-input if nsh-input is available.
#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.
vlib_node_t * vlib_get_node_by_name(vlib_main_t *vm, u8 *name)
static char * lisp_gpe_nsh_placeholder_error_strings[]
description fragment has unexpected format
clib_error_t * gpe_decap_init(vlib_main_t *vm)
GPE decap init function.
static uword lisp_gpe_nsh_placeholder_input(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
vlib_put_next_frame(vm, node, next_index, 0)
#define VLIB_INIT_FUNCTION(x)
static vlib_cli_command_t lisp_add_placeholder_nsh_node_command
(constructor) VLIB_CLI_COMMAND (lisp_add_placeholder_nsh_node_command)
vlib_node_registration_t lisp_gpe_ip6_input_node
(constructor) VLIB_REGISTER_NODE (lisp_gpe_ip6_input_node)
vlib_main_t * vlib_main
convenience
static u32 next_protocol_to_next_index(lisp_gpe_header_t *lgh, u8 *next_header)
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
vlib_node_registration_t lisp_gpe_ip4_input_node
(constructor) VLIB_REGISTER_NODE (lisp_gpe_ip4_input_node)
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
#define clib_warning(format, args...)
#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.
uword * sw_if_index_by_vni
lookup decap tunnel termination sw_if_index by vni and vice versa
#define foreach_lisp_gpe_ip_input_next
static tunnel_lookup_t * next_index_to_iface(lisp_gpe_main_t *lgm, u32 next_index)
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).
vlib_node_registration_t lisp_gpe_nsh_placeholder_input_node
(constructor) VLIB_REGISTER_NODE (lisp_gpe_nsh_placeholder_input_node)
tunnel_lookup_t l2_ifaces
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)
#define LISP_GPE_INPUT_NEXT_NSH_INPUT
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
VLIB buffer representation.
#define VLIB_REGISTER_NODE(x,...)