aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-plugin/src/hashtb.h
diff options
context:
space:
mode:
Diffstat (limited to 'hicn-plugin/src/hashtb.h')
-rw-r--r--hicn-plugin/src/hashtb.h19
1 files changed, 11 insertions, 8 deletions
diff --git a/hicn-plugin/src/hashtb.h b/hicn-plugin/src/hashtb.h
index b74e972b2..756f247b7 100644
--- a/hicn-plugin/src/hashtb.h
+++ b/hicn-plugin/src/hashtb.h
@@ -189,6 +189,9 @@ typedef struct __attribute__ ((packed)) hicn_hash_entry_s
*/
u32 locks;
+ /* Index of dpo (4B) */
+ index_t dpo_ctx_id;
+
/* A few flags, including 'this points to a chain of buckets' */
u8 he_flags;
@@ -198,10 +201,10 @@ typedef struct __attribute__ ((packed)) hicn_hash_entry_s
*/
u8 vft_id;
- /* Index of dpo */
- u8 dpo_ctx_id;
+} hicn_hash_entry_t; //size 22B
+
+STATIC_ASSERT (sizeof (index_t) <= 4, "sizeof index_t is greater than 4B");
-} hicn_hash_entry_t;
#define HICN_HASH_ENTRY_FLAGS_DEFAULT 0x00
@@ -231,13 +234,13 @@ typedef struct __attribute__ ((packed)) hicn_hash_entry_s
* Overflow bucket ratio as a fraction of the fixed/configured count; a pool
* of hash buckets used if a row in the fixed table overflows.
*/
-#define HICN_HASHTB_BUCKET_ENTRIES 6
+#define HICN_HASHTB_BUCKET_ENTRIES 5
typedef struct __attribute__ ((packed))
{
hicn_hash_entry_t hb_entries[HICN_HASHTB_BUCKET_ENTRIES];
u64 align1;
- u32 align2;
+ u64 align2;
u16 align3;
} hicn_hash_bucket_t;
@@ -400,7 +403,7 @@ int
hicn_hashtb_insert (hicn_hashtb_h h, hicn_hash_node_t * node,
hicn_hash_entry_t ** hash_entry, u64 hash,
u32 * node_id,
- u8 * dpo_ctx_id, u8 * vft_id, u8 * is_cs,
+ index_t * dpo_ctx_id, u8 * vft_id, u8 * is_cs,
u8 * hash_entry_id, u32 * bucket_id,
u8 * bucket_is_overflow);
@@ -414,7 +417,7 @@ hicn_hashtb_insert (hicn_hashtb_h h, hicn_hash_node_t * node,
int
hicn_hashtb_lookup_node (hicn_hashtb_h h, const u8 * key,
u32 keylen, u64 hashval, u8 is_data,
- u32 * node_id, u8 * dpo_ctx_id, u8 * vft_id,
+ u32 * node_id, index_t * dpo_ctx_id, u8 * vft_id,
u8 * is_cs, u8 * hash_entry_id, u32 * bucket_id,
u8 * bucket_is_overflow);
@@ -432,7 +435,7 @@ int
hicn_hashtb_lookup_node_ex (hicn_hashtb_h h, const u8 * key,
u32 keylen, u64 hashval, u8 is_data,
int include_deleted_p, u32 * node_id,
- u8 * dpo_ctx_id, u8 * vft_id, u8 * is_cs,
+ index_t * dpo_ctx_id, u8 * vft_id, u8 * is_cs,
u8 * hash_entry_id, u32 * bucket_id,
u8 * bucket_is_overflow);