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

Go to the source code of this file.

Data Structures

struct  pg_input_trace_t
 

Functions

static int validate_buffer_data2 (vlib_buffer_t *b, pg_stream_t *s, u32 data_offset, u32 n_bytes)
 
static int validate_buffer_data (vlib_buffer_t *b, pg_stream_t *s)
 
static void set_1 (void *a0, u64 v0, u64 v_min, u64 v_max, u32 n_bits, u32 is_net_byte_order)
 
static void set_2 (void *a0, void *a1, u64 v0, u64 v1, u64 v_min, u64 v_max, u32 n_bits, u32 is_net_byte_order, u32 is_increment)
 
static_always_inline void do_set_fixed (pg_main_t *pg, pg_stream_t *s, u32 *buffers, u32 n_buffers, u32 n_bits, u32 byte_offset, u32 is_net_byte_order, u64 v_min, u64 v_max)
 
static_always_inline u64 do_set_increment (pg_main_t *pg, pg_stream_t *s, u32 *buffers, u32 n_buffers, u32 n_bits, u32 byte_offset, u32 is_net_byte_order, u32 want_sum, u64 *sum_result, u64 v_min, u64 v_max, u64 v)
 
static_always_inline void do_set_random (pg_main_t *pg, pg_stream_t *s, u32 *buffers, u32 n_buffers, u32 n_bits, u32 byte_offset, u32 is_net_byte_order, u32 want_sum, u64 *sum_result, u64 v_min, u64 v_max)
 
static void setbits_1 (void *a0, u64 v0, u64 v_min, u64 v_max, u32 max_bits, u32 n_bits, u64 mask, u32 shift)
 
static void setbits_2 (void *a0, void *a1, u64 v0, u64 v1, u64 v_min, u64 v_max, u32 max_bits, u32 n_bits, u64 mask, u32 shift, u32 is_increment)
 
static_always_inline void do_setbits_fixed (pg_main_t *pg, pg_stream_t *s, u32 *buffers, u32 n_buffers, u32 max_bits, u32 n_bits, u32 byte_offset, u64 v_min, u64 v_max, u64 mask, u32 shift)
 
static_always_inline u64 do_setbits_increment (pg_main_t *pg, pg_stream_t *s, u32 *buffers, u32 n_buffers, u32 max_bits, u32 n_bits, u32 byte_offset, u64 v_min, u64 v_max, u64 v, u64 mask, u32 shift)
 
static_always_inline void do_setbits_random (pg_main_t *pg, pg_stream_t *s, u32 *buffers, u32 n_buffers, u32 max_bits, u32 n_bits, u32 byte_offset, u64 v_min, u64 v_max, u64 mask, u32 shift)
 
static u64 do_it (pg_main_t *pg, pg_stream_t *s, u32 *buffers, u32 n_buffers, u32 lo_bit, u32 hi_bit, u64 v_min, u64 v_max, u64 v, pg_edit_type_t edit_type)
 
static void pg_generate_set_lengths (pg_main_t *pg, pg_stream_t *s, u32 *buffers, u32 n_buffers)
 
static void pg_generate_fix_multi_buffer_lengths (pg_main_t *pg, pg_stream_t *s, u32 *buffers, u32 n_buffers)
 
static void pg_generate_edit (pg_main_t *pg, pg_stream_t *s, u32 *buffers, u32 n_buffers)
 
static void pg_set_next_buffer_pointers (pg_main_t *pg, pg_stream_t *s, u32 *buffers, u32 *next_buffers, u32 n_buffers)
 
static_always_inline void init_buffers_inline (vlib_main_t *vm, pg_stream_t *s, u32 *buffers, u32 n_buffers, u32 data_offset, u32 n_data, u32 set_data)
 
static u32 pg_stream_fill_helper (pg_main_t *pg, pg_stream_t *s, pg_buffer_index_t *bi, u32 *buffers, u32 *next_buffers, u32 n_alloc)
 
static u32 pg_stream_fill_replay (pg_main_t *pg, pg_stream_t *s, u32 n_alloc)
 
static u32 pg_stream_fill (pg_main_t *pg, pg_stream_t *s, u32 n_buffers)
 
static u8format_pg_input_trace (u8 *s, va_list *va)
 
static int pg_input_trace (pg_main_t *pg, vlib_node_runtime_t *node, u32 stream_index, u32 next_index, u32 *buffers, const u32 n_buffers, const u32 n_trace)
 
static_always_inline void fill_buffer_offload_flags (vlib_main_t *vm, u32 *buffers, u32 n_buffers, u32 buffer_oflags, int gso_enabled, u32 gso_size)
 
static uword pg_generate_packets (vlib_node_runtime_t *node, pg_main_t *pg, pg_stream_t *s, uword n_packets_to_generate)
 
static uword pg_input_stream (vlib_node_runtime_t *node, pg_main_t *pg, pg_stream_t *s)
 
uword pg_input (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
VLIB_NODE_FN() pg_input_mac_filter (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
 VNET_FEATURE_INIT (pg_input_mac_filter_feat, static)
 
static clib_error_tpg_input_mac_filter_cfg (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 

Variables

vlib_node_registration_t pg_input_node
 (constructor) VLIB_REGISTER_NODE (pg_input_node) More...
 
vlib_node_registration_t pg_input_mac_filter
 (constructor) VLIB_REGISTER_NODE (pg_input_mac_filter) More...
 
static vlib_cli_command_t enable_streams_cli
 (constructor) VLIB_CLI_COMMAND (enable_streams_cli) More...
 

Function Documentation

◆ do_it()

static u64 do_it ( pg_main_t pg,
pg_stream_t s,
u32 buffers,
u32  n_buffers,
u32  lo_bit,
u32  hi_bit,
u64  v_min,
u64  v_max,
u64  v,
pg_edit_type_t  edit_type 
)
static

Definition at line 757 of file input.c.

+ Here is the caller graph for this function:

◆ do_set_fixed()

static_always_inline void do_set_fixed ( pg_main_t pg,
pg_stream_t s,
u32 buffers,
u32  n_buffers,
u32  n_bits,
u32  byte_offset,
u32  is_net_byte_order,
u64  v_min,
u64  v_max 
)

Definition at line 170 of file input.c.

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

◆ do_set_increment()

static_always_inline u64 do_set_increment ( pg_main_t pg,
pg_stream_t s,
u32 buffers,
u32  n_buffers,
u32  n_bits,
u32  byte_offset,
u32  is_net_byte_order,
u32  want_sum,
u64 sum_result,
u64  v_min,
u64  v_max,
u64  v 
)

Definition at line 221 of file input.c.

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

◆ do_set_random()

static_always_inline void do_set_random ( pg_main_t pg,
pg_stream_t s,
u32 buffers,
u32  n_buffers,
u32  n_bits,
u32  byte_offset,
u32  is_net_byte_order,
u32  want_sum,
u64 sum_result,
u64  v_min,
u64  v_max 
)

Definition at line 316 of file input.c.

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

◆ do_setbits_fixed()

static_always_inline void do_setbits_fixed ( pg_main_t pg,
pg_stream_t s,
u32 buffers,
u32  n_buffers,
u32  max_bits,
u32  n_bits,
u32  byte_offset,
u64  v_min,
u64  v_max,
u64  mask,
u32  shift 
)

Definition at line 508 of file input.c.

+ Here is the call graph for this function:

◆ do_setbits_increment()

static_always_inline u64 do_setbits_increment ( pg_main_t pg,
pg_stream_t s,
u32 buffers,
u32  n_buffers,
u32  max_bits,
u32  n_bits,
u32  byte_offset,
u64  v_min,
u64  v_max,
u64  v,
u64  mask,
u32  shift 
)

Definition at line 560 of file input.c.

+ Here is the call graph for this function:

◆ do_setbits_random()

static_always_inline void do_setbits_random ( pg_main_t pg,
pg_stream_t s,
u32 buffers,
u32  n_buffers,
u32  max_bits,
u32  n_bits,
u32  byte_offset,
u64  v_min,
u64  v_max,
u64  mask,
u32  shift 
)

Definition at line 639 of file input.c.

+ Here is the call graph for this function:

◆ fill_buffer_offload_flags()

static_always_inline void fill_buffer_offload_flags ( vlib_main_t vm,
u32 buffers,
u32  n_buffers,
u32  buffer_oflags,
int  gso_enabled,
u32  gso_size 
)

Definition at line 1540 of file input.c.

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

◆ format_pg_input_trace()

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

Definition at line 1416 of file input.c.

+ Here is the call graph for this function:

◆ init_buffers_inline()

static_always_inline void init_buffers_inline ( vlib_main_t vm,
pg_stream_t s,
u32 buffers,
u32  n_buffers,
u32  data_offset,
u32  n_data,
u32  set_data 
)

Definition at line 1070 of file input.c.

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

◆ pg_generate_edit()

static void pg_generate_edit ( pg_main_t pg,
pg_stream_t s,
u32 buffers,
u32  n_buffers 
)
static

Definition at line 973 of file input.c.

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

◆ pg_generate_fix_multi_buffer_lengths()

static void pg_generate_fix_multi_buffer_lengths ( pg_main_t pg,
pg_stream_t s,
u32 buffers,
u32  n_buffers 
)
static

Definition at line 916 of file input.c.

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

◆ pg_generate_packets()

static uword pg_generate_packets ( vlib_node_runtime_t node,
pg_main_t pg,
pg_stream_t s,
uword  n_packets_to_generate 
)
static

Definition at line 1625 of file input.c.

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

◆ pg_generate_set_lengths()

static void pg_generate_set_lengths ( pg_main_t pg,
pg_stream_t s,
u32 buffers,
u32  n_buffers 
)
static

Definition at line 864 of file input.c.

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

◆ pg_input()

uword pg_input ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)

Definition at line 1805 of file input.c.

+ Here is the call graph for this function:

◆ pg_input_mac_filter()

VLIB_NODE_FN() pg_input_mac_filter ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)

Definition at line 1840 of file input.c.

+ Here is the call graph for this function:

◆ pg_input_mac_filter_cfg()

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

Definition at line 1914 of file input.c.

+ Here is the call graph for this function:

◆ pg_input_stream()

static uword pg_input_stream ( vlib_node_runtime_t node,
pg_main_t pg,
pg_stream_t s 
)
static

Definition at line 1757 of file input.c.

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

◆ pg_input_trace()

static int pg_input_trace ( pg_main_t pg,
vlib_node_runtime_t node,
u32  stream_index,
u32  next_index,
u32 buffers,
const u32  n_buffers,
const u32  n_trace 
)
static

Definition at line 1458 of file input.c.

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

◆ pg_set_next_buffer_pointers()

static void pg_set_next_buffer_pointers ( pg_main_t pg,
pg_stream_t s,
u32 buffers,
u32 next_buffers,
u32  n_buffers 
)
static

Definition at line 1024 of file input.c.

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

◆ pg_stream_fill()

static u32 pg_stream_fill ( pg_main_t pg,
pg_stream_t s,
u32  n_buffers 
)
static

Definition at line 1316 of file input.c.

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

◆ pg_stream_fill_helper()

static u32 pg_stream_fill_helper ( pg_main_t pg,
pg_stream_t s,
pg_buffer_index_t bi,
u32 buffers,
u32 next_buffers,
u32  n_alloc 
)
static

Definition at line 1153 of file input.c.

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

◆ pg_stream_fill_replay()

static u32 pg_stream_fill_replay ( pg_main_t pg,
pg_stream_t s,
u32  n_alloc 
)
static

Definition at line 1198 of file input.c.

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

◆ set_1()

static void set_1 ( void *  a0,
u64  v0,
u64  v_min,
u64  v_max,
u32  n_bits,
u32  is_net_byte_order 
)
inlinestatic

Definition at line 96 of file input.c.

+ Here is the caller graph for this function:

◆ set_2()

static void set_2 ( void *  a0,
void *  a1,
u64  v0,
u64  v1,
u64  v_min,
u64  v_max,
u32  n_bits,
u32  is_net_byte_order,
u32  is_increment 
)
inlinestatic

Definition at line 125 of file input.c.

+ Here is the caller graph for this function:

◆ setbits_1()

static void setbits_1 ( void *  a0,
u64  v0,
u64  v_min,
u64  v_max,
u32  max_bits,
u32  n_bits,
u64  mask,
u32  shift 
)
inlinestatic

Definition at line 451 of file input.c.

+ Here is the caller graph for this function:

◆ setbits_2()

static void setbits_2 ( void *  a0,
void *  a1,
u64  v0,
u64  v1,
u64  v_min,
u64  v_max,
u32  max_bits,
u32  n_bits,
u64  mask,
u32  shift,
u32  is_increment 
)
inlinestatic

Definition at line 475 of file input.c.

+ Here is the caller graph for this function:

◆ validate_buffer_data()

static int validate_buffer_data ( vlib_buffer_t b,
pg_stream_t s 
)
static

Definition at line 90 of file input.c.

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

◆ validate_buffer_data2()

static int validate_buffer_data2 ( vlib_buffer_t b,
pg_stream_t s,
u32  data_offset,
u32  n_bytes 
)
static

Definition at line 60 of file input.c.

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

◆ VNET_FEATURE_INIT()

VNET_FEATURE_INIT ( pg_input_mac_filter_feat  ,
static   
)

Variable Documentation

◆ enable_streams_cli

vlib_cli_command_t enable_streams_cli
static
Initial value:
= {
.path = "packet-generator mac-filter",
.short_help = "packet-generator mac-filter <INTERFACE> <on|off>",
}

(constructor) VLIB_CLI_COMMAND (enable_streams_cli)

Definition at line 1950 of file input.c.

◆ pg_input_mac_filter

vlib_node_registration_t pg_input_mac_filter
Initial value:
= {
.name = "pg-input-mac-filter",
.vector_size = sizeof (u32),
.format_trace = format_pg_input_trace,
.n_next_nodes = 1,
.next_nodes = {
[0] = "error-drop",
},
}

(constructor) VLIB_REGISTER_NODE (pg_input_mac_filter)

Definition at line 1898 of file input.c.

◆ pg_input_node

vlib_node_registration_t pg_input_node
Initial value:
= {
.function = pg_input,
.name = "pg-input",
.sibling_of = "device-input",
.format_trace = format_pg_input_trace,
.state = VLIB_NODE_STATE_DISABLED,
}

(constructor) VLIB_REGISTER_NODE (pg_input_node)

Definition at line 1826 of file input.c.

VLIB_NODE_TYPE_INPUT
@ VLIB_NODE_TYPE_INPUT
Definition: node.h:76
VLIB_NODE_FLAG_TRACE_SUPPORTED
#define VLIB_NODE_FLAG_TRACE_SUPPORTED
Definition: node.h:295
format_pg_input_trace
static u8 * format_pg_input_trace(u8 *s, va_list *va)
Definition: input.c:1416
u32
unsigned int u32
Definition: types.h:88
pg_input
uword pg_input(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: input.c:1805
pg_input_mac_filter_cfg
static clib_error_t * pg_input_mac_filter_cfg(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: input.c:1914