|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
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
53 return am->fa_sessions_hash_is_initialized;
104 u64 timeout = (
am->vlib_main->clib_time.clocks_per_second);
112 timeout *=
am->session_timeout_sec[timeout_type];
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[] =
338 int valid_reverse_sess = (
type >= 0
343 if (valid_reverse_sess)
350 return valid_reverse_sess;
372 clib_bihash_add_del_40_8 (&
am->fa_ip6_sessions_hash, &kv2, is_add);
377 clib_bihash_add_del_40_8 (&
am->fa_ip6_sessions_hash, &kv2, is_add);
387 ((pkv->
key[0] & 0xffffffff) << 32) | ((pkv->
key[0] >> 32) & 0xffffffff);
393 clib_bihash_add_del_16_8 (&
am->fa_ip4_sessions_hash, &kv2, is_add);
398 clib_bihash_add_del_16_8 (&
am->fa_ip4_sessions_hash, &kv2, is_add);
411 clib_bihash_add_del_40_8 (&
am->fa_ip6_sessions_hash,
417 clib_bihash_add_del_16_8 (&
am->fa_ip4_sessions_hash,
433 (
"Attempting to delete session belonging to thread %d by thread %d",
468 curr_sess_count =
am->fa_session_total_adds -
am->fa_session_total_dels;
470 am->fa_conn_table_max_entries);
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");
563 ASSERT (
am->fa_sessions_hash_is_initialized == 1);
567 clib_bihash_add_del_40_8 (&
am->fa_ip6_sessions_hash,
573 clib_bihash_add_del_16_8 (&
am->fa_ip4_sessions_hash,
591 res = (clib_bihash_search_inline_2_40_8
592 (&
am->fa_ip6_sessions_hash, &p5tuple->
kv_40_8, &kv_result) == 0);
593 *pvalue_sess = kv_result.
value;
598 res = (clib_bihash_search_inline_2_16_8
599 (&
am->fa_ip4_sessions_hash, &p5tuple->
kv_16_8, &kv_result) == 0);
600 *pvalue_sess = kv_result.
value;
620 clib_bihash_prefetch_bucket_40_8 (&
am->fa_ip6_sessions_hash, hash);
622 clib_bihash_prefetch_bucket_16_8 (&
am->fa_ip4_sessions_hash, hash);
629 clib_bihash_prefetch_data_40_8 (&
am->fa_ip6_sessions_hash, hash);
631 clib_bihash_prefetch_data_16_8 (&
am->fa_ip4_sessions_hash, hash);
643 kv_result.
value = ~0ULL;
644 res = (clib_bihash_search_inline_2_with_hash_40_8
645 (&
am->fa_ip6_sessions_hash, hash, &p5tuple->
kv_40_8,
647 *pvalue_sess = kv_result.
value;
652 kv_result.
value = ~0ULL;
653 res = (clib_bihash_search_inline_2_with_hash_16_8
654 (&
am->fa_ip4_sessions_hash, hash, &p5tuple->
kv_16_8,
656 *pvalue_sess = kv_result.
value;
static int acl_fa_can_add_session(acl_main_t *am, int is_input, u32 sw_if_index)
static int acl_fa_ifc_has_sessions(acl_main_t *am, int sw_if_index0)
static void acl_fa_prefetch_session_bucket_for_hash(acl_main_t *am, int is_ip6, u64 hash)
fa_session_t * fa_sessions_pool
static const u8 icmp6_valid_new[]
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 int is_ip6_5tuple(fa_5tuple_t *p5t)
static u64 fa_session_get_timeout(acl_main_t *am, fa_session_t *sess)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
#define pool_get_aligned(P, E, A)
Allocate an object E from a pool P with alignment A.
u64 * fa_conn_list_head_expiry_time
uword * serviced_sw_if_index_bitmap
static void acl_fa_try_recycle_session(acl_main_t *am, int is_input, u16 thread_index, u32 sw_if_index, u64 now)
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)
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 acl_fa_restart_timer_for_session(acl_main_t *am, u64 now, fa_full_session_id_t sess_id)
static void acl_fa_conn_list_add_session(acl_main_t *am, fa_full_session_id_t sess_id, u64 now)
#define pool_put_index(p, i)
Free pool element with given index.
static_always_inline int is_session_l4_key_u64_slowpath(u64 l4key)
clib_bihash_kv_16_8_t kv_16_8
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static uword clib_bitmap_get(uword *ai, uword i)
Gets the ith bit value from a bitmap.
static int acl_fa_ifc_has_in_acl(acl_main_t *am, int sw_if_index0)
static void reverse_session_add_del_ip6(acl_main_t *am, clib_bihash_kv_40_8_t *pkv, int is_add)
static const u8 icmp6_invmap[]
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)
void aclp_post_session_change_request(acl_main_t *am, u32 target_thread, u32 target_session, acl_fa_sess_req_t request_type)
static u64 reverse_l4_u64_fastpath(u64 l4, int is_ip6)
static fa_session_t * get_session_ptr_no_check(acl_main_t *am, u16 thread_index, u32 session_index)
static int is_valid_session_ptr(acl_main_t *am, u16 thread_index, fa_session_t *sess)
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
static u64 clib_bihash_hash_40_8(const clib_bihash_kv_40_8_t *v)
static void acl_fa_put_session(acl_main_t *am, u32 sw_if_index, fa_full_session_id_t sess_id)
#define FA_SESSION_BOGUS_INDEX
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.
#define CLIB_CACHE_LINE_BYTES
static_always_inline uword os_get_thread_index(void)
#define clib_atomic_fetch_add(a, b)
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)
union fa_session_t::@16 tcp_flags_seen
#define pool_len(p)
Number of elements in pool vector.
static void reverse_session_add_del_ip4(acl_main_t *am, clib_bihash_kv_16_8_t *pkv, int is_add)
static fa_session_t * get_session_ptr(acl_main_t *am, u16 thread_index, u32 session_index)
static int acl_fa_conn_list_delete_session(acl_main_t *am, fa_full_session_id_t sess_id, u64 now)
static void acl_fa_deactivate_session(acl_main_t *am, u32 sw_if_index, fa_full_session_id_t sess_id)
@ ACL_FA_REQ_SESS_RESCHEDULE
static const u8 icmp4_invmap[]
#define TCP_FLAGS_RSTFINACKSYN
#define SESSION_PURGATORY_TIMEOUT_USEC
static const u8 icmp4_valid_new[]
static u32 vlib_get_n_threads()
#define clib_error(format, args...)
#define clib_warning(format, args...)
static int acl_fa_ifc_has_out_acl(acl_main_t *am, int sw_if_index0)
u64 * fa_session_adds_by_sw_if_index
@ ACL_TIMEOUT_TCP_TRANSIENT
clib_bihash_kv_40_8_t kv_40_8
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_dels_by_sw_if_index
static void acl_fa_prefetch_session_data_for_hash(acl_main_t *am, int is_ip6, u64 hash)
vl_api_fib_path_type_t type
static int fa_session_get_timeout_type(acl_main_t *am, fa_session_t *sess)
static int reverse_l4_u64_slowpath_valid(u64 l4, int is_ip6, u64 *out)
static u64 acl_fa_make_session_hash(acl_main_t *am, int is_ip6, u32 sw_if_index0, fa_5tuple_t *p5tuple)