X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvppinfra%2Fbihash_template.c;h=cd75a7a9be97a7812453c83fc8db98b0b81fed98;hb=9e4946b324a8480b35c861e96199881b314ea825;hp=bf6be83b2e06ea5db717394074ad2328cee25dbb;hpb=39040a619af4e8750349edba2e93eecb8ce4538b;p=vpp.git diff --git a/src/vppinfra/bihash_template.c b/src/vppinfra/bihash_template.c index bf6be83b2e0..cd75a7a9be9 100644 --- a/src/vppinfra/bihash_template.c +++ b/src/vppinfra/bihash_template.c @@ -519,6 +519,13 @@ static inline int BV (clib_bihash_add_del_inline) { if (BV (clib_bihash_key_compare) (v->kvp[i].key, add_v->key)) { + /* Add but do not overwrite? */ + if (is_add == 2) + { + BV (clib_bihash_unlock_bucket) (b); + return (-2); + } + CLIB_MEMORY_BARRIER (); /* Add a delay */ clib_memcpy_fast (&(v->kvp[i]), add_v, sizeof (*add_v)); BV (clib_bihash_unlock_bucket) (b);