19 [ICMP4_echo_request] = ICMP4_echo_reply + 1,
20 [ICMP4_timestamp_request] = ICMP4_timestamp_reply + 1,
21 [ICMP4_information_request] = ICMP4_information_reply + 1,
22 [ICMP4_address_mask_request] = ICMP4_address_mask_reply + 1
27 [ICMP4_echo_request] = 1,
28 [ICMP4_timestamp_request] = 1,
29 [ICMP4_information_request] = 1,
30 [ICMP4_address_mask_request] = 1
35 [ICMP6_echo_request - 128] = ICMP6_echo_reply + 1,
36 [ICMP6_node_information_request - 128] = ICMP6_node_information_response + 1
41 [ICMP6_echo_request - 128] = 1,
42 [ICMP6_node_information_request - 128] = 1
175 #ifdef FA_NODE_VERBOSE_DEBUG 177 (
"FA-SESSION-DEBUG: add session id %d on thread %d sw_if_index %d",
201 #ifdef FA_NODE_VERBOSE_DEBUG 202 clib_warning (
"thread id in key %d != curr thread index, not deleting");
208 u64 next_expiry_time = ~0ULL;
213 (
"Attempting to delete session belonging to thread %d by thread %d",
286 && (old_flags != new_flags);
317 static const u8 *icmp_valid_new[] =
320 sizeof (icmp6_invmap)
323 sizeof (icmp6_valid_new)
338 int valid_reverse_sess = (type >= 0
339 && (type <= icmp_valid_new_size[
is_ip6])
340 && (icmp_valid_new[is_ip6][type])
341 && (type <= icmp_invmap_size[
is_ip6])
342 && icmp_invmap[is_ip6][type]);
343 if (valid_reverse_sess)
350 return valid_reverse_sess;
387 ((pkv->
key[0] & 0xffffffff) << 32) | ((pkv->
key[0] >> 32) & 0xffffffff);
433 (
"Attempting to delete session belonging to thread %d by thread %d",
486 && n_recycled < am->fa_max_deleted_sessions_per_interval)
517 u16 current_policy_epoch)
526 if (f_sess_id.
as_u64 == ~0)
528 clib_error (
"Adding session with invalid value");
591 res = (clib_bihash_search_inline_2_40_8
593 *pvalue_sess = kv_result.
value;
598 res = (clib_bihash_search_inline_2_16_8
600 *pvalue_sess = kv_result.
value;
643 kv_result.
value = ~0ULL;
644 res = (clib_bihash_search_inline_2_with_hash_40_8
647 *pvalue_sess = kv_result.
value;
652 kv_result.
value = ~0ULL;
653 res = (clib_bihash_search_inline_2_with_hash_16_8
656 *pvalue_sess = kv_result.
value;
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
u32 session_timeout_sec[ACL_N_TIMEOUTS]
uword * fa_out_acl_on_sw_if_index
#define FA_SESSION_BOGUS_INDEX
static const u8 icmp6_valid_new[]
static int acl_fa_conn_list_delete_session(acl_main_t *am, fa_full_session_id_t sess_id, u64 now)
clib_bihash_40_8_t fa_ip6_sessions_hash
#define SESSION_PURGATORY_TIMEOUT_USEC
uword * fa_in_acl_on_sw_if_index
#define clib_error(format, args...)
static void acl_fa_deactivate_session(acl_main_t *am, u32 sw_if_index, fa_full_session_id_t sess_id)
void aclp_post_session_change_request(acl_main_t *am, u32 target_thread, u32 target_session, acl_fa_sess_req_t request_type)
static void acl_fa_conn_list_add_session(acl_main_t *am, fa_full_session_id_t sess_id, u64 now)
#define TCP_FLAGS_RSTFINACKSYN
static int acl_fa_ifc_has_sessions(acl_main_t *am, int sw_if_index0)
static int reverse_l4_u64_slowpath_valid(u64 l4, int is_ip6, u64 *out)
static int acl_fa_two_stage_delete_session(acl_main_t *am, u32 sw_if_index, fa_full_session_id_t sess_id, u64 now)
static uword * clib_bitmap_set(uword *ai, uword i, uword value)
Sets the ith bit of a bitmap to new_value Removes trailing zeros from the bitmap. ...
fa_session_t * fa_sessions_pool
static void reverse_session_add_del_ip4(acl_main_t *am, clib_bihash_kv_16_8_t *pkv, int is_add)
vlib_main_t ** vlib_mains
#define pool_len(p)
Number of elements in pool vector.
static fa_session_t * get_session_ptr(acl_main_t *am, u16 thread_index, u32 session_index)
static int acl_fa_ifc_has_in_acl(acl_main_t *am, int sw_if_index0)
u64 fa_conn_table_max_entries
static u8 acl_fa_track_session(acl_main_t *am, int is_input, u32 sw_if_index, u64 now, fa_session_t *sess, fa_5tuple_t *pkt_5tuple, u32 pkt_len)
vl_api_fib_path_type_t type
static u64 acl_fa_make_session_hash(acl_main_t *am, int is_ip6, u32 sw_if_index0, fa_5tuple_t *p5tuple)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static void acl_fa_try_recycle_session(acl_main_t *am, int is_input, u16 thread_index, u32 sw_if_index, u64 now)
static int acl_fa_find_session_with_hash(acl_main_t *am, int is_ip6, u32 sw_if_index0, u64 hash, fa_5tuple_t *p5tuple, u64 *pvalue_sess)
static u64 clib_bihash_hash_40_8(const clib_bihash_kv_40_8_t *v)
static_always_inline int is_session_l4_key_u64_slowpath(u64 l4key)
u64 * fa_conn_list_head_expiry_time
u64 * fa_session_adds_by_sw_if_index
u64 * fa_session_dels_by_sw_if_index
#define pool_get_aligned(P, E, A)
Allocate an object E from a pool P with alignment A.
union fa_session_t::@16 tcp_flags_seen
static u64 fa_session_get_timeout(acl_main_t *am, fa_session_t *sess)
static u64 reverse_l4_u64_fastpath(u64 l4, int is_ip6)
u64 fa_session_total_adds
clib_bihash_kv_40_8_t kv_40_8
static fa_full_session_id_t acl_fa_add_session(acl_main_t *am, int is_input, int is_ip6, u32 sw_if_index, u64 now, fa_5tuple_t *p5tuple, u16 current_policy_epoch)
#define clib_warning(format, args...)
static uword clib_bitmap_get(uword *ai, uword i)
Gets the ith bit value from a bitmap.
static int acl_fa_restart_timer_for_session(acl_main_t *am, u64 now, fa_full_session_id_t sess_id)
static int acl_fa_find_session(acl_main_t *am, int is_ip6, u32 sw_if_index0, fa_5tuple_t *p5tuple, u64 *pvalue_sess)
static int fa_session_get_timeout_type(acl_main_t *am, fa_session_t *sess)
#define pool_put_index(p, i)
Free pool element with given index.
static const u8 icmp6_invmap[]
static void acl_fa_prefetch_session_bucket_for_hash(acl_main_t *am, int is_ip6, u64 hash)
static int acl_fa_can_add_session(acl_main_t *am, int is_input, u32 sw_if_index)
clib_bihash_kv_16_8_t kv_16_8
uword * serviced_sw_if_index_bitmap
#define clib_atomic_fetch_add(a, b)
static void reverse_session_add_del_ip6(acl_main_t *am, clib_bihash_kv_40_8_t *pkv, int is_add)
static fa_session_t * get_session_ptr_no_check(acl_main_t *am, u16 thread_index, u32 session_index)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
acl_fa_per_worker_data_t * per_worker_data
static_always_inline uword os_get_thread_index(void)
static const u8 icmp4_valid_new[]
static int is_valid_session_ptr(acl_main_t *am, u16 thread_index, fa_session_t *sess)
static int is_ip6_5tuple(fa_5tuple_t *p5t)
u64 fa_session_total_deactivations
static void acl_fa_put_session(acl_main_t *am, u32 sw_if_index, fa_full_session_id_t sess_id)
#define CLIB_CACHE_LINE_BYTES
static const u8 icmp4_invmap[]
clib_bihash_16_8_t fa_ip4_sessions_hash
static int acl_fa_ifc_has_out_acl(acl_main_t *am, int sw_if_index0)
static void acl_fa_prefetch_session_data_for_hash(acl_main_t *am, int is_ip6, u64 hash)
int fa_sessions_hash_is_initialized
static u64 clib_bihash_hash_16_8(clib_bihash_kv_16_8_t *v)
vl_api_interface_index_t sw_if_index
u64 fa_session_total_dels
foreach_fa_cleaner_counter vlib_main_t * vlib_main