FD.io VPP  v18.07-34-g55fbdb9
Vector Packet Processing
pipe.c File Reference

Pipe Interfaces. More...

+ Include dependency graph for pipe.c:

Go to the source code of this file.

Data Structures

struct  pipe_main_t_
 Various 'module' lavel variables. More...
 
struct  pipe_rx_trace_t_
 
struct  pipe_hw_walk_ctx_t_
 

Macros

#define VNET_PIPE_TX_NEXT_ETHERNET_INPUT   VNET_INTERFACE_TX_N_NEXT
 
#define foreach_pipe_rx_next   _ (DROP, "error-drop")
 
#define PIPE_MAX_INSTANCE   (16 * 1024)
 

Typedefs

typedef struct pipe_main_t_ pipe_main_t
 Various 'module' lavel variables. More...
 
typedef enum pipe_rx_next_t_ pipe_rx_next_t
 
typedef struct pipe_rx_trace_t_ pipe_rx_trace_t
 
typedef struct pipe_hw_walk_ctx_t_ pipe_hw_walk_ctx_t
 

Enumerations

enum  pipe_rx_next_t_ { PIPE_RX_N_NEXT }
 

Functions

static u8pipe_build_rewrite (vnet_main_t *vnm, u32 sw_if_index, vnet_link_t link_type, const void *dst_address)
 
 VNET_HW_INTERFACE_CLASS (pipe_hw_interface_class)
 
pipe_tpipe_get (u32 sw_if_index)
 Get the pipe instnace based on one end. More...
 
uword unformat_pipe_interface (unformat_input_t *input, va_list *args)
 
static uword pipe_tx (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static u8format_pipe_name (u8 *s, va_list *args)
 
static clib_error_tpipe_admin_up_down (vnet_main_t *vnm, u32 hw_if_index, u32 flags)
 
 VNET_DEVICE_CLASS (pipe_device_class)
 
static u8format_pipe_rx_trace (u8 *s, va_list *va)
 
static_always_inline void pipe_determine_next_node (ethernet_main_t *em, u32 is_l20, u32 type0, vlib_buffer_t *b0, pipe_rx_next_t *next0)
 
static_always_inline uword pipe_rx (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
static u32 pipe_instance_alloc (u8 is_specified, u32 want)
 
static int pipe_instance_free (u32 instance)
 
static clib_error_tpipe_create_sub_interface (vnet_hw_interface_t *hi, u32 sub_id, u32 *sw_if_index)
 
int vnet_create_pipe_interface (u8 is_specified, u32 user_instance, u32 *parent_sw_if_index, u32 pipe_sw_if_index[2])
 Create a new pipe interface. More...
 
static walk_rc_t pipe_hw_walk (vnet_main_t *vnm, u32 hw_if_index, void *args)
 
void pipe_walk (pipe_cb_fn_t fn, void *ctx)
 Walk all the of pipe interfaces. More...
 
static clib_error_tcreate_pipe_interfaces (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
int vnet_delete_pipe_interface (u32 sw_if_index)
 
static clib_error_tdelete_pipe_interfaces (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 

Variables

static const pipe_t PIPE_INVALID
 
static pipe_main_t pipe_main
 
vlib_node_registration_t pipe_rx_node
 (constructor) VLIB_REGISTER_NODE (pipe_rx_node) More...
 
static vlib_cli_command_t pipe_create_interface_command
 (constructor) VLIB_CLI_COMMAND (pipe_create_interface_command) More...
 
static vlib_cli_command_t pipe_delete_interface_command
 (constructor) VLIB_CLI_COMMAND (pipe_delete_interface_command) More...
 

Detailed Description

Pipe Interfaces.

A pipe interface, like the UNIX pipe, is a pair of interfaces that are joined.

Definition in file pipe.c.

Macro Definition Documentation

#define foreach_pipe_rx_next   _ (DROP, "error-drop")

Definition at line 220 of file pipe.c.

#define PIPE_MAX_INSTANCE   (16 * 1024)

Definition at line 461 of file pipe.c.

#define VNET_PIPE_TX_NEXT_ETHERNET_INPUT   VNET_INTERFACE_TX_N_NEXT

Definition at line 123 of file pipe.c.

Typedef Documentation

typedef struct pipe_main_t_ pipe_main_t

Various 'module' lavel variables.

Enumeration Type Documentation

Enumerator
PIPE_RX_N_NEXT 

Definition at line 223 of file pipe.c.

Function Documentation

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

Definition at line 671 of file pipe.c.

+ Here is the call graph for this function:

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

Definition at line 752 of file pipe.c.

+ Here is the call graph for this function:

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

Definition at line 184 of file pipe.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8* format_pipe_rx_trace ( u8 s,
va_list *  va 
)
static

Definition at line 237 of file pipe.c.

+ Here is the call graph for this function:

static clib_error_t* pipe_admin_up_down ( vnet_main_t vnm,
u32  hw_if_index,
u32  flags 
)
static

Definition at line 191 of file pipe.c.

+ Here is the call graph for this function:

static u8* pipe_build_rewrite ( vnet_main_t vnm,
u32  sw_if_index,
vnet_link_t  link_type,
const void *  dst_address 
)
static

Definition at line 58 of file pipe.c.

+ Here is the call graph for this function:

static clib_error_t* pipe_create_sub_interface ( vnet_hw_interface_t hi,
u32  sub_id,
u32 sw_if_index 
)
static

Definition at line 524 of file pipe.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static_always_inline void pipe_determine_next_node ( ethernet_main_t em,
u32  is_l20,
u32  type0,
vlib_buffer_t b0,
pipe_rx_next_t next0 
)

Definition at line 253 of file pipe.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

pipe_t* pipe_get ( u32  sw_if_index)

Get the pipe instnace based on one end.

Definition at line 95 of file pipe.c.

+ Here is the caller graph for this function:

static walk_rc_t pipe_hw_walk ( vnet_main_t vnm,
u32  hw_if_index,
void *  args 
)
static

Definition at line 631 of file pipe.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u32 pipe_instance_alloc ( u8  is_specified,
u32  want 
)
static

Definition at line 464 of file pipe.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int pipe_instance_free ( u32  instance)
static

Definition at line 507 of file pipe.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static_always_inline uword pipe_rx ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame 
)

Definition at line 297 of file pipe.c.

+ Here is the call graph for this function:

static uword pipe_tx ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
static

Definition at line 130 of file pipe.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void pipe_walk ( pipe_cb_fn_t  fn,
void *  ctx 
)

Walk all the of pipe interfaces.

Definition at line 658 of file pipe.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uword unformat_pipe_interface ( unformat_input_t input,
va_list *  args 
)

Definition at line 103 of file pipe.c.

+ Here is the call graph for this function:

int vnet_create_pipe_interface ( u8  is_specified,
u32  user_instance,
u32 parent_sw_if_index,
u32  pipe_sw_if_index[2] 
)

Create a new pipe interface.

Parameters
is_specifiedHas the user speficied a desired instance number
user_instanceThe user's desired instnace
parent_sw_indexOUT the created parent interface
pipe_sw_if_indexOUT the ends of the pipe

Definition at line 540 of file pipe.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int vnet_delete_pipe_interface ( u32  sw_if_index)

Definition at line 717 of file pipe.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

VNET_DEVICE_CLASS ( pipe_device_class  )

+ Here is the caller graph for this function:

VNET_HW_INTERFACE_CLASS ( pipe_hw_interface_class  )

+ Here is the caller graph for this function:

Variable Documentation

vlib_cli_command_t pipe_create_interface_command
static
Initial value:
= {
.path = "pipe create",
.short_help = "pipe create [instance <instance>]",
}
static clib_error_t * create_pipe_interfaces(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: pipe.c:671

(constructor) VLIB_CLI_COMMAND (pipe_create_interface_command)

Definition at line 709 of file pipe.c.

vlib_cli_command_t pipe_delete_interface_command
static
Initial value:
= {
.path = "pipe delete",
.short_help = "pipe delete <interface>",
}
static clib_error_t * delete_pipe_interfaces(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: pipe.c:752

(constructor) VLIB_CLI_COMMAND (pipe_delete_interface_command)

Definition at line 789 of file pipe.c.

const pipe_t PIPE_INVALID
static
Initial value:
= {
.sw_if_index = ~0,
.subint = {0},
}

Definition at line 27 of file pipe.c.

pipe_main_t pipe_main
static

Definition at line 49 of file pipe.c.

Initial value:
= {
.function = pipe_rx,
.name = "pipe-rx",
.vector_size = sizeof (u32),
.format_trace = format_pipe_rx_trace,
.sibling_of = "ethernet-input",
}
unsigned int u32
Definition: types.h:88
static u8 * format_pipe_rx_trace(u8 *s, va_list *va)
Definition: pipe.c:237
static_always_inline uword pipe_rx(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Definition: pipe.c:297

(constructor) VLIB_REGISTER_NODE (pipe_rx_node)

Definition at line 447 of file pipe.c.