FD.io VPP  v17.01-9-ge7dcee4
Vector Packet Processing
interface.c File Reference

Common utility functions for LISP-GPE interfaces. More...

+ Include dependency graph for interface.c:

Go to the source code of this file.

Data Structures

struct  lisp_gpe_tx_trace_t
 
struct  l2_lisp_gpe_tx_trace_t
 

Macros

#define foreach_lisp_gpe_tx_next
 
#define is_v4_packet(_h)   ((*(u8*) _h) & 0xF0) == 0x40
 

Enumerations

enum  lisp_gpe_tx_next_t { LISP_GPE_TX_N_NEXT }
 

Functions

u8format_lisp_gpe_tx_trace (u8 *s, va_list *args)
 
static uword lisp_gpe_interface_tx (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 LISP-GPE interface TX (encap) function. More...
 
static u8format_lisp_gpe_name (u8 *s, va_list *args)
 
 VNET_DEVICE_CLASS (lisp_gpe_device_class)
 
u8format_lisp_gpe_header_with_length (u8 *s, va_list *args)
 
 VNET_HW_INTERFACE_CLASS (lisp_gpe_hw_class)
 
static u8format_l2_lisp_gpe_tx_trace (u8 *s, va_list *args)
 
static uword l2_lisp_gpe_interface_tx (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 LISP-GPE interface TX (encap) function for L2 overlays. More...
 
static u8format_l2_lisp_gpe_name (u8 *s, va_list *args)
 
 VNET_DEVICE_CLASS (l2_lisp_gpe_device_class, static)
 
static vnet_hw_interface_tlisp_gpe_create_iface (lisp_gpe_main_t *lgm, u32 vni, u32 dp_table, vnet_device_class_t *dev_class, tunnel_lookup_t *tuns)
 
static void lisp_gpe_remove_iface (lisp_gpe_main_t *lgm, u32 hi_index, u32 dp_table, tunnel_lookup_t *tuns)
 
static void lisp_gpe_iface_set_table (u32 sw_if_index, u32 table_id)
 
static void lisp_gpe_tenant_del_default_routes (u32 table_id)
 
static void lisp_gpe_tenant_add_default_routes (u32 table_id)
 
u32 lisp_gpe_add_l3_iface (lisp_gpe_main_t *lgm, u32 vni, u32 table_id)
 Add/del LISP-GPE L3 interface. More...
 
void lisp_gpe_del_l3_iface (lisp_gpe_main_t *lgm, u32 vni, u32 table_id)
 
u32 lisp_gpe_add_l2_iface (lisp_gpe_main_t *lgm, u32 vni, u32 bd_id)
 Add/del LISP-GPE L2 interface. More...
 
void lisp_gpe_del_l2_iface (lisp_gpe_main_t *lgm, u32 vni, u32 bd_id)
 Add/del LISP-GPE L2 interface. More...
 
static clib_error_tlisp_gpe_add_del_iface_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 

Variables

static uword l2_arc_to_lb
 The VLIB node arc/edge from the interface's TX node, to the L2 load-balanceing node. More...
 
static vlib_cli_command_t add_del_lisp_gpe_iface_command
 (constructor) VLIB_CLI_COMMAND (add_del_lisp_gpe_iface_command) More...
 

Detailed Description

Common utility functions for LISP-GPE interfaces.

Definition in file interface.c.

Macro Definition Documentation

#define foreach_lisp_gpe_tx_next
Value:
_(DROP, "error-drop") \
_(IP4_LOOKUP, "ip4-lookup") \
_(IP6_LOOKUP, "ip6-lookup")
DROP
Definition: error.def:41

Definition at line 44 of file interface.c.

#define is_v4_packet (   _h)    ((*(u8*) _h) & 0xF0) == 0x40

Definition at line 73 of file interface.c.

Enumeration Type Documentation

Enumerator
LISP_GPE_TX_N_NEXT 

Definition at line 49 of file interface.c.

Function Documentation

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

Definition at line 294 of file interface.c.

+ Here is the call graph for this function:

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

Definition at line 208 of file interface.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_lisp_gpe_header_with_length ( u8 s,
va_list *  args 
)

Definition at line 171 of file interface.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 155 of file interface.c.

+ Here is the call graph for this function:

u8* format_lisp_gpe_tx_trace ( u8 s,
va_list *  args 
)

Definition at line 63 of file interface.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword l2_lisp_gpe_interface_tx ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame 
)
static

LISP-GPE interface TX (encap) function for L2 overlays.

Node Identifier:
l2_lisp_gpe_interface_tx

The L2 LISP-GPE interface TX (encap) function.

Uses bridge domain index, source and destination ethernet addresses to lookup tunnel. If the tunnel is multihomed a flow has is used to determine the sub-tunnel and therefore the rewrite string to be used to encapsulate the packets.

Parameters
[in]vmvlib_main_t corresponding to the current thread.
[in]nodevlib_node_runtime_t data for this node.
[in]framevlib_frame_t whose contents should be dispatched.
Returns
number of vectors in frame.

Definition at line 236 of file interface.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* lisp_gpe_add_del_iface_command_fn ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 619 of file interface.c.

+ Here is the call graph for this function:

u32 lisp_gpe_add_l2_iface ( lisp_gpe_main_t lgm,
u32  vni,
u32  bd_id 
)

Add/del LISP-GPE L2 interface.

Creates LISP-GPE interface, sets it in L2 mode in the appropriate bridge domain, sets egress arcs and enables it.

Parameters
[in]lgmReference to lisp_gpe_main_t.
[in]aParameters to create interface.
Returns
number of vectors in frame.

Definition at line 543 of file interface.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 lisp_gpe_add_l3_iface ( lisp_gpe_main_t lgm,
u32  vni,
u32  table_id 
)

Add/del LISP-GPE L3 interface.

Creates LISP-GPE interface, sets ingress arcs from lisp_gpeX_lookup, installs default routes that attract all traffic with no more specific routes to lgpe-ipx-lookup, set egress arcs to ipx-lookup, sets the interface in the right vrf and enables it.

Parameters
[in]lgmReference to lisp_gpe_main_t.
[in]aParameters to create interface.
Returns
number of vectors in frame.

Definition at line 466 of file interface.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static vnet_hw_interface_t* lisp_gpe_create_iface ( lisp_gpe_main_t lgm,
u32  vni,
u32  dp_table,
vnet_device_class_t dev_class,
tunnel_lookup_t tuns 
)
static

Definition at line 310 of file interface.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void lisp_gpe_del_l2_iface ( lisp_gpe_main_t lgm,
u32  vni,
u32  bd_id 
)

Add/del LISP-GPE L2 interface.

Add/del LISP-GPE interface.

Creates LISP-GPE interface, sets it in L2 mode in the appropriate bridge domain, sets egress arcs and enables it.

Parameters
[in]lgmReference to lisp_gpe_main_t.
[in]aParameters to create interface.
Returns
number of vectors in frame.

Definition at line 600 of file interface.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void lisp_gpe_del_l3_iface ( lisp_gpe_main_t lgm,
u32  vni,
u32  table_id 
)

Definition at line 506 of file interface.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void lisp_gpe_iface_set_table ( u32  sw_if_index,
u32  table_id 
)
static

Definition at line 395 of file interface.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword lisp_gpe_interface_tx ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame 
)
static

LISP-GPE interface TX (encap) function.

Node Identifier:
lisp_gpe_interface_tx

The LISP-GPE interface TX (encap) function.

Looks up the associated tunnel based on the adjacency hit in the SD FIB and if the tunnel is multihomed it uses the flow hash to determine sub-tunnel, and rewrite string, to be used to encapsulate the packet.

Parameters
[in]vmvlib_main_t corresponding to the current thread.
[in]nodevlib_node_runtime_t data for this node.
[in]framevlib_frame_t whose contents should be dispatched.
Returns
number of vectors in frame.

Definition at line 92 of file interface.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void lisp_gpe_remove_iface ( lisp_gpe_main_t lgm,
u32  hi_index,
u32  dp_table,
tunnel_lookup_t tuns 
)
static

Definition at line 368 of file interface.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void lisp_gpe_tenant_add_default_routes ( u32  table_id)
static

Definition at line 429 of file interface.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void lisp_gpe_tenant_del_default_routes ( u32  table_id)
static

Definition at line 411 of file interface.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

VNET_DEVICE_CLASS ( lisp_gpe_device_class  )
VNET_DEVICE_CLASS ( l2_lisp_gpe_device_class  ,
static   
)
VNET_HW_INTERFACE_CLASS ( lisp_gpe_hw_class  )

Variable Documentation

vlib_cli_command_t add_del_lisp_gpe_iface_command
static
Initial value:
= {
.path = "lisp gpe iface",
.short_help = "lisp gpe iface add/del vni <vni> vrf <vrf>",
}
static clib_error_t * lisp_gpe_add_del_iface_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: interface.c:619

(constructor) VLIB_CLI_COMMAND (add_del_lisp_gpe_iface_command)

Definition at line 696 of file interface.c.

uword l2_arc_to_lb
static

The VLIB node arc/edge from the interface's TX node, to the L2 load-balanceing node.

Which is where all packets go

Definition at line 42 of file interface.c.