FD.io VPP  v19.01.3-6-g70449b9b9
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

◆ foreach_pipe_rx_next

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

Definition at line 220 of file pipe.c.

◆ PIPE_MAX_INSTANCE

#define PIPE_MAX_INSTANCE   (16 * 1024)

Definition at line 462 of file pipe.c.

◆ VNET_PIPE_TX_NEXT_ETHERNET_INPUT

#define VNET_PIPE_TX_NEXT_ETHERNET_INPUT   VNET_INTERFACE_TX_N_NEXT

Definition at line 123 of file pipe.c.

Typedef Documentation

◆ pipe_hw_walk_ctx_t

◆ pipe_main_t

typedef struct pipe_main_t_ pipe_main_t

Various 'module' lavel variables.

◆ pipe_rx_next_t

◆ pipe_rx_trace_t

Enumeration Type Documentation

◆ pipe_rx_next_t_

Enumerator
PIPE_RX_N_NEXT 

Definition at line 223 of file pipe.c.

Function Documentation

◆ create_pipe_interfaces()

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

Definition at line 672 of file pipe.c.

+ Here is the call graph for this function:

◆ delete_pipe_interfaces()

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

Definition at line 753 of file pipe.c.

+ Here is the call graph for this function:

◆ format_pipe_name()

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:

◆ format_pipe_rx_trace()

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:

◆ pipe_admin_up_down()

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:

◆ pipe_build_rewrite()

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.

◆ pipe_create_sub_interface()

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

Definition at line 525 of file pipe.c.

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

◆ pipe_determine_next_node()

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_get()

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:

◆ pipe_hw_walk()

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

Definition at line 632 of file pipe.c.

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

◆ pipe_instance_alloc()

static u32 pipe_instance_alloc ( u8  is_specified,
u32  want 
)
static

Definition at line 465 of file pipe.c.

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

◆ pipe_instance_free()

static int pipe_instance_free ( u32  instance)
static

Definition at line 508 of file pipe.c.

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

◆ pipe_rx()

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:

◆ pipe_tx()

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:

◆ pipe_walk()

void pipe_walk ( pipe_cb_fn_t  fn,
void *  ctx 
)

Walk all the of pipe interfaces.

Definition at line 659 of file pipe.c.

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

◆ unformat_pipe_interface()

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:

◆ vnet_create_pipe_interface()

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 541 of file pipe.c.

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

◆ vnet_delete_pipe_interface()

int vnet_delete_pipe_interface ( u32  sw_if_index)

Definition at line 718 of file pipe.c.

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

◆ VNET_DEVICE_CLASS()

VNET_DEVICE_CLASS ( pipe_device_class  )
+ Here is the caller graph for this function:

◆ VNET_HW_INTERFACE_CLASS()

VNET_HW_INTERFACE_CLASS ( pipe_hw_interface_class  )

Variable Documentation

◆ pipe_create_interface_command

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:672

(constructor) VLIB_CLI_COMMAND (pipe_create_interface_command)

Definition at line 710 of file pipe.c.

◆ pipe_delete_interface_command

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:753

(constructor) VLIB_CLI_COMMAND (pipe_delete_interface_command)

Definition at line 790 of file pipe.c.

◆ PIPE_INVALID

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

Definition at line 27 of file pipe.c.

◆ pipe_main

pipe_main_t pipe_main
static

Definition at line 49 of file pipe.c.

◆ pipe_rx_node

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 448 of file pipe.c.