18 #include <sys/socket.h> 23 #include <linux-cp/lcp.api_enum.h> 35 #define foreach_lip_punt \ 36 _ (IO, "punt to host") \ 37 _ (DROP, "unknown input interface") 41 #define _(sym, str) LIP_PUNT_NEXT_##sym, 76 next_index = node->cached_next_index;
80 while (n_left_from > 0)
84 while (n_left_from > 0 && n_left_to_next > 0)
93 bi0 = to_next[0] = from[0];
99 next0 = LIP_PUNT_NEXT_DROP;
109 next0 = LIP_PUNT_NEXT_IO;
138 n_left_to_next, bi0, next0);
148 .name =
"linux-cp-punt",
149 .vector_size =
sizeof (
u32),
155 [LIP_PUNT_NEXT_DROP] =
"error-drop",
156 [LIP_PUNT_NEXT_IO] =
"interface-output",
160 #define foreach_lcp_punt_l3 _ (DROP, "unknown error") 164 #define _(sym, str) LCP_LOCAL_NEXT_##sym, 194 next_index = node->cached_next_index;
195 n_left_from =
frame->n_vectors;
198 while (n_left_from > 0)
202 while (n_left_from > 0 && n_left_to_next > 0)
205 u32 next0 = LCP_LOCAL_NEXT_DROP;
210 bi0 = to_next[0] = from[0];
230 b0->
flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
241 n_left_to_next, bi0, next0);
247 return frame->n_vectors;
251 .name =
"linux-cp-punt-l3",
252 .vector_size =
sizeof (
u32),
258 [LCP_LOCAL_NEXT_DROP] =
"error-drop",
263 .arc_name =
"ip4-punt",
264 .node_name =
"linux-cp-punt-l3",
269 .arc_name =
"ip6-punt",
270 .node_name =
"linux-cp-punt-l3",
274 #define foreach_lcp_xc \ 276 _ (XC_IP4, "x-connnect-ip4") \ 277 _ (XC_IP6, "x-connnect-ip6") 281 #define _(sym, str) LCP_XC_NEXT_##sym, 332 while (n_left_from > 0)
336 while (n_left_from > 0 && n_left_to_next > 0)
340 u32 next0, bi0, lipi, ai;
343 bi0 = to_next[0] = from[0];
372 next0 = adj->rewrite_header.next_index;
383 next0 = LCP_XC_NEXT_DROP;
393 n_left_to_next, bi0, next0);
415 .vector_size =
sizeof (
u32),
418 .sibling_of =
"ip4-rewrite" };
421 .arc_name =
"ip4-unicast",
422 .node_name =
"linux-cp-xc-ip4",
425 .arc_name =
"ip4-multicast",
426 .node_name =
"linux-cp-xc-ip4",
430 .vector_size =
sizeof (
u32),
433 .sibling_of =
"ip6-rewrite" };
436 .arc_name =
"ip6-unicast",
437 .node_name =
"linux-cp-xc-ip6",
440 .arc_name =
"ip6-multicast",
441 .node_name =
"linux-cp-xc-ip6",
466 while (n_left_from > 0)
470 while (n_left_from > 0 && n_left_to_next > 0)
477 bi0 = to_next[0] = from[0];
490 b0->
flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
509 n_left_to_next, bi0, next0);
534 .name =
"linux-cp-xc-l3-ip4",
535 .vector_size =
sizeof (
u32),
546 .arc_name =
"ip4-unicast",
547 .node_name =
"linux-cp-xc-l3-ip4",
551 .arc_name =
"ip4-multicast",
552 .node_name =
"linux-cp-xc-l3-ip4",
556 .name =
"linux-cp-xc-l3-ip6",
557 .vector_size =
sizeof (
u32),
568 .arc_name =
"ip6-unicast",
569 .node_name =
"linux-cp-xc-l3-ip6",
573 .arc_name =
"ip6-multicast",
574 .node_name =
"linux-cp-xc-l3-ip6",
577 #define foreach_lcp_arp \ 578 _ (DROP, "error-drop") \ 579 _ (IO, "interface-output") 583 #define _(sym, str) LCP_ARP_NEXT_##sym, 620 next_index = node->cached_next_index;
621 n_left_from =
frame->n_vectors;
624 while (n_left_from > 0)
628 while (n_left_from >= 2 && n_left_to_next >= 2)
630 u32 next0, next1, bi0, bi1;
634 bi0 = to_next[0] = from[0];
635 bi1 = to_next[1] = from[1];
642 next0 = next1 = LCP_ARP_NEXT_DROP;
657 if (arp0->
opcode == clib_host_to_net_u16 (ETHERNET_ARP_OPCODE_reply))
685 if (arp1->
opcode == clib_host_to_net_u16 (ETHERNET_ARP_OPCODE_reply))
726 n_left_to_next, bi0, bi1, next0,
730 while (n_left_from > 0 && n_left_to_next > 0)
737 bi0 = to_next[0] = from[0];
743 next0 = LCP_ARP_NEXT_DROP;
754 arp_opcode = clib_host_to_net_u16 (arp0->
opcode);
756 if (arp_opcode == ETHERNET_ARP_OPCODE_reply)
794 n_left_to_next, bi0, next0);
802 LCP_ARP_NEXT_IO, n_copies);
804 return frame->n_vectors;
808 .name =
"linux-cp-arp-phy",
809 .vector_size =
sizeof (
u32),
813 .n_errors = LINUXCP_N_ERROR,
814 .error_counters = linuxcp_error_counters,
818 [LCP_ARP_NEXT_DROP] =
"error-drop",
819 [LCP_ARP_NEXT_IO] =
"interface-output",
825 .node_name =
"linux-cp-arp-phy",
838 next_index = node->cached_next_index;
839 n_left_from =
frame->n_vectors;
842 while (n_left_from > 0)
846 while (n_left_from > 0 && n_left_to_next > 0)
849 lcp_arp_next_t next0;
854 bi0 = to_next[0] = from[0];
860 next0 = LCP_ARP_NEXT_IO;
882 n_left_to_next, bi0, next0);
888 return frame->n_vectors;
892 .name =
"linux-cp-arp-host",
893 .vector_size =
sizeof (
u32),
897 .n_errors = LINUXCP_N_ERROR,
898 .error_counters = linuxcp_error_counters,
902 [LCP_ARP_NEXT_DROP] =
"error-drop",
903 [LCP_ARP_NEXT_IO] =
"interface-output",
909 .node_name =
"linux-cp-arp-host",
lip_host_type_t lip_host_type
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 u8 * format_lcp_arp_trace(u8 *s, va_list *args)
Definitions for all things IP (v4|v6) unicast and multicast lookup related.
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
struct lcp_punt_l3_trace_t_ lcp_punt_l3_trace_t
struct lip_punt_trace_t_ lip_punt_trace_t
ip_lookup_main_t lookup_main
#define VLIB_NODE_FN(node)
static u8 * format_lcp_xc_trace(u8 *s, va_list *args)
struct lcp_arp_trace_t_ lcp_arp_trace_t
static vlib_buffer_t * vlib_buffer_copy(vlib_main_t *vm, vlib_buffer_t *b)
static index_t lcp_itf_pair_find_by_phy(u32 phy_sw_if_index)
u8 output_feature_arc_index
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
static ip_adjacency_t * adj_get(adj_index_t adj_index)
Get a pointer to an adjacency object from its index.
#define static_always_inline
description fragment has unexpected format
static_always_inline void vlib_buffer_enqueue_to_single_next(vlib_main_t *vm, vlib_node_runtime_t *node, u32 *buffers, u16 next_index, u32 count)
VNET_FEATURE_INIT(lcp_punt_l3_ip4, static)
vlib_node_registration_t lcp_arp_host_node
(constructor) VLIB_REGISTER_NODE (lcp_arp_host_node)
static u32 vlib_get_buffer_index(vlib_main_t *vm, void *p)
Translate buffer pointer into buffer index.
lip_punt_next_t next_index
static_always_inline u32 lcp_xc_l3_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, ip_address_family_t af)
X-connect all packets from the HOST to the PHY on L3 interfaces.
vl_api_fib_path_type_t type
#define ADJ_INDEX_INVALID
Invalid ADJ index - used when no adj is known likewise blazoned capitals INVALID speak volumes where ...
static ethernet_header_t * ethernet_buffer_get_header(vlib_buffer_t *b)
vl_api_interface_index_t sw_if_index
#define foreach_lcp_punt_l3
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
static_always_inline void * vnet_feature_arc_start_w_cfg_index(u8 arc, u32 sw_if_index, u32 *next, vlib_buffer_t *b, u32 cfg_index)
#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.
#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).
static u8 * format_lip_punt_trace(u8 *s, va_list *args)
static_always_inline adj_index_t lcp_adj_lkup(const u8 *rewrite, u8 len, u32 sw_if_index)
static uword ethernet_address_cast(const u8 *a)
#define VLIB_REGISTER_NODE(x,...)
static index_t lcp_itf_pair_find_by_host(u32 host_sw_if_index)
static_always_inline void vnet_feature_next(u32 *next0, vlib_buffer_t *b0)
struct lcp_xc_trace_t_ lcp_xc_trace_t
u32 adj_index_t
An index for adjacencies.
ip_lookup_main_t lookup_main
lcp_itf_phy_adj_t lip_phy_adjs
vlib_put_next_frame(vm, node, next_index, 0)
u32 ia_cfg_index
feature [arc] config index
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
static u8 * format_lcp_punt_l3_trace(u8 *s, va_list *args)
#define VNET_FEATURES(...)
enum ip_address_family_t_ ip_address_family_t
vlib_main_t vlib_node_runtime_t * node
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
VLIB buffer representation.
adj_index_t adj_index[N_AF]
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
static_always_inline u32 lcp_xc_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, ip_address_family_t af)
X-connect all packets from the HOST to the PHY.
vlib_main_t * vm
Pass punted packets from the PHY to the HOST.
lcp_itf_pair_t * lcp_itf_pair_get(u32 index)
Get an interface-pair object from its VPP index.
ip4_main_t ip4_main
Global ip4 main structure.
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
This adjacency/interface has output features configured.
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.