|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
15 #ifndef __included_vnet_classify_h__
16 #define __included_vnet_classify_h__
30 #define CLASSIFY_TRACE 0
60 struct _vnet_classify_main;
63 #define foreach_size_in_u32x4 \
70 typedef struct _vnet_classify_entry
87 struct _vnet_classify_entry *next_free;
94 #define VNET_CLASSIFY_ENTRY_FREE (1<<0)
126 vnet_classify_entry_t e; \
128 } __clib_packed vnet_classify_entry_##size##_t;
212 #define VNET_CLASSIFY_VECTOR_SIZE \
213 sizeof (((vnet_classify_table_t *) 0)->mask[0])
215 struct _vnet_classify_main
228 u32 *classify_table_index_by_sw_if_index;
257 #if defined(CLIB_HAVE_VEC128)
259 u64x2u *
data = (u64x2u *)
h;
283 xor_sum = xor_sum_x2[0] ^ xor_sum_x2[1];
312 #ifdef clib_crc32c_uses_intrinsics
313 return clib_crc32c ((
u8 *) & xor_sum,
sizeof (xor_sum));
315 return clib_xxhash (xor_sum.as_u64[0] ^ xor_sum.as_u64[1]);
326 bucket_index = hash & (t->
nbuckets - 1);
349 ASSERT ((vp - hp) < 0x100000000ULL);
375 bucket_index = hash & (t->
nbuckets - 1);
385 value_index = hash & ((1 <<
b->log2_pages) - 1);
399 #ifdef CLIB_HAVE_VEC128
406 switch (match_n_vectors)
426 if (u64x2_is_all_zero (
r))
436 switch (match_n_vectors)
473 bucket_index = hash & (t->
nbuckets - 1);
479 pages = 1 <<
b->log2_pages;
495 for (
i = 0;
i < limit;
i++)
515 u32 match_n_vectors);
518 const u8 *match,
u32 hit_next_index,
520 u16 metadata,
int is_add);
524 u32 match,
u32 next_table_index,
525 u32 miss_next_index,
u32 *table_index,
526 u8 current_data_flag,
i16 current_data_offset,
527 int is_add,
int del_chain);
529 u32 table_index,
int del_chain);
@ CLASSIFY_FLAG_USE_CURR_DATA
static u64 vnet_classify_hash_packet_inline(vnet_classify_table_t *t, const u8 *h)
unformat_function_t unformat_l3_match
unformat_function_t unformat_l3_mask
struct _vnet_classify_entry vnet_classify_entry_t
unformat_function_t unformat_l2_next_index
vnet_classify_bucket_t saved_bucket
vlib_node_registration_t ip4_classify_node
(constructor) VLIB_REGISTER_NODE (ip4_classify_node)
vlib_node_registration_t ip6_classify_node
(constructor) VLIB_REGISTER_NODE (ip6_classify_node)
static_always_inline vnet_classify_table_t * vnet_classify_table_get(u32 table_index)
static int vnet_classify_entry_is_free(vnet_classify_entry_t *e)
void * clib_mem_get_heap_base(clib_mem_heap_t *heap)
nat44_ei_hairpin_src_next_t next_index
int vnet_classify_add_del_session(vnet_classify_main_t *cm, u32 table_index, const u8 *match, u32 hit_next_index, u32 opaque_index, i32 advance, u8 action, u16 metadata, int is_add)
void classify_set_pcap_chain(vnet_classify_main_t *cm, u32 sw_if_index, u32 table_index)
vnet_classify_main_t vnet_classify_main
unformat_function_t unformat_ip_next_index
void vnet_classify_delete_table_index(vnet_classify_main_t *cm, u32 table_index, int del_chain)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
#define CLIB_CACHE_LINE_ALIGN_MARK(mark)
unformat_function_t unformat_ip4_match
u32 classify_sort_table_chain(vnet_classify_main_t *cm, u32 table_index)
u32 classify_get_trace_chain(void)
vnet_classify_entry_t * vnet_classify_find_entry(vnet_classify_table_t *t, u8 *h, u64 hash, f64 now)
unformat_function_t unformat_l4_match
static vnet_classify_entry_t * vnet_classify_entry_at_index(vnet_classify_table_t *t, vnet_classify_entry_t *e, u32 index)
static vnet_classify_entry_t * vnet_classify_get_entry(vnet_classify_table_t *t, uword offset)
unformat_function_t unformat_l2_match
epu8_epi32 epu16_epi32 u64x2
static_always_inline int vnet_classify_entry_is_equal(vnet_classify_entry_t *v, const u8 *d, u8 *m, u32 match_n_vectors)
void vnet_classify_register_unformat_l2_next_index_fn(unformat_function_t *fn)
vnet_hw_if_output_node_runtime_t * r
unformat_function_t unformat_classify_match
unformat_function_t unformat_l2_mask
unformat_function_t unformat_ip6_mask
void vnet_classify_register_unformat_acl_next_index_fn(unformat_function_t *fn)
unformat_function_t unformat_ip4_mask
static int vnet_classify_entry_is_busy(vnet_classify_entry_t *e)
int * working_copy_lengths
struct clib_bihash_value offset
template key/value backing page structure
enum vnet_classify_action_t_ vnet_classify_action_t
STATIC_ASSERT_OFFSET_OF(vnet_classify_entry_t, key, 32)
Check there's no padding in the entry.
#define static_always_inline
vnet_classify_entry_t ** freelists
static void vnet_classify_prefetch_entry(vnet_classify_table_t *t, u64 hash)
enum vnet_classify_flags_t_ vnet_classify_flags_t
static void vnet_classify_prefetch_bucket(vnet_classify_table_t *t, u64 hash)
void vnet_classify_register_unformat_ip_next_index_fn(unformat_function_t *fn)
vnet_classify_bucket_t * buckets
#define VNET_CLASSIFY_ENTRY_FREE
vnet_feature_config_main_t * cm
vnet_classify_entry_t ** working_copies
static u64 clib_xxhash(u64 key)
@ CLASSIFY_ACTION_SET_METADATA
#define CLIB_CACHE_LINE_BYTES
struct _vlib_node_registration vlib_node_registration_t
@ CLASSIFY_ACTION_SET_IP6_FIB_INDEX
unformat_function_t unformat_classify_mask
u32 classify_lookup_chain(u32 table_index, u8 *mask, u32 n_skip, u32 n_match)
void vnet_classify_register_unformat_opaque_index_fn(unformat_function_t *fn)
template key/value backing page structure
vnet_classify_table_t * vnet_classify_new_table(vnet_classify_main_t *cm, const u8 *mask, u32 nbuckets, u32 memory_size, u32 skip_n_vectors, u32 match_n_vectors)
u8 * format_vnet_classify_table(u8 *s, va_list *args)
static_always_inline void clib_prefetch_load(void *p)
struct _vnet_classify_main vnet_classify_main_t
static vnet_classify_entry_t * vnet_classify_find_entry_inline(vnet_classify_table_t *t, const u8 *h, u64 hash, f64 now)
@ CLASSIFY_ACTION_SET_IP4_FIB_INDEX
unformat_function_t unformat_vlan_tag
u64 vnet_classify_hash_packet(vnet_classify_table_t *t, u8 *h)
static uword vnet_classify_get_offset(vnet_classify_table_t *t, vnet_classify_entry_t *v)
clib_spinlock_t writer_lock
int vnet_classify_add_del_table(vnet_classify_main_t *cm, const u8 *mask, u32 nbuckets, u32 memory_size, u32 skip, u32 match, u32 next_table_index, u32 miss_next_index, u32 *table_index, u8 current_data_flag, i16 current_data_offset, int is_add, int del_chain)
u8 pad[3]
log2 (size of the packing page block)
void vnet_classify_register_unformat_policer_next_index_fn(unformat_function_t *fn)
int vlib_main(vlib_main_t *volatile vm, unformat_input_t *input)
vnet_classify_flags_t current_data_flag
#define foreach_size_in_u32x4
static uword is_pow2(uword x)
vl_api_mac_event_action_t action
vl_api_interface_index_t sw_if_index
unformat_function_t unformat_ip6_match
u8 * format_classify_table(u8 *s, va_list *args)
u32 classify_get_pcap_chain(vnet_classify_main_t *cm, u32 sw_if_index)
void classify_set_trace_chain(vnet_classify_main_t *cm, u32 table_index)
vl_api_wireguard_peer_flags_t flags