X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fip%2Freass%2Fip4_sv_reass.c;h=9971dafd9fd1b3f7dd04c500e55056aeb1b71e26;hb=4ab6ad136b62add35598f3c354231701b7c14c65;hp=f5fa575e64d6c8f95c7a75ed4c42d2b47468d2ea;hpb=e3241f04410fa45099f958f77636b80293904fc3;p=vpp.git diff --git a/src/vnet/ip/reass/ip4_sv_reass.c b/src/vnet/ip/reass/ip4_sv_reass.c index f5fa575e64d..9971dafd9fd 100644 --- a/src/vnet/ip/reass/ip4_sv_reass.c +++ b/src/vnet/ip/reass/ip4_sv_reass.c @@ -321,6 +321,8 @@ ip4_sv_reass_find_or_create (vlib_main_t * vm, ip4_sv_reass_main_t * rm, ip4_sv_reass_t *reass = NULL; f64 now = vlib_time_now (vm); +again: + if (!clib_bihash_search_16_8 (&rm->hash, &kv->kv, &kv->kv)) { if (vm->thread_index != kv->v.thread_index) @@ -375,10 +377,14 @@ ip4_sv_reass_find_or_create (vlib_main_t * vm, ip4_sv_reass_main_t * rm, kv->v.thread_index = vm->thread_index; reass->last_heard = now; - if (clib_bihash_add_del_16_8 (&rm->hash, &kv->kv, 1)) + int rv = clib_bihash_add_del_16_8 (&rm->hash, &kv->kv, 2); + if (rv) { ip4_sv_reass_free (vm, rm, rt, reass); reass = NULL; + // if other worker created a context already work with the other copy + if (-2 == rv) + goto again; } return reass;