|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
43 mask = &
a->ip4_table->ip4_fib_masks[plen];
52 (
a->cb) (kvp->value,
a->arg);
54 return (BIHASH_WALK_CONTINUE);
89 mask = &
a->ip6_table->ip6_fib_masks[plen];
90 ip.as_u64[0] = kvp->key[0];
91 ip.as_u64[1] = kvp->key[1];
96 (
a->cb) (kvp->value,
a->arg);
98 return (BIHASH_WALK_CONTINUE);
221 ASSERT (dst_address_length >= 0 && dst_address_length <= 32);
273 ASSERT (dst_address_length >= 0 && dst_address_length <= 128);
350 kv->key[2] = (
u64) 0;
364 kv->key[2] = (
u64)
si;
423 clib_warning (
"Source/Dest address type %d not supported!",
469 clib_warning (
"Source/Dest address type %d not supported!",
494 int dst_address_length = 32 -
i;
536 kv.key[0] = ((
u64)
vni << 32) |
key.as_u32;
540 if (BV (clib_bihash_search) (&db->ip4_lookup_table, &kv, &
value) == 0)
541 old_val =
value.value;
560 BVT (clib_bihash_init2_args) _a, *
a = &_a;
589 memset (
a, 0,
sizeof (*
a));
590 a->h = &db->ip4_lookup_table;
591 a->name =
"LISP ip4 lookup table";
594 a->dont_add_to_all_bihash_list = 1;
596 BV (clib_bihash_init2) (
a);
603 u32 sfi, old_val = ~0;
657 if (sfib->
count == 0)
677 int dst_address_length = 128 -
i;
717 kv.key[0] =
key.as_u64[0];
718 kv.key[1] =
key.as_u64[1];
722 if (BV (clib_bihash_search) (&db->ip6_lookup_table, &kv, &
value) == 0)
723 old_val =
value.value;
748 if (BV (clib_bihash_search) (&db->mac_lookup_table, &kv, &
value) == 0)
749 old_val =
value.value;
769 BVT (clib_bihash_init2_args) _a, *
a = &_a;
781 for (j = 0; j < i0; j++)
786 clib_host_to_net_u32 (
pow2_mask (i1) << (32 - i1));
802 memset (
a, 0,
sizeof (*
a));
803 a->h = &db->ip6_lookup_table;
804 a->name =
"LISP ip6 lookup table";
807 a->dont_add_to_all_bihash_list = 1;
809 BV (clib_bihash_init2) (
a);
816 u32 sfi, old_val = ~0;
873 if (sfib->
count == 0)
929 BVT (clib_bihash_kv) kv, result;
933 if (BV (clib_bihash_search) (&db->arp_ndp_lookup_table, &kv, &result) == 0)
934 old_val = result.value;
956 BVT (clib_bihash_kv) kv, result;
960 if (BV (clib_bihash_search) (&db->nsh_lookup_table, &kv, &result) == 0)
961 old_val = result.value;
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
static u32 add_del_nsh(gid_nsh_table_t *db, u32 vni, u32 spi, u8 si, u32 value, u8 is_add)
#define MAC_LOOKUP_DEFAULT_HASH_NUM_BUCKETS
static u32 ip6_lookup(gid_ip6_table_t *db, u32 vni, ip_prefix_t *key)
#define IP4_LOOKUP_DEFAULT_HASH_NUM_BUCKETS
uword ip4_lookup_table_size
#define gid_address_arp_ndp_bd(_a)
#define clib_memcpy(d, s, n)
static void nsh_lookup_init(gid_nsh_table_t *db)
vl_api_mac_address_t src_mac
static u32 ip_sd_lookup(gid_dictionary_t *db, u32 vni, ip_prefix_t *dst, ip_prefix_t *src)
#define gid_address_sd_src_mac(_a)
static uword pow2_mask(uword x)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
u32 ip4_prefix_len_refcount[33]
u32 mac_lookup_table_nbuckets
#define gid_address_sd_dst_mac(_a)
#define gid_address_sd_dst_ippref(_a)
#define gid_address_ippref(_a)
static u32 add_del_sd(gid_dictionary_t *db, u32 vni, source_dest_t *key, u32 value, u8 is_add)
#define sd_src_ippref(_a)
#define gid_address_sd_dst_type(_a)
#define ip_prefix_len(_a)
static void gid_dict_foreach_ip4_subprefix(gid_dictionary_t *db, u32 vni, ip_prefix_t *src, ip_prefix_t *dst, foreach_subprefix_match_cb_t cb, void *arg)
gid_ip4_table_t * src_ip4_table_pool
pool of source IP LPM ip4 lookup tables
u32 nsh_lookup_table_nbuckets
static void ip6_lookup_init(gid_ip6_table_t *db)
u32 ip4_lookup_table_nbuckets
#define gid_address_sd_src_ippref(_a)
static void ip4_lookup_init(gid_ip4_table_t *db)
gid_ip6_table_t dst_ip6_table
destination IP LPM ip6 lookup table
#define GID_LOOKUP_MISS_L2
static u32 ip4_lookup_exact_match(gid_ip4_table_t *db, u32 vni, ip_prefix_t *key)
static int foreach_sfib6_subprefix(BVT(clib_bihash_kv) *kvp, void *arg)
int clib_bihash_search_inline_2(clib_bihash *h, clib_bihash_kv *search_key, clib_bihash_kv *valuep)
Search a bi-hash table.
static void arp_ndp_lookup_init(gid_l2_arp_ndp_table_t *db)
static uword max_log2(uword x)
void(* foreach_subprefix_match_cb_t)(u32, void *)
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
uword * ip6_non_empty_dst_address_length_bitmap
static u32 add_del_ip6_key(gid_ip6_table_t *db, u32 vni, ip_prefix_t *pref, u32 val, u8 is_add)
#define IP6_LOOKUP_DEFAULT_HASH_MEMORY_SIZE
static int foreach_sfib4_subprefix(BVT(clib_bihash_kv) *kvp, void *arg)
#define ip_addr_version(_a)
static uword ip6_address_is_equal_masked(const ip6_address_t *a, const ip6_address_t *b, const ip6_address_t *mask)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
void clib_bihash_init(clib_bihash *h, char *name, u32 nbuckets, uword memory_size)
initialize a bounded index extensible hash table
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
gid_ip6_table_t * ip6_table
ip6_address_t ip6_fib_masks[129]
static u32 ip6_lookup_exact_match(gid_ip6_table_t *db, u32 vni, ip_prefix_t *key)
#define sd_dst_ippref(_a)
static void ip4_compute_prefix_lengths_in_search_order(gid_ip4_table_t *db)
#define MAC_LOOKUP_DEFAULT_HASH_MEMORY_SIZE
void gid_dict_foreach_l2_arp_ndp_entry(gid_dictionary_t *db, cb, void *ht)
#define gid_address_vni(_a)
u64 ip6_prefix_len_refcount[129]
foreach_subprefix_match_cb_t cb
if(node->flags &VLIB_NODE_FLAG_TRACE) vnet_interface_output_trace(vm
static void make_nsh_key(BVT(clib_bihash_kv) *kv, u32 vni, u32 spi, u8 si)
BVT(clib_bihash)
The table of adjacencies indexed by the rewrite string.
u32 arp_ndp_lookup_table_nbuckets
static void make_arp_ndp_key(BVT(clib_bihash_kv) *kv, u32 bd, ip_address_t *addr)
sll srl srl sll sra u16x4 i
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
u8 * format_ip_prefix(u8 *s, va_list *args)
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.
static void make_mac_sd_key(BVT(clib_bihash_kv) *kv, u32 vni, u8 src_mac[6], u8 dst_mac[6])
static u32 add_del_sd_ip6_key(gid_dictionary_t *db, u32 vni, ip_prefix_t *dst_pref, ip_prefix_t *src_pref, u32 val, u8 is_add)
gid_nsh_table_t nsh_table
NSH lookup table.
static u32 mac_sd_lookup(gid_mac_table_t *db, u32 vni, u8 *dst, u8 *src)
u32 gid_dictionary_sd_lookup(gid_dictionary_t *db, gid_address_t *dst, gid_address_t *src)
static void ip6_address_mask(ip6_address_t *a, const ip6_address_t *mask)
#define gid_address_arp_ndp_ip(_a)
gid_ip4_table_t * ip4_table
#define ARP_NDP_LOOKUP_DEFAULT_HASH_NUM_BUCKETS
static void mac_lookup_init(gid_mac_table_t *db)
gid_ip6_table_t * src_ip6_table_pool
pool of source IP LPM ip6 lookup tables
u8 * ip4_prefix_lengths_in_search_order
uword mac_lookup_table_size
static void gid_dict_foreach_ip6_subprefix(gid_dictionary_t *db, u32 vni, ip_prefix_t *src, ip_prefix_t *dst, foreach_subprefix_match_cb_t cb, void *arg)
static u32 add_del_sd_ip4_key(gid_dictionary_t *db, u32 vni, ip_prefix_t *dst_pref, ip_prefix_t *src_pref, u32 val, u8 is_add)
static void ip6_compute_prefix_lengths_in_search_order(gid_ip6_table_t *db)
static u32 add_del_ip(gid_dictionary_t *db, u32 vni, ip_prefix_t *dst_key, ip_prefix_t *src_key, u32 value, u8 is_add)
#define gid_address_nsh_si(_a)
uword * ip4_non_empty_dst_address_length_bitmap
uword nsh_lookup_table_size
gid_l2_arp_ndp_table_t arp_ndp_table
L2 ARP/NDP table.
int clib_bihash_add_del(clib_bihash *h, clib_bihash_kv *add_v, int is_add)
Add or delete a (key,value) pair from a bi-hash table.
static u32 add_del_mac(gid_mac_table_t *db, u32 vni, u8 *dst_mac, u8 *src_mac, u32 val, u8 is_add)
void gid_dictionary_init(gid_dictionary_t *db)
static u64 arp_ndp_lookup(gid_l2_arp_ndp_table_t *db, u32 bd, ip_address_t *key)
static u64 mac_to_u64(u8 *m)
u32 ip6_lookup_table_nbuckets
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
uword ip6_lookup_table_size
#define ARP_NDP_LOOKUP_DEFAULT_HASH_MEMORY_SIZE
void clib_bihash_foreach_key_value_pair(clib_bihash *h, clib_bihash_foreach_key_value_pair_cb *callback, void *arg)
Visit active (key,value) pairs in a bi-hash table.
ip4_address_t ip4_fib_masks[33]
u64 gid_dictionary_lookup(gid_dictionary_t *db, gid_address_t *key)
#define gid_address_type(_a)
u32 gid_dictionary_add_del(gid_dictionary_t *db, gid_address_t *key, u64 value, u8 is_add)
#define ip_prefix_version(_a)
u8 * ip6_prefix_lengths_in_search_order
#define clib_warning(format, args...)
struct _gid_address_t gid_address_t
uword arp_ndp_lookup_table_size
int(* clib_bihash_foreach_key_value_pair_cb)(clib_bihash_kv *kv, void *ctx)
static u32 add_del_ip4_key(gid_ip4_table_t *db, u32 vni, ip_prefix_t *pref, u32 val, u8 is_add)
gid_mac_table_t sd_mac_table
flat source/dest mac lookup table
static u32 nsh_lookup(gid_nsh_table_t *db, u32 vni, u32 spi, u8 si)
#define clib_bitmap_foreach(i, ai)
Macro to iterate across set bits in a bitmap.
#define IP6_LOOKUP_DEFAULT_HASH_NUM_BUCKETS
#define IP4_LOOKUP_DEFAULT_HASH_MEMORY_SIZE
void gid_dict_foreach_subprefix(gid_dictionary_t *db, gid_address_t *eid, foreach_subprefix_match_cb_t cb, void *arg)
#define gid_address_nsh_spi(_a)
static u64 add_del_arp_ndp(gid_l2_arp_ndp_table_t *db, u32 bd, ip_address_t *key, u64 value, u8 is_add)
static u32 ip4_lookup(gid_ip4_table_t *db, u32 vni, ip_prefix_t *key)
#define gid_address_mac(_a)
#define gid_address_sd(_a)
gid_ip4_table_t dst_ip4_table
destination IP LPM ip4 lookup table