vppinfra: fix minor cuckoo bugs and add cuckoo_16_8
[vpp.git] / src / vppinfra / cuckoo_template.h
index b53a089..06c4afd 100644 (file)
@@ -35,7 +35,6 @@
 #include <vppinfra/error.h>
 #include <vppinfra/hash.h>
 #include <vppinfra/cache.h>
-#include <vppinfra/cuckoo_8_8.h>
 
 #ifndef CLIB_CUCKOO_TYPE
 #error CLIB_CUCKOO_TYPE not defined
@@ -154,6 +153,8 @@ typedef struct
 
 typedef struct
 {
+  CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
+
   /** reduced hashes corresponding to elements */
   u8 reduced_hashes[CLIB_CUCKOO_KVP_PER_BUCKET];
 
@@ -289,7 +290,7 @@ typedef struct CV (clib_cuckoo)
 } CVT (clib_cuckoo);
 
 void CV (clib_cuckoo_init) (CVT (clib_cuckoo) * h, const char *name,
-                           u64 nbuckets,
+                           uword nbuckets,
                            void (*garbage_callback) (CVT (clib_cuckoo) *,
                                                      void *),
                            void *garbage_ctx);
@@ -299,7 +300,8 @@ void CV (clib_cuckoo_garbage_collect) (CVT (clib_cuckoo) * h);
 void CV (clib_cuckoo_free) (CVT (clib_cuckoo) * h);
 
 int CV (clib_cuckoo_add_del) (CVT (clib_cuckoo) * h,
-                             CVT (clib_cuckoo_kv) * add_v, int is_add);
+                             CVT (clib_cuckoo_kv) * add_v, int is_add,
+                             int dont_overwrite);
 int CV (clib_cuckoo_search) (CVT (clib_cuckoo) * h,
                             CVT (clib_cuckoo_kv) * search_v,
                             CVT (clib_cuckoo_kv) * return_v);