X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Flisp-cp%2Fgid_dictionary.h;h=3f8500e56a750a4eeca1e0b60f6859ae29f1dbb0;hb=7bee773e71b81a1e13a656030b0f7edae99c5e92;hp=825e9856e7ae775a5f4290341b66abdcd83f4c39;hpb=f3fe820fd840173df2571a49c929a7f193b68508;p=vpp.git diff --git a/src/vnet/lisp-cp/gid_dictionary.h b/src/vnet/lisp-cp/gid_dictionary.h index 825e9856e7a..3f8500e56a7 100644 --- a/src/vnet/lisp-cp/gid_dictionary.h +++ b/src/vnet/lisp-cp/gid_dictionary.h @@ -22,6 +22,7 @@ #include #define GID_LOOKUP_MISS ((u32)~0) +#define GID_LOOKUP_MISS_L2 ((u64)~0) /* Default size of the ip4 hash table */ #define IP4_LOOKUP_DEFAULT_HASH_NUM_BUCKETS (64 * 1024) @@ -35,6 +36,14 @@ #define MAC_LOOKUP_DEFAULT_HASH_NUM_BUCKETS (64 * 1024) #define MAC_LOOKUP_DEFAULT_HASH_MEMORY_SIZE (32<<20) +/* Default size of the ARP/NDP hash table */ +#define ARP_NDP_LOOKUP_DEFAULT_HASH_NUM_BUCKETS (64 * 1024) +#define ARP_NDP_LOOKUP_DEFAULT_HASH_MEMORY_SIZE (32<<20) + +/* Default size of the NSH hash table */ +#define NSH_LOOKUP_DEFAULT_HASH_NUM_BUCKETS (64 * 1024) +#define NSH_LOOKUP_DEFAULT_HASH_MEMORY_SIZE (32<<20) + typedef void (*foreach_subprefix_match_cb_t) (u32, void *); typedef struct @@ -79,8 +88,32 @@ typedef struct gid_mac_table u64 count; } gid_mac_table_t; +typedef struct gid_nsh_table +{ + BVT (clib_bihash) nsh_lookup_table; + + /* nsh lookup table config parameters */ + u32 nsh_lookup_table_nbuckets; + uword nsh_lookup_table_size; + u64 count; +} gid_nsh_table_t; + +typedef struct +{ + BVT (clib_bihash) arp_ndp_lookup_table; + u32 arp_ndp_lookup_table_nbuckets; + uword arp_ndp_lookup_table_size; + u64 count; +} gid_l2_arp_ndp_table_t; + typedef struct { + /** L2 ARP/NDP table */ + gid_l2_arp_ndp_table_t arp_ndp_table; + + /** NSH lookup table */ + gid_nsh_table_t nsh_table; + /** destination IP LPM ip4 lookup table */ gid_ip4_table_t dst_ip4_table; @@ -99,10 +132,10 @@ typedef struct } gid_dictionary_t; u32 -gid_dictionary_add_del (gid_dictionary_t * db, gid_address_t * key, u32 value, +gid_dictionary_add_del (gid_dictionary_t * db, gid_address_t * key, u64 value, u8 is_add); -u32 gid_dictionary_lookup (gid_dictionary_t * db, gid_address_t * key); +u64 gid_dictionary_lookup (gid_dictionary_t * db, gid_address_t * key); u32 gid_dictionary_sd_lookup (gid_dictionary_t * db, gid_address_t * dst, gid_address_t * src); @@ -112,6 +145,11 @@ void gid_dict_foreach_subprefix (gid_dictionary_t * db, gid_address_t * eid, foreach_subprefix_match_cb_t cb, void *arg); +void +gid_dict_foreach_l2_arp_ndp_entry (gid_dictionary_t * db, void (*cb) + (BVT (clib_bihash_kv) * kvp, void *arg), + void *ht); + #endif /* VNET_LISP_GPE_GID_DICTIONARY_H_ */ /*