Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
vppinfra: increase max bihash arena size to 512GB
[vpp.git]
/
src
/
vppinfra
/
bihash_template.h
diff --git
a/src/vppinfra/bihash_template.h
b/src/vppinfra/bihash_template.h
index
8398c38
..
eb50d32
100644
(file)
--- a/
src/vppinfra/bihash_template.h
+++ b/
src/vppinfra/bihash_template.h
@@
-59,10
+59,10
@@
typedef struct
{
struct
{
{
struct
{
- u
32 offset
;
- u
8 linear_search
;
- u
8 log2_pages
;
- i
16 refcnt
;
+ u
64 offset:37
;
+ u
64 linear_search:1
;
+ u
64 log2_pages:8
;
+ i
64 refcnt:16
;
};
u64 as_u64;
};
};
u64 as_u64;
};
@@
-72,6
+72,10
@@
typedef struct
#endif
} BVT (clib_bihash_bucket);
#endif
} BVT (clib_bihash_bucket);
+#if BIHASH_KVP_CACHE_SIZE == 0
+STATIC_ASSERT_SIZEOF (BVT (clib_bihash_bucket), sizeof (u64));
+#endif
+
typedef struct
{
BVT (clib_bihash_value) * values;
typedef struct
{
BVT (clib_bihash_value) * values;
@@
-238,6
+242,12
@@
static inline void *BV (clib_bihash_get_value) (BVT (clib_bihash) * h,
return (void *) vp;
}
return (void *) vp;
}
+static inline int BV (clib_bihash_bucket_is_empty)
+ (BVT (clib_bihash_bucket) * b)
+{
+ return b->as_u64 == 0;
+}
+
static inline uword BV (clib_bihash_get_offset) (BVT (clib_bihash) * h,
void *v)
{
static inline uword BV (clib_bihash_get_offset) (BVT (clib_bihash) * h,
void *v)
{
@@
-284,7
+294,7
@@
static inline int BV (clib_bihash_search_inline_with_hash)
bucket_index = hash & (h->nbuckets - 1);
b = &h->buckets[bucket_index];
bucket_index = hash & (h->nbuckets - 1);
b = &h->buckets[bucket_index];
- if (
b->offset == 0
)
+ if (
PREDICT_FALSE (BV (clib_bihash_bucket_is_empty) (b))
)
return -1;
#if BIHASH_KVP_CACHE_SIZE > 0
return -1;
#if BIHASH_KVP_CACHE_SIZE > 0
@@
-373,7
+383,7
@@
static inline void BV (clib_bihash_prefetch_data)
bucket_index = hash & (h->nbuckets - 1);
b = &h->buckets[bucket_index];
bucket_index = hash & (h->nbuckets - 1);
b = &h->buckets[bucket_index];
- if (PREDICT_FALSE (
b->offset == 0
))
+ if (PREDICT_FALSE (
BV (clib_bihash_bucket_is_empty) (b)
))
return;
hash >>= h->log2_nbuckets;
return;
hash >>= h->log2_nbuckets;
@@
-401,7
+411,7
@@
static inline int BV (clib_bihash_search_inline_2_with_hash)
bucket_index = hash & (h->nbuckets - 1);
b = &h->buckets[bucket_index];
bucket_index = hash & (h->nbuckets - 1);
b = &h->buckets[bucket_index];
- if (
b->offset == 0
)
+ if (
PREDICT_FALSE (BV (clib_bihash_bucket_is_empty) (b))
)
return -1;
/* Check the cache, if currently unlocked */
return -1;
/* Check the cache, if currently unlocked */