FD.io VPP  v21.01.1
Vector Packet Processing
dataplane_node.c File Reference
+ Include dependency graph for dataplane_node.c:

Go to the source code of this file.

Data Structures

struct  acl_fa_trace_t
 

Macros

#define foreach_acl_fa_error
 
#define ACL_PLUGIN_VECTOR_SIZE   4
 
#define ACL_PLUGIN_PREFETCH_GAP   3
 

Enumerations

enum  acl_fa_error_t { ACL_FA_N_ERROR, ACL_FA_N_ERROR }
 

Functions

static u16 get_current_policy_epoch (acl_main_t *am, int is_input, u32 sw_if_index0)
 
static void maybe_trace_buffer (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_buffer_t *b, u32 sw_if_index0, u32 lc_index0, u16 next0, int match_acl_in_index, int match_rule_index, fa_5tuple_t *fa_5tuple, u8 action, u32 trace_bitmap)
 
static int stale_session_deleted (acl_main_t *am, int is_input, acl_fa_per_worker_data_t *pw, u64 now, u32 sw_if_index0, fa_full_session_id_t f_sess_id)
 
static void get_sw_if_index_xN (int vector_sz, int is_input, vlib_buffer_t **b, u32 *out_sw_if_index)
 
static void fill_5tuple_xN (int vector_sz, acl_main_t *am, int is_ip6, int is_input, int is_l2_path, vlib_buffer_t **b, u32 *sw_if_index, fa_5tuple_t *out_fa_5tuple)
 
static void make_session_hash_xN (int vector_sz, acl_main_t *am, int is_ip6, u32 *sw_if_index, fa_5tuple_t *fa_5tuple, u64 *out_hash)
 
static void prefetch_session_entry (acl_main_t *am, fa_full_session_id_t f_sess_id)
 
static u8 process_established_session (vlib_main_t *vm, acl_main_t *am, u32 counter_node_index, int is_input, u64 now, fa_full_session_id_t f_sess_id, u32 *sw_if_index, fa_5tuple_t *fa_5tuple, u32 pkt_len, int node_trace_on, u32 *trace_bitmap)
 
static void acl_fa_node_common_prepare_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int is_ip6, int is_input, int is_l2_path, int with_stateful_datapath)
 
static uword acl_fa_inner_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int is_ip6, int is_input, int is_l2_path, int with_stateful_datapath, int node_trace_on, int reclassify_sessions)
 
static uword acl_fa_outer_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int is_ip6, int is_input, int is_l2_path, int do_stateful_datapath)
 
static uword acl_fa_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int is_ip6, int is_input, int is_l2_path)
 
static u8format_fa_5tuple (u8 *s, va_list *args)
 
u8format_acl_plugin_5tuple (u8 *s, va_list *args)
 
static u8format_acl_plugin_trace (u8 *s, va_list *args)
 
VLIB_NODE_FN() acl_in_l2_ip6_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
VLIB_NODE_FN() acl_in_l2_ip4_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
VLIB_NODE_FN() acl_out_l2_ip6_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
VLIB_NODE_FN() acl_out_l2_ip4_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
VLIB_NODE_FN() acl_in_fa_ip6_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
VLIB_NODE_FN() acl_in_fa_ip4_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
VLIB_NODE_FN() acl_out_fa_ip6_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
VLIB_NODE_FN() acl_out_fa_ip4_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
 VNET_FEATURE_INIT (acl_in_l2_ip6_fa_feature, static)
 
 VNET_FEATURE_INIT (acl_in_l2_ip4_fa_feature, static)
 
 VNET_FEATURE_INIT (acl_out_l2_ip6_fa_feature, static)
 
 VNET_FEATURE_INIT (acl_out_l2_ip4_fa_feature, static)
 
 VNET_FEATURE_INIT (acl_in_ip6_fa_feature, static)
 
 VNET_FEATURE_INIT (acl_in_ip4_fa_feature, static)
 
 VNET_FEATURE_INIT (acl_out_ip6_fa_feature, static)
 
 VNET_FEATURE_INIT (acl_out_ip4_fa_feature, static)
 

Variables

static char * acl_fa_error_strings []
 
vlib_node_registration_t acl_in_l2_ip6_node
 (constructor) VLIB_REGISTER_NODE (acl_in_l2_ip6_node) More...
 
vlib_node_registration_t acl_in_l2_ip4_node
 (constructor) VLIB_REGISTER_NODE (acl_in_l2_ip4_node) More...
 
vlib_node_registration_t acl_out_l2_ip6_node
 (constructor) VLIB_REGISTER_NODE (acl_out_l2_ip6_node) More...
 
vlib_node_registration_t acl_out_l2_ip4_node
 (constructor) VLIB_REGISTER_NODE (acl_out_l2_ip4_node) More...
 
vlib_node_registration_t acl_in_fa_ip6_node
 (constructor) VLIB_REGISTER_NODE (acl_in_fa_ip6_node) More...
 
vlib_node_registration_t acl_in_fa_ip4_node
 (constructor) VLIB_REGISTER_NODE (acl_in_fa_ip4_node) More...
 
vlib_node_registration_t acl_out_fa_ip6_node
 (constructor) VLIB_REGISTER_NODE (acl_out_fa_ip6_node) More...
 
vlib_node_registration_t acl_out_fa_ip4_node
 (constructor) VLIB_REGISTER_NODE (acl_out_fa_ip4_node) More...
 

Macro Definition Documentation

◆ ACL_PLUGIN_PREFETCH_GAP

#define ACL_PLUGIN_PREFETCH_GAP   3

Definition at line 231 of file dataplane_node.c.

◆ ACL_PLUGIN_VECTOR_SIZE

#define ACL_PLUGIN_VECTOR_SIZE   4

Definition at line 230 of file dataplane_node.c.

◆ foreach_acl_fa_error

#define foreach_acl_fa_error
Value:
_(ACL_DROP, "ACL deny packets") \
_(ACL_PERMIT, "ACL permit packets") \
_(ACL_NEW_SESSION, "new sessions added") \
_(ACL_EXIST_SESSION, "existing session packets") \
_(ACL_CHECK, "checked packets") \
_(ACL_RESTART_SESSION_TIMER, "restart session timer") \
_(ACL_TOO_MANY_SESSIONS, "too many sessions to add new") \
/* end of errors */

Definition at line 48 of file dataplane_node.c.

Enumeration Type Documentation

◆ acl_fa_error_t

Enumerator
ACL_FA_N_ERROR 
ACL_FA_N_ERROR 

Definition at line 58 of file dataplane_node.c.

Function Documentation

◆ acl_fa_inner_node_fn()

static uword acl_fa_inner_node_fn ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame,
int  is_ip6,
int  is_input,
int  is_l2_path,
int  with_stateful_datapath,
int  node_trace_on,
int  reclassify_sessions 
)
inlinestatic

Definition at line 323 of file dataplane_node.c.

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

◆ acl_fa_node_common_prepare_fn()

static void acl_fa_node_common_prepare_fn ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame,
int  is_ip6,
int  is_input,
int  is_l2_path,
int  with_stateful_datapath 
)
inlinestatic

Definition at line 234 of file dataplane_node.c.

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

◆ acl_fa_node_fn()

static uword acl_fa_node_fn ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame,
int  is_ip6,
int  is_input,
int  is_l2_path 
)
inlinestatic

Definition at line 641 of file dataplane_node.c.

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

◆ acl_fa_outer_node_fn()

static uword acl_fa_outer_node_fn ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame,
int  is_ip6,
int  is_input,
int  is_l2_path,
int  do_stateful_datapath 
)
inlinestatic

Definition at line 605 of file dataplane_node.c.

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

◆ acl_in_fa_ip4_node()

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

Definition at line 776 of file dataplane_node.c.

+ Here is the call graph for this function:

◆ acl_in_fa_ip6_node()

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

Definition at line 769 of file dataplane_node.c.

+ Here is the call graph for this function:

◆ acl_in_l2_ip4_node()

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

Definition at line 746 of file dataplane_node.c.

+ Here is the call graph for this function:

◆ acl_in_l2_ip6_node()

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

Definition at line 739 of file dataplane_node.c.

+ Here is the call graph for this function:

◆ acl_out_fa_ip4_node()

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

Definition at line 790 of file dataplane_node.c.

+ Here is the call graph for this function:

◆ acl_out_fa_ip6_node()

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

Definition at line 783 of file dataplane_node.c.

+ Here is the call graph for this function:

◆ acl_out_l2_ip4_node()

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

Definition at line 760 of file dataplane_node.c.

+ Here is the call graph for this function:

◆ acl_out_l2_ip6_node()

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

Definition at line 753 of file dataplane_node.c.

+ Here is the call graph for this function:

◆ fill_5tuple_xN()

static void fill_5tuple_xN ( int  vector_sz,
acl_main_t am,
int  is_ip6,
int  is_input,
int  is_l2_path,
vlib_buffer_t **  b,
u32 sw_if_index,
fa_5tuple_t out_fa_5tuple 
)
inlinestatic

Definition at line 153 of file dataplane_node.c.

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

◆ format_acl_plugin_5tuple()

u8* format_acl_plugin_5tuple ( u8 s,
va_list *  args 
)

Definition at line 703 of file dataplane_node.c.

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

◆ format_acl_plugin_trace()

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

Definition at line 711 of file dataplane_node.c.

+ Here is the call graph for this function:

◆ format_fa_5tuple()

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

Definition at line 664 of file dataplane_node.c.

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

◆ get_current_policy_epoch()

static u16 get_current_policy_epoch ( acl_main_t am,
int  is_input,
u32  sw_if_index0 
)
inlinestatic

Definition at line 69 of file dataplane_node.c.

+ Here is the caller graph for this function:

◆ get_sw_if_index_xN()

static void get_sw_if_index_xN ( int  vector_sz,
int  is_input,
vlib_buffer_t **  b,
u32 out_sw_if_index 
)
inlinestatic

Definition at line 141 of file dataplane_node.c.

+ Here is the caller graph for this function:

◆ make_session_hash_xN()

static void make_session_hash_xN ( int  vector_sz,
acl_main_t am,
int  is_ip6,
u32 sw_if_index,
fa_5tuple_t fa_5tuple,
u64 out_hash 
)
inlinestatic

Definition at line 164 of file dataplane_node.c.

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

◆ maybe_trace_buffer()

static void maybe_trace_buffer ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_buffer_t b,
u32  sw_if_index0,
u32  lc_index0,
u16  next0,
int  match_acl_in_index,
int  match_rule_index,
fa_5tuple_t fa_5tuple,
u8  action,
u32  trace_bitmap 
)
inlinestatic

Definition at line 82 of file dataplane_node.c.

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

◆ prefetch_session_entry()

static void prefetch_session_entry ( acl_main_t am,
fa_full_session_id_t  f_sess_id 
)
inlinestatic

Definition at line 175 of file dataplane_node.c.

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

◆ process_established_session()

static u8 process_established_session ( vlib_main_t vm,
acl_main_t am,
u32  counter_node_index,
int  is_input,
u64  now,
fa_full_session_id_t  f_sess_id,
u32 sw_if_index,
fa_5tuple_t fa_5tuple,
u32  pkt_len,
int  node_trace_on,
u32 trace_bitmap 
)
inlinestatic

Definition at line 183 of file dataplane_node.c.

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

◆ stale_session_deleted()

static int stale_session_deleted ( acl_main_t am,
int  is_input,
acl_fa_per_worker_data_t pw,
u64  now,
u32  sw_if_index0,
fa_full_session_id_t  f_sess_id 
)
inlinestatic

Definition at line 108 of file dataplane_node.c.

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

◆ VNET_FEATURE_INIT() [1/8]

VNET_FEATURE_INIT ( acl_in_l2_ip6_fa_feature  ,
static   
)

◆ VNET_FEATURE_INIT() [2/8]

VNET_FEATURE_INIT ( acl_in_l2_ip4_fa_feature  ,
static   
)

◆ VNET_FEATURE_INIT() [3/8]

VNET_FEATURE_INIT ( acl_out_l2_ip6_fa_feature  ,
static   
)

◆ VNET_FEATURE_INIT() [4/8]

VNET_FEATURE_INIT ( acl_out_l2_ip4_fa_feature  ,
static   
)

◆ VNET_FEATURE_INIT() [5/8]

VNET_FEATURE_INIT ( acl_in_ip6_fa_feature  ,
static   
)

◆ VNET_FEATURE_INIT() [6/8]

VNET_FEATURE_INIT ( acl_in_ip4_fa_feature  ,
static   
)

◆ VNET_FEATURE_INIT() [7/8]

VNET_FEATURE_INIT ( acl_out_ip6_fa_feature  ,
static   
)

◆ VNET_FEATURE_INIT() [8/8]

VNET_FEATURE_INIT ( acl_out_ip4_fa_feature  ,
static   
)

Variable Documentation

◆ acl_fa_error_strings

char* acl_fa_error_strings[]
static
Initial value:
= {
#define _(sym,string)
}
#define foreach_acl_fa_error

Definition at line 733 of file dataplane_node.c.

◆ acl_in_fa_ip4_node

vlib_node_registration_t acl_in_fa_ip4_node
Initial value:
=
{
.name = "acl-plugin-in-ip4-fa",
.vector_size = sizeof (u32),
.format_trace = format_acl_plugin_trace,
.error_strings = acl_fa_error_strings,
.n_next_nodes = ACL_FA_N_NEXT,
.next_nodes =
{
[ACL_FA_ERROR_DROP] = "error-drop",
}
}
unsigned int u32
Definition: types.h:88
static char * acl_fa_error_strings[]
vl_api_fib_path_type_t type
Definition: fib_types.api:123
#define ARRAY_LEN(x)
Definition: clib.h:67
static u8 * format_acl_plugin_trace(u8 *s, va_list *args)

(constructor) VLIB_REGISTER_NODE (acl_in_fa_ip4_node)

Definition at line 910 of file dataplane_node.c.

◆ acl_in_fa_ip6_node

vlib_node_registration_t acl_in_fa_ip6_node
Initial value:
=
{
.name = "acl-plugin-in-ip6-fa",
.vector_size = sizeof (u32),
.format_trace = format_acl_plugin_trace,
.error_strings = acl_fa_error_strings,
.n_next_nodes = ACL_FA_N_NEXT,
.next_nodes =
{
[ACL_FA_ERROR_DROP] = "error-drop",
}
}
unsigned int u32
Definition: types.h:88
static char * acl_fa_error_strings[]
vl_api_fib_path_type_t type
Definition: fib_types.api:123
#define ARRAY_LEN(x)
Definition: clib.h:67
static u8 * format_acl_plugin_trace(u8 *s, va_list *args)

(constructor) VLIB_REGISTER_NODE (acl_in_fa_ip6_node)

Definition at line 888 of file dataplane_node.c.

◆ acl_in_l2_ip4_node

vlib_node_registration_t acl_in_l2_ip4_node
Initial value:
=
{
.name = "acl-plugin-in-ip4-l2",
.vector_size = sizeof (u32),
.format_trace = format_acl_plugin_trace,
.error_strings = acl_fa_error_strings,
.n_next_nodes = ACL_FA_N_NEXT,
.next_nodes =
{
[ACL_FA_ERROR_DROP] = "error-drop",
}
}
unsigned int u32
Definition: types.h:88
static char * acl_fa_error_strings[]
vl_api_fib_path_type_t type
Definition: fib_types.api:123
#define ARRAY_LEN(x)
Definition: clib.h:67
static u8 * format_acl_plugin_trace(u8 *s, va_list *args)

(constructor) VLIB_REGISTER_NODE (acl_in_l2_ip4_node)

Definition at line 819 of file dataplane_node.c.

◆ acl_in_l2_ip6_node

vlib_node_registration_t acl_in_l2_ip6_node
Initial value:
=
{
.name = "acl-plugin-in-ip6-l2",
.vector_size = sizeof (u32),
.format_trace = format_acl_plugin_trace,
.error_strings = acl_fa_error_strings,
.n_next_nodes = ACL_FA_N_NEXT,
.next_nodes =
{
[ACL_FA_ERROR_DROP] = "error-drop",
}
}
unsigned int u32
Definition: types.h:88
static char * acl_fa_error_strings[]
vl_api_fib_path_type_t type
Definition: fib_types.api:123
#define ARRAY_LEN(x)
Definition: clib.h:67
static u8 * format_acl_plugin_trace(u8 *s, va_list *args)

(constructor) VLIB_REGISTER_NODE (acl_in_l2_ip6_node)

Definition at line 797 of file dataplane_node.c.

◆ acl_out_fa_ip4_node

vlib_node_registration_t acl_out_fa_ip4_node
Initial value:
=
{
.name = "acl-plugin-out-ip4-fa",
.vector_size = sizeof (u32),
.format_trace = format_acl_plugin_trace,
.error_strings = acl_fa_error_strings,
.n_next_nodes = ACL_FA_N_NEXT,
.next_nodes =
{
[ACL_FA_ERROR_DROP] = "error-drop",
}
}
unsigned int u32
Definition: types.h:88
static char * acl_fa_error_strings[]
vl_api_fib_path_type_t type
Definition: fib_types.api:123
#define ARRAY_LEN(x)
Definition: clib.h:67
static u8 * format_acl_plugin_trace(u8 *s, va_list *args)

(constructor) VLIB_REGISTER_NODE (acl_out_fa_ip4_node)

Definition at line 955 of file dataplane_node.c.

◆ acl_out_fa_ip6_node

vlib_node_registration_t acl_out_fa_ip6_node
Initial value:
=
{
.name = "acl-plugin-out-ip6-fa",
.vector_size = sizeof (u32),
.format_trace = format_acl_plugin_trace,
.error_strings = acl_fa_error_strings,
.n_next_nodes = ACL_FA_N_NEXT,
.next_nodes =
{
[ACL_FA_ERROR_DROP] = "error-drop",
}
}
unsigned int u32
Definition: types.h:88
static char * acl_fa_error_strings[]
vl_api_fib_path_type_t type
Definition: fib_types.api:123
#define ARRAY_LEN(x)
Definition: clib.h:67
static u8 * format_acl_plugin_trace(u8 *s, va_list *args)

(constructor) VLIB_REGISTER_NODE (acl_out_fa_ip6_node)

Definition at line 933 of file dataplane_node.c.

◆ acl_out_l2_ip4_node

vlib_node_registration_t acl_out_l2_ip4_node
Initial value:
=
{
.name = "acl-plugin-out-ip4-l2",
.vector_size = sizeof (u32),
.format_trace = format_acl_plugin_trace,
.error_strings = acl_fa_error_strings,
.n_next_nodes = ACL_FA_N_NEXT,
.next_nodes =
{
[ACL_FA_ERROR_DROP] = "error-drop",
}
}
unsigned int u32
Definition: types.h:88
static char * acl_fa_error_strings[]
vl_api_fib_path_type_t type
Definition: fib_types.api:123
#define ARRAY_LEN(x)
Definition: clib.h:67
static u8 * format_acl_plugin_trace(u8 *s, va_list *args)

(constructor) VLIB_REGISTER_NODE (acl_out_l2_ip4_node)

Definition at line 865 of file dataplane_node.c.

◆ acl_out_l2_ip6_node

vlib_node_registration_t acl_out_l2_ip6_node
Initial value:
=
{
.name = "acl-plugin-out-ip6-l2",
.vector_size = sizeof (u32),
.format_trace = format_acl_plugin_trace,
.error_strings = acl_fa_error_strings,
.n_next_nodes = ACL_FA_N_NEXT,
.next_nodes =
{
[ACL_FA_ERROR_DROP] = "error-drop",
}
}
unsigned int u32
Definition: types.h:88
static char * acl_fa_error_strings[]
vl_api_fib_path_type_t type
Definition: fib_types.api:123
#define ARRAY_LEN(x)
Definition: clib.h:67
static u8 * format_acl_plugin_trace(u8 *s, va_list *args)

(constructor) VLIB_REGISTER_NODE (acl_out_l2_ip6_node)

Definition at line 842 of file dataplane_node.c.