aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/lb/lbhash.h
diff options
context:
space:
mode:
authorHongjun Ni <hongjun.ni@intel.com>2019-06-04 18:58:58 +0800
committerHongjun Ni <hongjun.ni@intel.com>2019-06-06 05:17:50 +0000
commite56a786b7336428075c6db552655f9e7596a3af9 (patch)
treefca3d79032bd97c3adcf22ebb936ff4e3251b153 /src/plugins/lb/lbhash.h
parent98d6ee7ac305b7c06744d4d30f4da9db0fa076d9 (diff)
lb: crashed with some specific commit under heavy traffic
- When deleting VIP member with flush, VPP will crash. - When deleting VIP member without flush, vpp won't crash. - This crash is almost 100% reproductive. Ticket: VPP-1680 Type: fix Change-Id: Ia4e8f9e0f987176c7f6ec52c92e66563f313b0c3 Signed-off-by: Hongjun Ni <hongjun.ni@intel.com>
Diffstat (limited to 'src/plugins/lb/lbhash.h')
-rw-r--r--src/plugins/lb/lbhash.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/lb/lbhash.h b/src/plugins/lb/lbhash.h
index 585b377b8aa..375227cfd06 100644
--- a/src/plugins/lb/lbhash.h
+++ b/src/plugins/lb/lbhash.h
@@ -89,6 +89,7 @@ lb_hash_t *lb_hash_alloc(u32 buckets, u32 timeout)
u8 *mem = 0;
lb_hash_t *h;
vec_alloc_aligned(mem, size, CLIB_CACHE_LINE_BYTES);
+ clib_memset(mem, 0, size);
h = (lb_hash_t *)mem;
h->buckets_mask = (buckets - 1);
h->timeout = timeout;
@@ -114,7 +115,7 @@ void lb_hash_get(lb_hash_t *ht, u32 hash, u32 vip, u32 time_now,
u32 *available_index, u32 *found_value)
{
lb_hash_bucket_t *bucket = &ht->buckets[hash & ht->buckets_mask];
- *found_value = ~0;
+ *found_value = 0;
*available_index = ~0;
#if __SSE4_2__ && LB_HASH_DO_NOT_USE_SSE_BUCKETS == 0
u32 bitmask, found_index;