|
FD.io VPP
v21.10.1-2-g0a485f517
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;
344 bi0 = to_next[0] =
from[0];
370 next0 = adj->rewrite_header.next_index;
388 n_left_to_next, bi0, next0);
394 return frame->n_vectors;
410 .vector_size =
sizeof (
u32),
413 .sibling_of =
"ip4-rewrite" };
416 .arc_name =
"ip4-unicast",
417 .node_name =
"linux-cp-xc-ip4",
420 .arc_name =
"ip4-multicast",
421 .node_name =
"linux-cp-xc-ip4",
425 .vector_size =
sizeof (
u32),
428 .sibling_of =
"ip6-rewrite" };
431 .arc_name =
"ip6-unicast",
432 .node_name =
"linux-cp-xc-ip6",
435 .arc_name =
"ip6-multicast",
436 .node_name =
"linux-cp-xc-ip6",
472 bi0 = to_next[0] =
from[0];
485 b0->
flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
504 n_left_to_next, bi0, next0);
510 return frame->n_vectors;
529 .name =
"linux-cp-xc-l3-ip4",
530 .vector_size =
sizeof (
u32),
541 .arc_name =
"ip4-unicast",
542 .node_name =
"linux-cp-xc-l3-ip4",
546 .arc_name =
"ip4-multicast",
547 .node_name =
"linux-cp-xc-l3-ip4",
551 .name =
"linux-cp-xc-l3-ip6",
552 .vector_size =
sizeof (
u32),
563 .arc_name =
"ip6-unicast",
564 .node_name =
"linux-cp-xc-l3-ip6",
568 .arc_name =
"ip6-multicast",
569 .node_name =
"linux-cp-xc-l3-ip6",
572 #define foreach_lcp_arp \
573 _ (DROP, "error-drop") \
574 _ (IO, "interface-output")
578 #define _(sym, str) LCP_ARP_NEXT_##sym,
625 u32 next0, next1, bi0, bi1;
629 bi0 = to_next[0] =
from[0];
630 bi1 = to_next[1] =
from[1];
637 next0 = next1 = LCP_ARP_NEXT_DROP;
652 if (arp0->
opcode == clib_host_to_net_u16 (ETHERNET_ARP_OPCODE_reply))
684 if (arp1->
opcode == clib_host_to_net_u16 (ETHERNET_ARP_OPCODE_reply))
729 n_left_to_next, bi0, bi1, next0,
740 bi0 = to_next[0] =
from[0];
746 next0 = LCP_ARP_NEXT_DROP;
757 arp_opcode = clib_host_to_net_u16 (arp0->
opcode);
759 if (arp_opcode == ETHERNET_ARP_OPCODE_reply)
801 n_left_to_next, bi0, next0);
811 return frame->n_vectors;
815 .name =
"linux-cp-arp-phy",
816 .vector_size =
sizeof (
u32),
820 .n_errors = LINUXCP_N_ERROR,
821 .error_counters = linuxcp_error_counters,
825 [LCP_ARP_NEXT_DROP] =
"error-drop",
826 [LCP_ARP_NEXT_IO] =
"interface-output",
832 .node_name =
"linux-cp-arp-phy",
861 bi0 = to_next[0] =
from[0];
867 next0 = LCP_ARP_NEXT_IO;
889 n_left_to_next, bi0, next0);
895 return frame->n_vectors;
899 .name =
"linux-cp-arp-host",
900 .vector_size =
sizeof (
u32),
904 .n_errors = LINUXCP_N_ERROR,
905 .error_counters = linuxcp_error_counters,
909 [LCP_ARP_NEXT_DROP] =
"error-drop",
910 [LCP_ARP_NEXT_IO] =
"interface-output",
916 .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)
vl_api_address_family_t af
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,...)