FD.io VPP  v19.01.3-6-g70449b9b9
Vector Packet Processing
node_funcs.c File Reference
+ Include dependency graph for node_funcs.c:

Go to the source code of this file.

Data Structures

struct  vnet_policer_trace_t
 
struct  policer_classify_trace_t
 

Macros

#define foreach_vnet_policer_error
 
#define TEST_CODE   1
 
#define foreach_policer_classify_error
 

Enumerations

enum  vnet_policer_error_t { VNET_POLICER_N_ERROR }
 
enum  policer_classify_error_t { POLICER_CLASSIFY_N_ERROR }
 

Functions

static u8format_policer_trace (u8 *s, va_list *args)
 
static uword vnet_policer_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, vnet_policer_index_t which)
 
uword vnet_policer_by_sw_if_index (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
uword vnet_policer_by_opaque (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
uword vnet_policer_by_either (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
void vnet_policer_node_funcs_reference (void)
 
 VLIB_NODE_FUNCTION_MULTIARCH (policer_by_sw_if_index_node, vnet_policer_by_sw_if_index)
 
int test_policer_add_del (u32 rx_sw_if_index, u8 *config_name, int is_add)
 
static clib_error_ttest_policer_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static u8format_policer_classify_trace (u8 *s, va_list *args)
 
static uword policer_classify_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, policer_classify_table_id_t tid)
 
static uword ip4_policer_classify (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
 VLIB_NODE_FUNCTION_MULTIARCH (ip4_policer_classify_node, ip4_policer_classify)
 
static uword ip6_policer_classify (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
 VLIB_NODE_FUNCTION_MULTIARCH (ip6_policer_classify_node, ip6_policer_classify)
 
static uword l2_policer_classify (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
 VLIB_NODE_FUNCTION_MULTIARCH (l2_policer_classify_node, l2_policer_classify)
 
static clib_error_tpolicer_classify_init (vlib_main_t *vm)
 

Variables

static char * vnet_policer_error_strings []
 
static vlib_node_registration_t policer_by_sw_if_index_node
 (constructor) VLIB_REGISTER_NODE (policer_by_sw_if_index_node) More...
 
static vlib_cli_command_t test_patch_command
 (constructor) VLIB_CLI_COMMAND (test_patch_command) More...
 
static char * policer_classify_error_strings []
 
vlib_node_registration_t ip4_policer_classify_node
 (constructor) VLIB_REGISTER_NODE (ip4_policer_classify_node) More...
 
vlib_node_registration_t ip6_policer_classify_node
 (constructor) VLIB_REGISTER_NODE (ip6_policer_classify_node) More...
 
vlib_node_registration_t l2_policer_classify_node
 (constructor) VLIB_REGISTER_NODE (l2_policer_classify_node) More...
 

Macro Definition Documentation

◆ foreach_policer_classify_error

#define foreach_policer_classify_error
Value:
_(MISS, "Policer classify misses") \
_(HIT, "Policer classify hits") \
_(CHAIN_HIT, "Policer classify hits after chain walk") \
_(DROP, "Policer classify action drop")
DROP
Definition: error.def:41

Definition at line 492 of file node_funcs.c.

◆ foreach_vnet_policer_error

#define foreach_vnet_policer_error
Value:
_(TRANSMIT, "Packets Transmitted") \
_(DROP, "Packets Dropped")
DROP
Definition: error.def:41

Definition at line 51 of file node_funcs.c.

◆ TEST_CODE

#define TEST_CODE   1

Definition at line 303 of file node_funcs.c.

Enumeration Type Documentation

◆ policer_classify_error_t

Enumerator
POLICER_CLASSIFY_N_ERROR 

Definition at line 498 of file node_funcs.c.

◆ vnet_policer_error_t

Enumerator
VNET_POLICER_N_ERROR 

Definition at line 55 of file node_funcs.c.

Function Documentation

◆ format_policer_classify_trace()

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

Definition at line 479 of file node_funcs.c.

+ Here is the call graph for this function:

◆ format_policer_trace()

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

Definition at line 40 of file node_funcs.c.

+ Here is the call graph for this function:

◆ ip4_policer_classify()

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

Definition at line 785 of file node_funcs.c.

+ Here is the call graph for this function:

◆ ip6_policer_classify()

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

Definition at line 810 of file node_funcs.c.

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

◆ l2_policer_classify()

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

Definition at line 835 of file node_funcs.c.

+ Here is the call graph for this function:

◆ policer_classify_init()

static clib_error_t* policer_classify_init ( vlib_main_t vm)
static

Definition at line 859 of file node_funcs.c.

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

◆ policer_classify_inline()

static uword policer_classify_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame,
policer_classify_table_id_t  tid 
)
inlinestatic

Definition at line 513 of file node_funcs.c.

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

◆ test_policer_add_del()

int test_policer_add_del ( u32  rx_sw_if_index,
u8 config_name,
int  is_add 
)

Definition at line 333 of file node_funcs.c.

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

◆ test_policer_command_fn()

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

Definition at line 384 of file node_funcs.c.

+ Here is the call graph for this function:

◆ VLIB_NODE_FUNCTION_MULTIARCH() [1/4]

VLIB_NODE_FUNCTION_MULTIARCH ( policer_by_sw_if_index_node  ,
vnet_policer_by_sw_if_index   
)

◆ VLIB_NODE_FUNCTION_MULTIARCH() [2/4]

VLIB_NODE_FUNCTION_MULTIARCH ( ip4_policer_classify_node  ,
ip4_policer_classify   
)

◆ VLIB_NODE_FUNCTION_MULTIARCH() [3/4]

VLIB_NODE_FUNCTION_MULTIARCH ( ip6_policer_classify_node  ,
ip6_policer_classify   
)

◆ VLIB_NODE_FUNCTION_MULTIARCH() [4/4]

VLIB_NODE_FUNCTION_MULTIARCH ( l2_policer_classify_node  ,
l2_policer_classify   
)

◆ vnet_policer_by_either()

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

Definition at line 291 of file node_funcs.c.

+ Here is the call graph for this function:

◆ vnet_policer_by_opaque()

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

Definition at line 284 of file node_funcs.c.

+ Here is the call graph for this function:

◆ vnet_policer_by_sw_if_index()

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

Definition at line 276 of file node_funcs.c.

+ Here is the call graph for this function:

◆ vnet_policer_inline()

static uword vnet_policer_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame,
vnet_policer_index_t  which 
)
inlinestatic

Definition at line 70 of file node_funcs.c.

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

◆ vnet_policer_node_funcs_reference()

void vnet_policer_node_funcs_reference ( void  )

Definition at line 298 of file node_funcs.c.

+ Here is the caller graph for this function:

Variable Documentation

◆ ip4_policer_classify_node

vlib_node_registration_t ip4_policer_classify_node
Initial value:
= {
.function = ip4_policer_classify,
.name = "ip4-policer-classify",
.vector_size = sizeof (u32),
.next_nodes = {
},
}
unsigned int u32
Definition: types.h:88
static char * policer_classify_error_strings[]
Definition: node_funcs.c:506
static uword ip4_policer_classify(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: node_funcs.c:785
#define ARRAY_LEN(x)
Definition: clib.h:62
static u8 * format_policer_classify_trace(u8 *s, va_list *args)
Definition: node_funcs.c:479

(constructor) VLIB_REGISTER_NODE (ip4_policer_classify_node)

Definition at line 793 of file node_funcs.c.

◆ ip6_policer_classify_node

vlib_node_registration_t ip6_policer_classify_node
Initial value:
= {
.function = ip6_policer_classify,
.name = "ip6-policer-classify",
.vector_size = sizeof (u32),
.next_nodes = {
},
}
unsigned int u32
Definition: types.h:88
static char * policer_classify_error_strings[]
Definition: node_funcs.c:506
#define ARRAY_LEN(x)
Definition: clib.h:62
static uword ip6_policer_classify(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: node_funcs.c:810
static u8 * format_policer_classify_trace(u8 *s, va_list *args)
Definition: node_funcs.c:479

(constructor) VLIB_REGISTER_NODE (ip6_policer_classify_node)

Definition at line 818 of file node_funcs.c.

◆ l2_policer_classify_node

vlib_node_registration_t l2_policer_classify_node
Initial value:
= {
.function = l2_policer_classify,
.name = "l2-policer-classify",
.vector_size = sizeof (u32),
.next_nodes = {
},
}
static uword l2_policer_classify(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: node_funcs.c:835
unsigned int u32
Definition: types.h:88
static char * policer_classify_error_strings[]
Definition: node_funcs.c:506
#define ARRAY_LEN(x)
Definition: clib.h:62
static u8 * format_policer_classify_trace(u8 *s, va_list *args)
Definition: node_funcs.c:479

(constructor) VLIB_REGISTER_NODE (l2_policer_classify_node)

Definition at line 842 of file node_funcs.c.

◆ policer_by_sw_if_index_node

vlib_node_registration_t policer_by_sw_if_index_node
static
Initial value:
= {
.name = "policer-by-sw-if-index",
.vector_size = sizeof (u32),
.format_trace = format_policer_trace,
.error_strings = vnet_policer_error_strings,
.n_next_nodes = VNET_POLICER_N_NEXT,
.next_nodes = {
[VNET_POLICER_NEXT_TRANSMIT] = "ethernet-input",
[VNET_POLICER_NEXT_DROP] = "error-drop",
},
}
static char * vnet_policer_error_strings[]
Definition: node_funcs.c:63
unsigned int u32
Definition: types.h:88
uword vnet_policer_by_sw_if_index(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: node_funcs.c:276
#define ARRAY_LEN(x)
Definition: clib.h:62
static u8 * format_policer_trace(u8 *s, va_list *args)
Definition: node_funcs.c:40

(constructor) VLIB_REGISTER_NODE (policer_by_sw_if_index_node)

Definition at line 308 of file node_funcs.c.

◆ policer_classify_error_strings

char* policer_classify_error_strings[]
static
Initial value:
= {
#define _(sym,string)
}
#define foreach_policer_classify_error
Definition: node_funcs.c:492

Definition at line 506 of file node_funcs.c.

◆ test_patch_command

vlib_cli_command_t test_patch_command
static
Initial value:
= {
.path = "test policer",
.short_help =
"intfc <intfc> policer <policer-config-name> [del]",
}
static clib_error_t * test_policer_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: node_funcs.c:384

(constructor) VLIB_CLI_COMMAND (test_patch_command)

Definition at line 458 of file node_funcs.c.

◆ vnet_policer_error_strings

char* vnet_policer_error_strings[]
static
Initial value:
= {
#define _(sym,string)
}
#define foreach_vnet_policer_error
Definition: node_funcs.c:51

Definition at line 63 of file node_funcs.c.