FD.io VPP  v21.01.1
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
 
struct  nsh_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)
 
u8format_nsh_lisp_gpe_tx_trace (u8 *s, va_list *args)
 
static uword nsh_lisp_gpe_interface_tx (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 LISP-GPE interface TX for NSH overlays. More...
 
static u8format_nsh_lisp_gpe_name (u8 *s, va_list *args)
 
 VNET_DEVICE_CLASS (nsh_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, u8 with_default_routes)
 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...
 
u32 vnet_lisp_gpe_add_nsh_iface (lisp_gpe_main_t *lgm)
 Add LISP-GPE NSH interface. More...
 
void vnet_lisp_gpe_del_nsh_iface (lisp_gpe_main_t *lgm)
 Del LISP-GPE NSH 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

◆ foreach_lisp_gpe_tx_next

#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.

◆ is_v4_packet

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

Definition at line 73 of file interface.c.

Enumeration Type Documentation

◆ lisp_gpe_tx_next_t

Enumerator
LISP_GPE_TX_N_NEXT 

Definition at line 49 of file interface.c.

Function Documentation

◆ format_l2_lisp_gpe_name()

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

Definition at line 299 of file interface.c.

+ Here is the call graph for this function:

◆ format_l2_lisp_gpe_tx_trace()

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

Definition at line 209 of file interface.c.

+ Here is the caller graph for this function:

◆ format_lisp_gpe_header_with_length()

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:

◆ format_lisp_gpe_name()

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:

◆ format_lisp_gpe_tx_trace()

u8* format_lisp_gpe_tx_trace ( u8 s,
va_list *  args 
)

Definition at line 63 of file interface.c.

+ Here is the caller graph for this function:

◆ format_nsh_lisp_gpe_name()

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

Definition at line 403 of file interface.c.

+ Here is the call graph for this function:

◆ format_nsh_lisp_gpe_tx_trace()

u8* format_nsh_lisp_gpe_tx_trace ( u8 s,
va_list *  args 
)

Definition at line 320 of file interface.c.

+ Here is the caller graph for this function:

◆ l2_lisp_gpe_interface_tx()

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 237 of file interface.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lisp_gpe_add_del_iface_command_fn()

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 810 of file interface.c.

+ Here is the call graph for this function:

◆ lisp_gpe_add_l2_iface()

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 657 of file interface.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lisp_gpe_add_l3_iface()

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

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 578 of file interface.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lisp_gpe_create_iface()

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 419 of file interface.c.

+ Here is the caller graph for this function:

◆ lisp_gpe_del_l2_iface()

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 720 of file interface.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lisp_gpe_del_l3_iface()

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

Definition at line 620 of file interface.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lisp_gpe_iface_set_table()

static void lisp_gpe_iface_set_table ( u32  sw_if_index,
u32  table_id 
)
static

Definition at line 504 of file interface.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lisp_gpe_interface_tx()

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:

◆ lisp_gpe_remove_iface()

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 477 of file interface.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lisp_gpe_tenant_add_default_routes()

static void lisp_gpe_tenant_add_default_routes ( u32  table_id)
static

Definition at line 540 of file interface.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lisp_gpe_tenant_del_default_routes()

static void lisp_gpe_tenant_del_default_routes ( u32  table_id)
static

Definition at line 522 of file interface.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nsh_lisp_gpe_interface_tx()

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

LISP-GPE interface TX for NSH overlays.

Node Identifier:
nsh_lisp_gpe_interface_tx

The NSH LISP-GPE interface TX function.

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 343 of file interface.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ VNET_DEVICE_CLASS() [1/3]

VNET_DEVICE_CLASS ( lisp_gpe_device_class  )

◆ VNET_DEVICE_CLASS() [2/3]

VNET_DEVICE_CLASS ( l2_lisp_gpe_device_class  ,
static   
)

◆ VNET_DEVICE_CLASS() [3/3]

VNET_DEVICE_CLASS ( nsh_lisp_gpe_device_class  ,
static   
)

◆ VNET_HW_INTERFACE_CLASS()

VNET_HW_INTERFACE_CLASS ( lisp_gpe_hw_class  )

◆ vnet_lisp_gpe_add_nsh_iface()

u32 vnet_lisp_gpe_add_nsh_iface ( lisp_gpe_main_t lgm)

Add LISP-GPE NSH interface.

Creates LISP-GPE interface, sets it in L3 mode.

Parameters
[in]lgmReference to lisp_gpe_main_t.
[in]aParameters to create interface.
Returns
sw_if_index.

Definition at line 754 of file interface.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vnet_lisp_gpe_del_nsh_iface()

void vnet_lisp_gpe_del_nsh_iface ( lisp_gpe_main_t lgm)

Del LISP-GPE NSH interface.

Definition at line 794 of file interface.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ add_del_lisp_gpe_iface_command

vlib_cli_command_t add_del_lisp_gpe_iface_command
static
Initial value:
= {
.path = "gpe iface",
.short_help = "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:810

(constructor) VLIB_CLI_COMMAND (add_del_lisp_gpe_iface_command)

Definition at line 932 of file interface.c.

◆ l2_arc_to_lb

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.