FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
fa_node.h File Reference
+ Include dependency graph for fa_node.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

union  fa_packet_info_t
 
union  fa_session_l4_key_t
 
union  fa_5tuple_t
 
struct  fa_session_t
 
struct  fa_full_session_id_t
 
struct  acl_fa_per_worker_data_t
 

Macros

#define TCP_FLAG_FIN   0x01
 
#define TCP_FLAG_SYN   0x02
 
#define TCP_FLAG_RST   0x04
 
#define TCP_FLAG_PUSH   0x08
 
#define TCP_FLAG_ACK   0x10
 
#define TCP_FLAG_URG   0x20
 
#define TCP_FLAG_ECE   0x40
 
#define TCP_FLAG_CWR   0x80
 
#define TCP_FLAGS_RSTFINACKSYN   (TCP_FLAG_RST + TCP_FLAG_FIN + TCP_FLAG_SYN + TCP_FLAG_ACK)
 
#define TCP_FLAGS_ACKSYN   (TCP_FLAG_SYN + TCP_FLAG_ACK)
 
#define ACL_FA_CONN_TABLE_DEFAULT_HASH_NUM_BUCKETS   (64 * 1024)
 
#define ACL_FA_CONN_TABLE_DEFAULT_HASH_MEMORY_SIZE   (1ULL<<30)
 
#define ACL_FA_CONN_TABLE_DEFAULT_MAX_ENTRIES   500000
 
#define FA_POLICY_EPOCH_MASK   0x7fff
 
#define FA_POLICY_EPOCH_IS_INPUT   0x8000
 
#define CT_ASSERT_EQUAL(name, x, y)   typedef int assert_ ## name ## _compile_time_assertion_failed[((x) == (y))-1]
 
#define FA_SESSION_BOGUS_INDEX   ~0
 
#define elog_acl_maybe_trace_X1(am, acl_elog_trace_format_label, acl_elog_trace_format_args, acl_elog_val1)
 
#define elog_acl_maybe_trace_X2(am, acl_elog_trace_format_label, acl_elog_trace_format_args, acl_elog_val1, acl_elog_val2)
 
#define elog_acl_maybe_trace_X3(am, acl_elog_trace_format_label, acl_elog_trace_format_args, acl_elog_val1, acl_elog_val2, acl_elog_val3)
 
#define elog_acl_maybe_trace_X4(am, acl_elog_trace_format_label, acl_elog_trace_format_args, acl_elog_val1, acl_elog_val2, acl_elog_val3, acl_elog_val4)
 

Enumerations

enum  fa_session_l4_key_l4_flags_t { FA_SK_L4_FLAG_IS_INPUT = (1 << 0), FA_SK_L4_FLAG_IS_SLOWPATH = (1 << 1) }
 
enum  acl_fa_next_t { ACL_FA_ERROR_DROP, ACL_FA_N_NEXT }
 
enum  acl_fa_cleaner_process_event_e { ACL_FA_CLEANER_RESCHEDULE = 1, ACL_FA_CLEANER_DELETE_BY_SW_IF_INDEX }
 

Functions

static_always_inline int is_session_l4_key_u64_slowpath (u64 l4key)
 
static_always_inline u8format_fa_session_l4_key (u8 *s, va_list *args)
 
 CT_ASSERT_EQUAL (fa_l3_key_size_is_40, offsetof(fa_5tuple_t, pkt), offsetof(clib_bihash_kv_40_8_t, value))
 
 CT_ASSERT_EQUAL (fa_ip6_kv_val_at_pkt, offsetof(fa_5tuple_t, pkt), offsetof(fa_5tuple_t, kv_40_8.value))
 
 CT_ASSERT_EQUAL (fa_ip4_kv_val_at_pkt, offsetof(fa_5tuple_t, pkt), offsetof(fa_5tuple_t, kv_16_8.value))
 
 CT_ASSERT_EQUAL (fa_l4_key_t_is_8, sizeof(fa_session_l4_key_t), sizeof(u64))
 
 CT_ASSERT_EQUAL (fa_packet_info_t_is_8, sizeof(fa_packet_info_t), sizeof(u64))
 
 CT_ASSERT_EQUAL (fa_l3_kv_size_is_48, sizeof(fa_5tuple_t), sizeof(clib_bihash_kv_40_8_t))
 
 CT_ASSERT_EQUAL (fa_ip4_starts_at_kv16_key, offsetof(fa_5tuple_t, ip4_addr), offsetof(fa_5tuple_t, kv_16_8))
 
 CT_ASSERT_EQUAL (fa_ip4_and_ip6_kv_value_match, offsetof(fa_5tuple_t, kv_16_8.value), offsetof(fa_5tuple_t, kv_40_8.value))
 
 CT_ASSERT_EQUAL (fa_session_t_size_is_128, sizeof(fa_session_t), 128)
 
 CT_ASSERT_EQUAL (fa_full_session_id_size_is_64, sizeof(fa_full_session_id_t), sizeof(u64))
 
 CT_ASSERT_EQUAL (fa_5tuple_opaque_t_must_match_5tuple, sizeof(fa_5tuple_opaque_t), sizeof(fa_5tuple_t))
 
void acl_fa_enable_disable (u32 sw_if_index, int is_input, int enable_disable)
 
void show_fa_sessions_hash (vlib_main_t *vm, u32 verbose)
 
u8format_acl_plugin_5tuple (u8 *s, va_list *args)
 

Macro Definition Documentation

◆ ACL_FA_CONN_TABLE_DEFAULT_HASH_MEMORY_SIZE

#define ACL_FA_CONN_TABLE_DEFAULT_HASH_MEMORY_SIZE   (1ULL<<30)

Definition at line 24 of file fa_node.h.

◆ ACL_FA_CONN_TABLE_DEFAULT_HASH_NUM_BUCKETS

#define ACL_FA_CONN_TABLE_DEFAULT_HASH_NUM_BUCKETS   (64 * 1024)

Definition at line 23 of file fa_node.h.

◆ ACL_FA_CONN_TABLE_DEFAULT_MAX_ENTRIES

#define ACL_FA_CONN_TABLE_DEFAULT_MAX_ENTRIES   500000

Definition at line 25 of file fa_node.h.

◆ CT_ASSERT_EQUAL

#define CT_ASSERT_EQUAL (   name,
  x,
 
)    typedef int assert_ ## name ## _compile_time_assertion_failed[((x) == (y))-1]

Definition at line 147 of file fa_node.h.

◆ elog_acl_maybe_trace_X1

#define elog_acl_maybe_trace_X1 (   am,
  acl_elog_trace_format_label,
  acl_elog_trace_format_args,
  acl_elog_val1 
)
Value:
do { \
if (am->trace_sessions) { \
CLIB_UNUSED(struct { u8 available_space[18 - sizeof(acl_elog_val1)]; } *static_check); \
vlib_worker_thread_t * w = vlib_worker_threads + thread_index; \
ELOG_TYPE_DECLARE (e) = \
{ \
.format = "(%02d) " acl_elog_trace_format_label, \
.format_args = "i2" acl_elog_trace_format_args, \
}; \
CLIB_PACKED(struct \
{ \
u16 thread; \
typeof(acl_elog_val1) val1; \
}) *ed; \
ed = ELOG_TRACK_DATA (&vlib_global_main.elog_main, e, w->elog_track); \
ed->thread = thread_index; \
ed->val1 = acl_elog_val1; \
} \
} while (0)

Definition at line 258 of file fa_node.h.

◆ elog_acl_maybe_trace_X2

#define elog_acl_maybe_trace_X2 (   am,
  acl_elog_trace_format_label,
  acl_elog_trace_format_args,
  acl_elog_val1,
  acl_elog_val2 
)
Value:
do { \
if (am->trace_sessions) { \
CLIB_UNUSED(struct { u8 available_space[18 - sizeof(acl_elog_val1) - sizeof(acl_elog_val2)]; } *static_check); \
vlib_worker_thread_t * w = vlib_worker_threads + thread_index; \
ELOG_TYPE_DECLARE (e) = \
{ \
.format = "(%02d) " acl_elog_trace_format_label, \
.format_args = "i2" acl_elog_trace_format_args, \
}; \
CLIB_PACKED(struct \
{ \
u16 thread; \
typeof(acl_elog_val1) val1; \
typeof(acl_elog_val2) val2; \
}) *ed; \
ed = ELOG_TRACK_DATA (&vlib_global_main.elog_main, e, w->elog_track); \
ed->thread = thread_index; \
ed->val1 = acl_elog_val1; \
ed->val2 = acl_elog_val2; \
} \
} while (0)

Definition at line 283 of file fa_node.h.

◆ elog_acl_maybe_trace_X3

#define elog_acl_maybe_trace_X3 (   am,
  acl_elog_trace_format_label,
  acl_elog_trace_format_args,
  acl_elog_val1,
  acl_elog_val2,
  acl_elog_val3 
)
Value:
do { \
if (am->trace_sessions) { \
CLIB_UNUSED(struct { u8 available_space[18 - sizeof(acl_elog_val1) - sizeof(acl_elog_val2) \
- sizeof(acl_elog_val3)]; } *static_check); \
vlib_worker_thread_t * w = vlib_worker_threads + thread_index; \
ELOG_TYPE_DECLARE (e) = \
{ \
.format = "(%02d) " acl_elog_trace_format_label, \
.format_args = "i2" acl_elog_trace_format_args, \
}; \
CLIB_PACKED(struct \
{ \
u16 thread; \
typeof(acl_elog_val1) val1; \
typeof(acl_elog_val2) val2; \
typeof(acl_elog_val3) val3; \
}) *ed; \
ed = ELOG_TRACK_DATA (&vlib_global_main.elog_main, e, w->elog_track); \
ed->thread = thread_index; \
ed->val1 = acl_elog_val1; \
ed->val2 = acl_elog_val2; \
ed->val3 = acl_elog_val3; \
} \
} while (0)

Definition at line 311 of file fa_node.h.

◆ elog_acl_maybe_trace_X4

#define elog_acl_maybe_trace_X4 (   am,
  acl_elog_trace_format_label,
  acl_elog_trace_format_args,
  acl_elog_val1,
  acl_elog_val2,
  acl_elog_val3,
  acl_elog_val4 
)
Value:
do { \
if (am->trace_sessions) { \
CLIB_UNUSED(struct { u8 available_space[18 - sizeof(acl_elog_val1) - sizeof(acl_elog_val2) \
- sizeof(acl_elog_val3) -sizeof(acl_elog_val4)]; } *static_check); \
vlib_worker_thread_t * w = vlib_worker_threads + thread_index; \
ELOG_TYPE_DECLARE (e) = \
{ \
.format = "(%02d) " acl_elog_trace_format_label, \
.format_args = "i2" acl_elog_trace_format_args, \
}; \
CLIB_PACKED(struct \
{ \
u16 thread; \
typeof(acl_elog_val1) val1; \
typeof(acl_elog_val2) val2; \
typeof(acl_elog_val3) val3; \
typeof(acl_elog_val4) val4; \
}) *ed; \
ed = ELOG_TRACK_DATA (&vlib_global_main.elog_main, e, w->elog_track); \
ed->thread = thread_index; \
ed->val1 = acl_elog_val1; \
ed->val2 = acl_elog_val2; \
ed->val3 = acl_elog_val3; \
ed->val4 = acl_elog_val4; \
} \
} while (0)

Definition at line 342 of file fa_node.h.

◆ FA_POLICY_EPOCH_IS_INPUT

#define FA_POLICY_EPOCH_IS_INPUT   0x8000

Definition at line 126 of file fa_node.h.

◆ FA_POLICY_EPOCH_MASK

#define FA_POLICY_EPOCH_MASK   0x7fff

Definition at line 124 of file fa_node.h.

◆ FA_SESSION_BOGUS_INDEX

#define FA_SESSION_BOGUS_INDEX   ~0

Definition at line 166 of file fa_node.h.

◆ TCP_FLAG_ACK

#define TCP_FLAG_ACK   0x10

Definition at line 16 of file fa_node.h.

◆ TCP_FLAG_CWR

#define TCP_FLAG_CWR   0x80

Definition at line 19 of file fa_node.h.

◆ TCP_FLAG_ECE

#define TCP_FLAG_ECE   0x40

Definition at line 18 of file fa_node.h.

◆ TCP_FLAG_FIN

#define TCP_FLAG_FIN   0x01

Definition at line 12 of file fa_node.h.

◆ TCP_FLAG_PUSH

#define TCP_FLAG_PUSH   0x08

Definition at line 15 of file fa_node.h.

◆ TCP_FLAG_RST

#define TCP_FLAG_RST   0x04

Definition at line 14 of file fa_node.h.

◆ TCP_FLAG_SYN

#define TCP_FLAG_SYN   0x02

Definition at line 13 of file fa_node.h.

◆ TCP_FLAG_URG

#define TCP_FLAG_URG   0x20

Definition at line 17 of file fa_node.h.

◆ TCP_FLAGS_ACKSYN

#define TCP_FLAGS_ACKSYN   (TCP_FLAG_SYN + TCP_FLAG_ACK)

Definition at line 21 of file fa_node.h.

◆ TCP_FLAGS_RSTFINACKSYN

#define TCP_FLAGS_RSTFINACKSYN   (TCP_FLAG_RST + TCP_FLAG_FIN + TCP_FLAG_SYN + TCP_FLAG_ACK)

Definition at line 20 of file fa_node.h.

Enumeration Type Documentation

◆ acl_fa_cleaner_process_event_e

Enumerator
ACL_FA_CLEANER_RESCHEDULE 
ACL_FA_CLEANER_DELETE_BY_SW_IF_INDEX 

Definition at line 244 of file fa_node.h.

◆ acl_fa_next_t

Enumerator
ACL_FA_ERROR_DROP 
ACL_FA_N_NEXT 

Definition at line 238 of file fa_node.h.

◆ fa_session_l4_key_l4_flags_t

Enumerator
FA_SK_L4_FLAG_IS_INPUT 
FA_SK_L4_FLAG_IS_SLOWPATH 

Definition at line 41 of file fa_node.h.

Function Documentation

◆ acl_fa_enable_disable()

void acl_fa_enable_disable ( u32  sw_if_index,
int  is_input,
int  enable_disable 
)

Definition at line 856 of file sess_mgmt_node.c.

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

◆ CT_ASSERT_EQUAL() [1/11]

CT_ASSERT_EQUAL ( fa_5tuple_opaque_t_must_match_5tuple  ,
sizeof(fa_5tuple_opaque_t ,
sizeof(fa_5tuple_t  
)

◆ CT_ASSERT_EQUAL() [2/11]

CT_ASSERT_EQUAL ( fa_full_session_id_size_is_64  ,
sizeof(fa_full_session_id_t ,
sizeof(u64  
)

◆ CT_ASSERT_EQUAL() [3/11]

CT_ASSERT_EQUAL ( fa_ip4_and_ip6_kv_value_match  ,
offsetof(fa_5tuple_t, kv_16_8.value ,
offsetof(fa_5tuple_t, kv_40_8.value  
)

◆ CT_ASSERT_EQUAL() [4/11]

CT_ASSERT_EQUAL ( fa_ip4_kv_val_at_pkt  ,
offsetof(fa_5tuple_t, pkt)  ,
offsetof(fa_5tuple_t, kv_16_8.value  
)

◆ CT_ASSERT_EQUAL() [5/11]

CT_ASSERT_EQUAL ( fa_ip4_starts_at_kv16_key  ,
offsetof(fa_5tuple_t, ip4_addr)  ,
offsetof(fa_5tuple_t, kv_16_8)   
)

◆ CT_ASSERT_EQUAL() [6/11]

CT_ASSERT_EQUAL ( fa_ip6_kv_val_at_pkt  ,
offsetof(fa_5tuple_t, pkt)  ,
offsetof(fa_5tuple_t, kv_40_8.value  
)

◆ CT_ASSERT_EQUAL() [7/11]

CT_ASSERT_EQUAL ( fa_l3_key_size_is_40  ,
offsetof(fa_5tuple_t, pkt)  ,
offsetof(clib_bihash_kv_40_8_t, value  
)

◆ CT_ASSERT_EQUAL() [8/11]

CT_ASSERT_EQUAL ( fa_l3_kv_size_is_48  ,
sizeof(fa_5tuple_t ,
sizeof(clib_bihash_kv_40_8_t  
)

◆ CT_ASSERT_EQUAL() [9/11]

CT_ASSERT_EQUAL ( fa_l4_key_t_is_8  ,
sizeof(fa_session_l4_key_t ,
sizeof(u64  
)

◆ CT_ASSERT_EQUAL() [10/11]

CT_ASSERT_EQUAL ( fa_packet_info_t_is_8  ,
sizeof(fa_packet_info_t ,
sizeof(u64  
)

◆ CT_ASSERT_EQUAL() [11/11]

CT_ASSERT_EQUAL ( fa_session_t_size_is_128  ,
sizeof(fa_session_t ,
128   
)

◆ 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_fa_session_l4_key()

static_always_inline u8* format_fa_session_l4_key ( u8 s,
va_list *  args 
)

Definition at line 93 of file fa_node.h.

+ Here is the caller graph for this function:

◆ is_session_l4_key_u64_slowpath()

static_always_inline int is_session_l4_key_u64_slowpath ( u64  l4key)

Definition at line 63 of file fa_node.h.

+ Here is the caller graph for this function:

◆ show_fa_sessions_hash()

void show_fa_sessions_hash ( vlib_main_t vm,
u32  verbose 
)

Definition at line 917 of file sess_mgmt_node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:
thread_index
u32 thread_index
Definition: nat44_ei_hairpinning.c:492
thread
pthread_t thread[MAX_CONNS]
Definition: main.c:142
am
app_main_t * am
Definition: application.c:489
vlib_worker_threads
vlib_worker_thread_t * vlib_worker_threads
Definition: threads.c:35
ELOG_TRACK_DATA
#define ELOG_TRACK_DATA(em, f, track)
Definition: elog.h:478
vlib_global_main
vlib_global_main_t vlib_global_main
Definition: main.c:1786
vlib_global_main_t::elog_main
elog_main_t elog_main
Definition: main.h:300
os_get_thread_index
static_always_inline uword os_get_thread_index(void)
Definition: os.h:63
u8
unsigned char u8
Definition: types.h:56