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

Go to the source code of this file.

Enumerations

enum  {
  DIM_SRC_ADDR = 0, DIM_DST_ADDR, DIM_SRC_PORT, DIM_DST_PORT,
  DIM_PROTO
}
 

Functions

static applied_hash_ace_entry_t ** get_applied_hash_aces (acl_main_t *am, u32 lc_index)
 
static void hashtable_add_del (acl_main_t *am, clib_bihash_kv_48_8_t *kv, int is_add)
 
static int count_bits (u64 word)
 
static u8 first_mask_contains_second_mask (int is_ip6, fa_5tuple_t *mask1, fa_5tuple_t *mask2)
 
static u32 shift_ip4_if (u32 mask, u32 thresh, int numshifts, u32 else_val)
 
static void relax_ip4_addr (ip4_address_t *ip4_mask, int relax2)
 
static void relax_ip6_addr (ip6_address_t *ip6_mask, int relax2)
 
static void relax_tuple (fa_5tuple_t *mask, int is_ip6, int relax2)
 
static u32 find_mask_type_index (acl_main_t *am, fa_5tuple_t *mask)
 
static u32 assign_mask_type_index (acl_main_t *am, fa_5tuple_t *mask)
 
static void lock_mask_type_index (acl_main_t *am, u32 mask_type_index)
 
static void release_mask_type_index (acl_main_t *am, u32 mask_type_index)
 
static u32 tm_assign_mask_type_index (acl_main_t *am, fa_5tuple_t *mask, int is_ip6, u32 lc_index)
 
static void fill_applied_hash_ace_kv (acl_main_t *am, applied_hash_ace_entry_t **applied_hash_aces, u32 lc_index, u32 new_index, clib_bihash_kv_48_8_t *kv)
 
static void add_del_hashtable_entry (acl_main_t *am, u32 lc_index, applied_hash_ace_entry_t **applied_hash_aces, u32 index, int is_add)
 
static void remake_hash_applied_mask_info_vec (acl_main_t *am, applied_hash_ace_entry_t **applied_hash_aces, u32 lc_index)
 
static void vec_del_collision_rule (collision_match_rule_t **pvec, u32 applied_entry_index)
 
static void acl_plugin_print_pae (vlib_main_t *vm, int j, applied_hash_ace_entry_t *pae)
 
static void del_colliding_rule (applied_hash_ace_entry_t **applied_hash_aces, u32 head_index, u32 applied_entry_index)
 
static void add_colliding_rule (acl_main_t *am, applied_hash_ace_entry_t **applied_hash_aces, u32 head_index, u32 applied_entry_index)
 
static u32 activate_applied_ace_hash_entry (acl_main_t *am, u32 lc_index, applied_hash_ace_entry_t **applied_hash_aces, u32 new_index)
 
static void assign_mask_type_index_to_pae (acl_main_t *am, u32 lc_index, int is_ip6, applied_hash_ace_entry_t *pae)
 
static void split_partition (acl_main_t *am, u32 first_index, u32 lc_index, int is_ip6)
 
static void check_collision_count_and_maybe_split (acl_main_t *am, u32 lc_index, int is_ip6, u32 first_index)
 
void hash_acl_apply (acl_main_t *am, u32 lc_index, int acl_index, u32 acl_position)
 
static u32 find_head_applied_ace_index (applied_hash_ace_entry_t **applied_hash_aces, u32 curr_index)
 
static void set_collision_head_ae_index (applied_hash_ace_entry_t **applied_hash_aces, collision_match_rule_t *colliding_rules, u32 new_index)
 
static void move_applied_ace_hash_entry (acl_main_t *am, u32 lc_index, applied_hash_ace_entry_t **applied_hash_aces, u32 old_index, u32 new_index)
 
static void deactivate_applied_ace_hash_entry (acl_main_t *am, u32 lc_index, applied_hash_ace_entry_t **applied_hash_aces, u32 old_index)
 
void hash_acl_unapply (acl_main_t *am, u32 lc_index, int acl_index)
 
void hash_acl_reapply (acl_main_t *am, u32 lc_index, int acl_index)
 
static void make_ip6_address_mask (ip6_address_t *addr, u8 prefix_len)
 
static void ip4_address_mask_from_width (ip4_address_t *a, u32 width)
 
static void make_ip4_address_mask (ip4_address_t *addr, u8 prefix_len)
 
static void make_port_mask (u16 *portmask, u16 port_first, u16 port_last)
 
static void make_mask_and_match_from_rule (fa_5tuple_t *mask, acl_rule_t *r, hash_ace_info_t *hi)
 
int hash_acl_exists (acl_main_t *am, int acl_index)
 
void hash_acl_add (acl_main_t *am, int acl_index)
 
void hash_acl_delete (acl_main_t *am, int acl_index)
 
void show_hash_acl_hash (vlib_main_t *vm, acl_main_t *am, u32 verbose)
 
void acl_plugin_show_tables_mask_type (void)
 
void acl_plugin_show_tables_acl_hash_info (u32 acl_index)
 
static void acl_plugin_print_colliding_rule (vlib_main_t *vm, int j, collision_match_rule_t *cr)
 
static void acl_plugin_print_applied_mask_info (vlib_main_t *vm, int j, hash_applied_mask_info_t *mi)
 
void acl_plugin_show_tables_applied_info (u32 lc_index)
 
void acl_plugin_show_tables_bihash (u32 show_bihash_verbose)
 
static void ensure_ip6_min_addr (ip6_address_t *min_addr, ip6_address_t *mask_addr)
 
static void ensure_ip6_max_addr (ip6_address_t *max_addr, ip6_address_t *mask_addr)
 
static void ensure_ip4_min_addr (ip4_address_t *min_addr, ip4_address_t *mask_addr)
 
static void ensure_ip4_max_addr (ip4_address_t *max_addr, ip4_address_t *mask_addr)
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
DIM_SRC_ADDR 
DIM_DST_ADDR 
DIM_SRC_PORT 
DIM_DST_PORT 
DIM_PROTO 

Definition at line 1365 of file hash_lookup.c.

Function Documentation

◆ acl_plugin_print_applied_mask_info()

static void acl_plugin_print_applied_mask_info ( vlib_main_t vm,
int  j,
hash_applied_mask_info_t mi 
)
static

Definition at line 1225 of file hash_lookup.c.

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

◆ acl_plugin_print_colliding_rule()

static void acl_plugin_print_colliding_rule ( vlib_main_t vm,
int  j,
collision_match_rule_t cr 
)
static

Definition at line 1205 of file hash_lookup.c.

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

◆ acl_plugin_print_pae()

static void acl_plugin_print_pae ( vlib_main_t vm,
int  j,
applied_hash_ace_entry_t pae 
)
static

Definition at line 1212 of file hash_lookup.c.

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

◆ acl_plugin_show_tables_acl_hash_info()

void acl_plugin_show_tables_acl_hash_info ( u32  acl_index)

Definition at line 1174 of file hash_lookup.c.

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

◆ acl_plugin_show_tables_applied_info()

void acl_plugin_show_tables_applied_info ( u32  lc_index)

Definition at line 1233 of file hash_lookup.c.

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

◆ acl_plugin_show_tables_bihash()

void acl_plugin_show_tables_bihash ( u32  show_bihash_verbose)

Definition at line 1283 of file hash_lookup.c.

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

◆ acl_plugin_show_tables_mask_type()

void acl_plugin_show_tables_mask_type ( void  )

Definition at line 1155 of file hash_lookup.c.

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

◆ activate_applied_ace_hash_entry()

static u32 activate_applied_ace_hash_entry ( acl_main_t am,
u32  lc_index,
applied_hash_ace_entry_t **  applied_hash_aces,
u32  new_index 
)
static

Definition at line 550 of file hash_lookup.c.

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

◆ add_colliding_rule()

static void add_colliding_rule ( acl_main_t am,
applied_hash_ace_entry_t **  applied_hash_aces,
u32  head_index,
u32  applied_entry_index 
)
static

Definition at line 524 of file hash_lookup.c.

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

◆ add_del_hashtable_entry()

static void add_del_hashtable_entry ( acl_main_t am,
u32  lc_index,
applied_hash_ace_entry_t **  applied_hash_aces,
u32  index,
int  is_add 
)
static

Definition at line 411 of file hash_lookup.c.

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

◆ assign_mask_type_index()

static u32 assign_mask_type_index ( acl_main_t am,
fa_5tuple_t mask 
)
static

Definition at line 275 of file hash_lookup.c.

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

◆ assign_mask_type_index_to_pae()

static void assign_mask_type_index_to_pae ( acl_main_t am,
u32  lc_index,
int  is_ip6,
applied_hash_ace_entry_t pae 
)
static

Definition at line 589 of file hash_lookup.c.

+ Here is the call graph for this function:

◆ check_collision_count_and_maybe_split()

static void check_collision_count_and_maybe_split ( acl_main_t am,
u32  lc_index,
int  is_ip6,
u32  first_index 
)
static

Definition at line 614 of file hash_lookup.c.

+ Here is the call graph for this function:

◆ count_bits()

static int count_bits ( u64  word)
static

Definition at line 70 of file hash_lookup.c.

+ Here is the caller graph for this function:

◆ deactivate_applied_ace_hash_entry()

static void deactivate_applied_ace_hash_entry ( acl_main_t am,
u32  lc_index,
applied_hash_ace_entry_t **  applied_hash_aces,
u32  old_index 
)
static

Definition at line 793 of file hash_lookup.c.

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

◆ del_colliding_rule()

static void del_colliding_rule ( applied_hash_ace_entry_t **  applied_hash_aces,
u32  head_index,
u32  applied_entry_index 
)
static

Definition at line 505 of file hash_lookup.c.

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

◆ ensure_ip4_max_addr()

static void ensure_ip4_max_addr ( ip4_address_t max_addr,
ip4_address_t mask_addr 
)
static

Definition at line 1356 of file hash_lookup.c.

+ Here is the caller graph for this function:

◆ ensure_ip4_min_addr()

static void ensure_ip4_min_addr ( ip4_address_t min_addr,
ip4_address_t mask_addr 
)
static

Definition at line 1346 of file hash_lookup.c.

+ Here is the caller graph for this function:

◆ ensure_ip6_max_addr()

static void ensure_ip6_max_addr ( ip6_address_t *  max_addr,
ip6_address_t *  mask_addr 
)
static

Definition at line 1328 of file hash_lookup.c.

+ Here is the caller graph for this function:

◆ ensure_ip6_min_addr()

static void ensure_ip6_min_addr ( ip6_address_t *  min_addr,
ip6_address_t *  mask_addr 
)
static

Definition at line 1310 of file hash_lookup.c.

+ Here is the caller graph for this function:

◆ fill_applied_hash_ace_kv()

static void fill_applied_hash_ace_kv ( acl_main_t am,
applied_hash_ace_entry_t **  applied_hash_aces,
u32  lc_index,
u32  new_index,
clib_bihash_kv_48_8_t kv 
)
static

Definition at line 379 of file hash_lookup.c.

+ Here is the caller graph for this function:

◆ find_head_applied_ace_index()

static u32 find_head_applied_ace_index ( applied_hash_ace_entry_t **  applied_hash_aces,
u32  curr_index 
)
static

Definition at line 718 of file hash_lookup.c.

+ Here is the caller graph for this function:

◆ find_mask_type_index()

static u32 find_mask_type_index ( acl_main_t am,
fa_5tuple_t mask 
)
static

Definition at line 261 of file hash_lookup.c.

+ Here is the caller graph for this function:

◆ first_mask_contains_second_mask()

static u8 first_mask_contains_second_mask ( int  is_ip6,
fa_5tuple_t mask1,
fa_5tuple_t mask2 
)
static

Definition at line 83 of file hash_lookup.c.

+ Here is the caller graph for this function:

◆ get_applied_hash_aces()

static applied_hash_ace_entry_t** get_applied_hash_aces ( acl_main_t am,
u32  lc_index 
)
inlinestatic

Definition at line 35 of file hash_lookup.c.

+ Here is the caller graph for this function:

◆ hash_acl_add()

void hash_acl_add ( acl_main_t am,
int  acl_index 
)

Definition at line 1062 of file hash_lookup.c.

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

◆ hash_acl_apply()

void hash_acl_apply ( acl_main_t am,
u32  lc_index,
int  acl_index,
u32  acl_position 
)

Definition at line 624 of file hash_lookup.c.

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

◆ hash_acl_delete()

void hash_acl_delete ( acl_main_t am,
int  acl_index 
)

Definition at line 1108 of file hash_lookup.c.

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

◆ hash_acl_exists()

int hash_acl_exists ( acl_main_t am,
int  acl_index 
)

Definition at line 1053 of file hash_lookup.c.

+ Here is the caller graph for this function:

◆ hash_acl_reapply()

void hash_acl_reapply ( acl_main_t am,
u32  lc_index,
int  acl_index 
)

Definition at line 925 of file hash_lookup.c.

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

◆ hash_acl_unapply()

void hash_acl_unapply ( acl_main_t am,
u32  lc_index,
int  acl_index 
)

Definition at line 841 of file hash_lookup.c.

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

◆ hashtable_add_del()

static void hashtable_add_del ( acl_main_t am,
clib_bihash_kv_48_8_t kv,
int  is_add 
)
static

Definition at line 47 of file hash_lookup.c.

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

◆ ip4_address_mask_from_width()

static void ip4_address_mask_from_width ( ip4_address_t a,
u32  width 
)
inlinestatic

Definition at line 957 of file hash_lookup.c.

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

◆ lock_mask_type_index()

static void lock_mask_type_index ( acl_main_t am,
u32  mask_type_index 
)
static

Definition at line 299 of file hash_lookup.c.

+ Here is the caller graph for this function:

◆ make_ip4_address_mask()

static void make_ip4_address_mask ( ip4_address_t addr,
u8  prefix_len 
)
static

Definition at line 973 of file hash_lookup.c.

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

◆ make_ip6_address_mask()

static void make_ip6_address_mask ( ip6_address_t *  addr,
u8  prefix_len 
)
static

Definition at line 949 of file hash_lookup.c.

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

◆ make_mask_and_match_from_rule()

static void make_mask_and_match_from_rule ( fa_5tuple_t mask,
acl_rule_t r,
hash_ace_info_t hi 
)
static

Definition at line 992 of file hash_lookup.c.

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

◆ make_port_mask()

static void make_port_mask ( u16 portmask,
u16  port_first,
u16  port_last 
)
static

Definition at line 979 of file hash_lookup.c.

+ Here is the caller graph for this function:

◆ move_applied_ace_hash_entry()

static void move_applied_ace_hash_entry ( acl_main_t am,
u32  lc_index,
applied_hash_ace_entry_t **  applied_hash_aces,
u32  old_index,
u32  new_index 
)
static

Definition at line 738 of file hash_lookup.c.

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

◆ relax_ip4_addr()

static void relax_ip4_addr ( ip4_address_t ip4_mask,
int  relax2 
)
static

Definition at line 173 of file hash_lookup.c.

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

◆ relax_ip6_addr()

static void relax_ip6_addr ( ip6_address_t *  ip6_mask,
int  relax2 
)
static

Definition at line 186 of file hash_lookup.c.

+ Here is the caller graph for this function:

◆ relax_tuple()

static void relax_tuple ( fa_5tuple_t mask,
int  is_ip6,
int  relax2 
)
static

Definition at line 204 of file hash_lookup.c.

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

◆ release_mask_type_index()

static void release_mask_type_index ( acl_main_t am,
u32  mask_type_index 
)
static

Definition at line 309 of file hash_lookup.c.

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

◆ remake_hash_applied_mask_info_vec()

static void remake_hash_applied_mask_info_vec ( acl_main_t am,
applied_hash_ace_entry_t **  applied_hash_aces,
u32  lc_index 
)
static

Definition at line 424 of file hash_lookup.c.

◆ set_collision_head_ae_index()

static void set_collision_head_ae_index ( applied_hash_ace_entry_t **  applied_hash_aces,
collision_match_rule_t colliding_rules,
u32  new_index 
)
static

Definition at line 728 of file hash_lookup.c.

+ Here is the caller graph for this function:

◆ shift_ip4_if()

static u32 shift_ip4_if ( u32  mask,
u32  thresh,
int  numshifts,
u32  else_val 
)
static

Definition at line 164 of file hash_lookup.c.

+ Here is the caller graph for this function:

◆ show_hash_acl_hash()

void show_hash_acl_hash ( vlib_main_t vm,
acl_main_t am,
u32  verbose 
)

Definition at line 1148 of file hash_lookup.c.

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

◆ split_partition()

static void split_partition ( acl_main_t am,
u32  first_index,
u32  lc_index,
int  is_ip6 
)
static

Definition at line 1376 of file hash_lookup.c.

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

◆ tm_assign_mask_type_index()

static u32 tm_assign_mask_type_index ( acl_main_t am,
fa_5tuple_t mask,
int  is_ip6,
u32  lc_index 
)
static

Definition at line 324 of file hash_lookup.c.

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

◆ vec_del_collision_rule()

static void vec_del_collision_rule ( collision_match_rule_t **  pvec,
u32  applied_entry_index 
)
static

Definition at line 478 of file hash_lookup.c.

+ Here is the caller graph for this function: