FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
lcp_node.c File Reference
+ Include dependency graph for lcp_node.c:

Go to the source code of this file.

Data Structures

struct  lip_punt_trace_t_
 
struct  lcp_punt_l3_trace_t_
 
struct  lcp_xc_trace_t_
 
struct  lcp_arp_trace_t_
 

Macros

#define foreach_lip_punt
 
#define foreach_lcp_punt_l3   _ (DROP, "unknown error")
 
#define foreach_lcp_xc
 
#define foreach_lcp_arp
 

Typedefs

typedef struct lip_punt_trace_t_ lip_punt_trace_t
 
typedef struct lcp_punt_l3_trace_t_ lcp_punt_l3_trace_t
 
typedef struct lcp_xc_trace_t_ lcp_xc_trace_t
 
typedef struct lcp_arp_trace_t_ lcp_arp_trace_t
 

Enumerations

enum  lip_punt_next_t { LIP_PUNT_N_NEXT }
 
enum  lcp_punt_l3_next_t { LCP_LOCAL_N_NEXT }
 
enum  lcp_xc_next_t { LCP_XC_N_NEXT }
 
enum  lcp_xc_l3_next_t { LCP_XC_L3_NEXT_XC, LCP_XC_L3_N_NEXT }
 
enum  lcp_arp_next_t { LCP_ARP_N_NEXT }
 

Functions

static u8format_lip_punt_trace (u8 *s, va_list *args)
 
 while (n_left_from > 0)
 
static u8format_lcp_punt_l3_trace (u8 *s, va_list *args)
 
 VNET_FEATURE_INIT (lcp_punt_l3_ip4, static)
 
 VNET_FEATURE_INIT (lip_punt_l3_ip6, static)
 
static u8format_lcp_xc_trace (u8 *s, va_list *args)
 
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. More...
 
 VNET_FEATURE_INIT (lcp_xc_ip4_ucast_node, static)
 
 VNET_FEATURE_INIT (lcp_xc_ip4_mcast_node, static)
 
 VNET_FEATURE_INIT (lcp_xc_ip6_ucast_node, static)
 
 VNET_FEATURE_INIT (lcp_xc_ip6_mcast_node, static)
 
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. More...
 
 VNET_FEATURE_INIT (lcp_xc_node_l3_ip4_unicast, static)
 
 VNET_FEATURE_INIT (lcp_xc_node_l3_ip4_multicaast, static)
 
 VNET_FEATURE_INIT (lcp_xc_node_l3_ip6_unicast, static)
 
 VNET_FEATURE_INIT (lcp_xc_node_l3_ip6_multicast, static)
 
static u8format_lcp_arp_trace (u8 *s, va_list *args)
 
 if (n_copies)
 (constructor) VLIB_REGISTER_NODE (lcp_arp_phy_node) More...
 
 VNET_FEATURE_INIT (lcp_arp_phy_arp_feat, static)
 
 VNET_FEATURE_INIT (lcp_arp_host_arp_feat, static)
 

Variables

vlib_main_tvm
 Pass punted packets from the PHY to the HOST. More...
 
vlib_main_t vlib_node_runtime_tnode
 
vlib_main_t vlib_node_runtime_t vlib_frame_tframe
 
lip_punt_next_t next_index = node->cached_next_index
 
 n_left_from = frame->n_vectors
 
 from = vlib_frame_vector_args (frame)
 
return frame n_vectors
 
vlib_node_registration_t lip_punt_node
 (constructor) VLIB_REGISTER_NODE (lip_punt_node) More...
 
vlib_node_registration_t lcp_punt_l3_node
 (constructor) VLIB_REGISTER_NODE (lcp_punt_l3_node) More...
 
vlib_node_registration_t lcp_xc_ip4
 (constructor) VLIB_REGISTER_NODE (lcp_xc_ip4) More...
 
vlib_node_registration_t lcp_xc_ip6
 (constructor) VLIB_REGISTER_NODE (lcp_xc_ip6) More...
 
vlib_node_registration_t lcp_xc_l3_ip4_node
 (constructor) VLIB_REGISTER_NODE (lcp_xc_l3_ip4_node) More...
 
vlib_node_registration_t lcp_xc_l3_ip6_node
 (constructor) VLIB_REGISTER_NODE (lcp_xc_l3_ip6_node) More...
 
u32 reply_copies [VLIB_FRAME_SIZE]
 
u32 n_copies = 0
 
vlib_node_registration_t lcp_arp_host_node
 (constructor) VLIB_REGISTER_NODE (lcp_arp_host_node) More...
 

Macro Definition Documentation

◆ foreach_lcp_arp

#define foreach_lcp_arp
Value:
_ (DROP, "error-drop") \
_ (IO, "interface-output")

Definition at line 572 of file lcp_node.c.

◆ foreach_lcp_punt_l3

#define foreach_lcp_punt_l3   _ (DROP, "unknown error")

Definition at line 160 of file lcp_node.c.

◆ foreach_lcp_xc

#define foreach_lcp_xc
Value:
_ (DROP, "drop") \
_ (XC_IP4, "x-connnect-ip4") \
_ (XC_IP6, "x-connnect-ip6")

Definition at line 274 of file lcp_node.c.

◆ foreach_lip_punt

#define foreach_lip_punt
Value:
_ (IO, "punt to host") \
_ (DROP, "unknown input interface")

Definition at line 35 of file lcp_node.c.

Typedef Documentation

◆ lcp_arp_trace_t

◆ lcp_punt_l3_trace_t

◆ lcp_xc_trace_t

◆ lip_punt_trace_t

Enumeration Type Documentation

◆ lcp_arp_next_t

Enumerator
LCP_ARP_N_NEXT 

Definition at line 576 of file lcp_node.c.

◆ lcp_punt_l3_next_t

Enumerator
LCP_LOCAL_N_NEXT 

Definition at line 162 of file lcp_node.c.

◆ lcp_xc_l3_next_t

Enumerator
LCP_XC_L3_NEXT_XC 
LCP_XC_L3_N_NEXT 

Definition at line 439 of file lcp_node.c.

◆ lcp_xc_next_t

Enumerator
LCP_XC_N_NEXT 

Definition at line 279 of file lcp_node.c.

◆ lip_punt_next_t

Enumerator
LIP_PUNT_N_NEXT 

Definition at line 39 of file lcp_node.c.

Function Documentation

◆ format_lcp_arp_trace()

static u8* format_lcp_arp_trace ( u8 s,
va_list *  args 
)
static

Definition at line 592 of file lcp_node.c.

◆ format_lcp_punt_l3_trace()

static u8* format_lcp_punt_l3_trace ( u8 s,
va_list *  args 
)
static

Definition at line 177 of file lcp_node.c.

◆ format_lcp_xc_trace()

static u8* format_lcp_xc_trace ( u8 s,
va_list *  args 
)
static

Definition at line 295 of file lcp_node.c.

◆ format_lip_punt_trace()

static u8* format_lip_punt_trace ( u8 s,
va_list *  args 
)
static

Definition at line 55 of file lcp_node.c.

◆ if()

if ( n_copies  )

(constructor) VLIB_REGISTER_NODE (lcp_arp_phy_node)

Definition at line 807 of file lcp_node.c.

◆ lcp_xc_inline()

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.

This runs in either the IP4 or IP6 path. The MAC rewrite on the received packet from the host is used as a key to find the adjacency used on the phy. This allows this code to start the feature arc on that adjacency. Consequently, all packet sent from the host are also subject to output features, which is symmetric w.r.t. to input features.

Definition at line 316 of file lcp_node.c.

+ Here is the call graph for this function:

◆ lcp_xc_l3_inline()

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.

There's only one adjacency that can be used on thises links.

Definition at line 451 of file lcp_node.c.

+ Here is the call graph for this function:

◆ VNET_FEATURE_INIT() [1/12]

VNET_FEATURE_INIT ( lcp_arp_host_arp_feat  ,
static   
)

◆ VNET_FEATURE_INIT() [2/12]

VNET_FEATURE_INIT ( lcp_arp_phy_arp_feat  ,
static   
)

◆ VNET_FEATURE_INIT() [3/12]

VNET_FEATURE_INIT ( lcp_punt_l3_ip4  ,
static   
)

◆ VNET_FEATURE_INIT() [4/12]

VNET_FEATURE_INIT ( lcp_xc_ip4_mcast_node  ,
static   
)

◆ VNET_FEATURE_INIT() [5/12]

VNET_FEATURE_INIT ( lcp_xc_ip4_ucast_node  ,
static   
)

◆ VNET_FEATURE_INIT() [6/12]

VNET_FEATURE_INIT ( lcp_xc_ip6_mcast_node  ,
static   
)

◆ VNET_FEATURE_INIT() [7/12]

VNET_FEATURE_INIT ( lcp_xc_ip6_ucast_node  ,
static   
)

◆ VNET_FEATURE_INIT() [8/12]

VNET_FEATURE_INIT ( lcp_xc_node_l3_ip4_multicaast  ,
static   
)

◆ VNET_FEATURE_INIT() [9/12]

VNET_FEATURE_INIT ( lcp_xc_node_l3_ip4_unicast  ,
static   
)

◆ VNET_FEATURE_INIT() [10/12]

VNET_FEATURE_INIT ( lcp_xc_node_l3_ip6_multicast  ,
static   
)

◆ VNET_FEATURE_INIT() [11/12]

VNET_FEATURE_INIT ( lcp_xc_node_l3_ip6_unicast  ,
static   
)

◆ VNET_FEATURE_INIT() [12/12]

VNET_FEATURE_INIT ( lip_punt_l3_ip6  ,
static   
)

◆ while()

while ( n_left_from  ,
 
)

Definition at line 80 of file lcp_node.c.

+ Here is the call graph for this function:

Variable Documentation

◆ frame

Initial value:
{
u32 n_left_from, *from, *to_next, n_left_to_next

Definition at line 72 of file lcp_node.c.

◆ from

Definition at line 78 of file lcp_node.c.

◆ lcp_arp_host_node

vlib_node_registration_t lcp_arp_host_node
Initial value:
= {
.name = "linux-cp-arp-host",
.vector_size = sizeof (u32),
.format_trace = format_lcp_arp_trace,
.n_errors = LINUXCP_N_ERROR,
.error_counters = linuxcp_error_counters,
.n_next_nodes = LCP_ARP_N_NEXT,
.next_nodes = {
[LCP_ARP_NEXT_DROP] = "error-drop",
[LCP_ARP_NEXT_IO] = "interface-output",
},
}

(constructor) VLIB_REGISTER_NODE (lcp_arp_host_node)

Definition at line 898 of file lcp_node.c.

◆ lcp_punt_l3_node

vlib_node_registration_t lcp_punt_l3_node
Initial value:
= {
.name = "linux-cp-punt-l3",
.vector_size = sizeof (u32),
.format_trace = format_lcp_punt_l3_trace,
.n_next_nodes = 1,
.next_nodes = {
[LCP_LOCAL_NEXT_DROP] = "error-drop",
},
}

(constructor) VLIB_REGISTER_NODE (lcp_punt_l3_node)

Definition at line 250 of file lcp_node.c.

◆ lcp_xc_ip4

Initial value:
= { .name = "linux-cp-xc-ip4",
.vector_size = sizeof (u32),
.format_trace = format_lcp_xc_trace,
.sibling_of = "ip4-rewrite" }

(constructor) VLIB_REGISTER_NODE (lcp_xc_ip4)

Definition at line 409 of file lcp_node.c.

◆ lcp_xc_ip6

Initial value:
= { .name = "linux-cp-xc-ip6",
.vector_size = sizeof (u32),
.format_trace = format_lcp_xc_trace,
.sibling_of = "ip6-rewrite" }

(constructor) VLIB_REGISTER_NODE (lcp_xc_ip6)

Definition at line 424 of file lcp_node.c.

◆ lcp_xc_l3_ip4_node

vlib_node_registration_t lcp_xc_l3_ip4_node
Initial value:
= {
.name = "linux-cp-xc-l3-ip4",
.vector_size = sizeof (u32),
.format_trace = format_lcp_xc_trace,
.n_next_nodes = LCP_XC_L3_N_NEXT,
.next_nodes = {
[LCP_XC_L3_NEXT_XC] = "ip4-midchain",
},
}

(constructor) VLIB_REGISTER_NODE (lcp_xc_l3_ip4_node)

Definition at line 528 of file lcp_node.c.

◆ lcp_xc_l3_ip6_node

vlib_node_registration_t lcp_xc_l3_ip6_node
Initial value:
= {
.name = "linux-cp-xc-l3-ip6",
.vector_size = sizeof (u32),
.format_trace = format_lcp_xc_trace,
.n_next_nodes = LCP_XC_L3_N_NEXT,
.next_nodes = {
[LCP_XC_L3_NEXT_XC] = "ip6-midchain",
},
}

(constructor) VLIB_REGISTER_NODE (lcp_xc_l3_ip6_node)

Definition at line 550 of file lcp_node.c.

◆ lip_punt_node

vlib_node_registration_t lip_punt_node
Initial value:
= {
.name = "linux-cp-punt",
.vector_size = sizeof (u32),
.format_trace = format_lip_punt_trace,
.n_next_nodes = LIP_PUNT_N_NEXT,
.next_nodes = {
[LIP_PUNT_NEXT_DROP] = "error-drop",
[LIP_PUNT_NEXT_IO] = "interface-output",
},
}

(constructor) VLIB_REGISTER_NODE (lip_punt_node)

Definition at line 147 of file lcp_node.c.

◆ n_copies

u32 n_copies = 0

Definition at line 613 of file lcp_node.c.

◆ n_left_from

n_left_from = frame->n_vectors

Definition at line 77 of file lcp_node.c.

◆ n_vectors

return frame n_vectors

Definition at line 144 of file lcp_node.c.

◆ next_index

next_index = node->cached_next_index

Definition at line 74 of file lcp_node.c.

◆ node

Definition at line 71 of file lcp_node.c.

◆ reply_copies

u32 reply_copies[VLIB_FRAME_SIZE]

Definition at line 612 of file lcp_node.c.

◆ vm

Pass punted packets from the PHY to the HOST.

x-connect ARP packets from the host to the phy

punt ARP replies to the host

X-connect all packets from the HOST to the PHY.

Definition at line 71 of file lcp_node.c.

LIP_PUNT_N_NEXT
@ LIP_PUNT_N_NEXT
Definition: lcp_node.c:44
DROP
DROP
Definition: error.def:41
format_lip_punt_trace
static u8 * format_lip_punt_trace(u8 *s, va_list *args)
Definition: lcp_node.c:55
VLIB_NODE_TYPE_INTERNAL
@ VLIB_NODE_TYPE_INTERNAL
Definition: node.h:72
n_left_from
n_left_from
Definition: lcp_node.c:77
LCP_ARP_N_NEXT
@ LCP_ARP_N_NEXT
Definition: lcp_node.c:581
LCP_XC_L3_NEXT_XC
@ LCP_XC_L3_NEXT_XC
Definition: lcp_node.c:441
format_lcp_punt_l3_trace
static u8 * format_lcp_punt_l3_trace(u8 *s, va_list *args)
Definition: lcp_node.c:177
LCP_XC_L3_N_NEXT
@ LCP_XC_L3_N_NEXT
Definition: lcp_node.c:442
from
from
Definition: lcp_node.c:78
u32
unsigned int u32
Definition: types.h:88
format_lcp_xc_trace
static u8 * format_lcp_xc_trace(u8 *s, va_list *args)
Definition: lcp_node.c:295
format_lcp_arp_trace
static u8 * format_lcp_arp_trace(u8 *s, va_list *args)
Definition: lcp_node.c:592
type
vl_api_fib_path_type_t type
Definition: fib_types.api:123