|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
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,
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,
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,
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);
399 return frame->n_vectors;
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",
477 bi0 = to_next[0] =
from[0];
490 b0->
flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
509 n_left_to_next, bi0, next0);
515 return frame->n_vectors;
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,
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,
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);
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",
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",
vlib_node_registration_t lcp_xc_l3_ip6_node
(constructor) VLIB_REGISTER_NODE (lcp_xc_l3_ip6_node)
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
static index_t lcp_itf_pair_find_by_host(u32 host_sw_if_index)
ip_lookup_main_t lookup_main
static vlib_buffer_t * vlib_buffer_copy(vlib_main_t *vm, vlib_buffer_t *b)
ip4_main_t ip4_main
Global ip4 main structure.
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
#define ADJ_INDEX_INVALID
Invalid ADJ index - used when no adj is known likewise blazoned capitals INVALID speak volumes where ...
static u8 * format_lip_punt_trace(u8 *s, va_list *args)
@ VLIB_NODE_TYPE_INTERNAL
@ VNET_REWRITE_HAS_FEATURES
This adjacency/interface has output features configured.
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_node_registration_t lcp_xc_ip4
(constructor) VLIB_REGISTER_NODE (lcp_xc_ip4)
lcp_itf_phy_adj_t lip_phy_adjs
adj_index_t adj_index[N_AF]
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)
lcp_itf_pair_t * lcp_itf_pair_get(u32 index)
Get an interface-pair object from its VPP index.
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)
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
#define VLIB_NODE_FN(node)
struct lcp_punt_l3_trace_t_ lcp_punt_l3_trace_t
static_always_inline void vnet_feature_next(u32 *next0, vlib_buffer_t *b0)
static u32 vlib_get_buffer_index(vlib_main_t *vm, void *p)
Translate buffer pointer into buffer index.
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
vlib_node_registration_t lcp_xc_ip6
(constructor) VLIB_REGISTER_NODE (lcp_xc_ip6)
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
#define static_always_inline
vlib_node_registration_t lcp_punt_l3_node
(constructor) VLIB_REGISTER_NODE (lcp_punt_l3_node)
static u8 * format_lcp_punt_l3_trace(u8 *s, va_list *args)
vlib_main_t vlib_node_runtime_t * node
struct _vlib_node_registration vlib_node_registration_t
lip_host_type_t lip_host_type
vlib_node_registration_t lip_punt_node
(constructor) VLIB_REGISTER_NODE (lip_punt_node)
#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.
lip_punt_next_t next_index
description fragment has unexpected format
#define foreach_lcp_punt_l3
vlib_put_next_frame(vm, node, next_index, 0)
static uword ethernet_address_cast(const u8 *a)
u32 ia_cfg_index
feature [arc] config index
ip_lookup_main_t lookup_main
u32 adj_index_t
An index for adjacencies.
VNET_FEATURE_INIT(lcp_punt_l3_ip4, static)
struct lcp_xc_trace_t_ lcp_xc_trace_t
u32 reply_copies[VLIB_FRAME_SIZE]
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.
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
static u8 * format_lcp_xc_trace(u8 *s, va_list *args)
#define VNET_FEATURES(...)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
vlib_main_t * vm
Pass punted packets from the PHY to the HOST.
static index_t lcp_itf_pair_find_by_phy(u32 phy_sw_if_index)
static ethernet_header_t * ethernet_buffer_get_header(vlib_buffer_t *b)
struct lcp_arp_trace_t_ lcp_arp_trace_t
static_always_inline adj_index_t lcp_adj_lkup(const u8 *rewrite, u8 len, u32 sw_if_index)
vlib_node_registration_t lcp_xc_l3_ip4_node
(constructor) VLIB_REGISTER_NODE (lcp_xc_l3_ip4_node)
#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.
static u8 * format_lcp_arp_trace(u8 *s, va_list *args)
struct lip_punt_trace_t_ lip_punt_trace_t
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
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).
static ip_adjacency_t * adj_get(adj_index_t adj_index)
Get a pointer to an adjacency object from its index.
vlib_node_registration_t lcp_arp_host_node
(constructor) VLIB_REGISTER_NODE (lcp_arp_host_node)
vl_api_fib_path_type_t type
u8 output_feature_arc_index
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
enum ip_address_family_t_ ip_address_family_t
VLIB buffer representation.
#define VLIB_REGISTER_NODE(x,...)