36 #define foreach_gbp_vxlan_input_next \ 37 _(DROP, "error-drop") \ 38 _(L2_INPUT, "l2-input") \ 39 _(IP4_INPUT, "ip4-input") \ 40 _(IP6_INPUT, "ip6-input") 44 #define _(s,n) GBP_VXLAN_INPUT_NEXT_##s, 51 #define foreach_gbp_vxlan_error \ 52 _(DECAPPED, "decapped") \ 57 #define _(s,n) GBP_VXLAN_ERROR_##s, 74 u32 n_left_to_next, n_left_from, next_index, *to_next, *from;
80 while (n_left_from > 0)
85 while (n_left_from > 0 && n_left_to_next > 0)
94 bi0 = to_next[0] = from[0];
99 next0 = GBP_VXLAN_INPUT_NEXT_DROP;
111 next0 = GBP_VXLAN_INPUT_NEXT_DROP;
119 if (GBP_VXLAN_TUN_L2 == gt0->
gt_layer)
123 next0 = GBP_VXLAN_INPUT_NEXT_L2_INPUT;
134 type0 = clib_net_to_host_u16 (e0->
type);
137 case ETHERNET_TYPE_IP4:
138 next0 = GBP_VXLAN_INPUT_NEXT_IP4_INPUT;
140 case ETHERNET_TYPE_IP6:
141 next0 = GBP_VXLAN_INPUT_NEXT_IP6_INPUT;
156 tr->
dropped = (next0 == GBP_VXLAN_INPUT_NEXT_DROP);
164 to_next, n_left_to_next,
188 s =
format (s,
"vni:%d dropped:%d rx:%d sclass:%d flags:%U",
198 .name =
"gbp-vxlan4",
199 .vector_size =
sizeof (
u32),
205 #define _(s,n) [GBP_VXLAN_INPUT_NEXT_##s] = n, u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
static vlib_cli_command_t trace
(constructor) VLIB_CLI_COMMAND (trace)
#define VLIB_NODE_FN(node)
uword * gv_db
DB of added tunnels.
u8 * format_vxlan_gbp_header_gpflags(u8 *s, va_list *args)
struct gbp_vxlan_trace_t_ gbp_vxlan_trace_t
vlib_node_registration_t gbp_vxlan4_input_node
(constructor) VLIB_REGISTER_NODE (gbp_vxlan4_input_node)
static vxlan_gbp_gpflags_t vxlan_gbp_get_gpflags(vxlan_gbp_header_t *h)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
#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.
#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).
#define VLIB_REGISTER_NODE(x,...)
static u16 vxlan_gbp_get_sclass(vxlan_gbp_header_t *h)
static u32 vxlan_gbp_get_vni(vxlan_gbp_header_t *h)
void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
Release pointer to next frame vector data.
vlib_main_t vlib_node_runtime_t * node
#define foreach_gbp_vxlan_error
gbp_vxlan_tunnel_layer_t gt_layer
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
gbp_vxlan_tunnel_t * gbp_vxlan_tunnel_get(index_t gti)
VLIB buffer representation.
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
GBP VXLAN (template) tunnel.
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
static char * gbp_vxlan_error_strings[]
static u8 * format_gbp_vxlan_rx_trace(u8 *s, va_list *args)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
#define foreach_gbp_vxlan_input_next
static uword gbp_vxlan_decap(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame, u8 is_ip4)