summaryrefslogtreecommitdiffstats
path: root/src/vnet/dpo/lookup_dpo.c
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2020-06-05 09:42:50 -0400
committerNeale Ranns <nranns@cisco.com>2020-06-07 09:11:48 +0000
commit26d890eb4b1ab19fea4d2d02bfc6dc89d2c1b771 (patch)
treed41cc9331ed079ec5c91b76bb87e6a3178046522 /src/vnet/dpo/lookup_dpo.c
parentc2d2228e928b7c69dc88e9c3b7502966d0e32d8d (diff)
fib: fix multiple dpo pool expand cases
Add dpo_pool_barrier_sync/release, use them to clean up thread-unsafe pool expansion cases. Type: fix Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I09299124a25f8d541e3bb4b75375568990e9b911
Diffstat (limited to 'src/vnet/dpo/lookup_dpo.c')
-rw-r--r--src/vnet/dpo/lookup_dpo.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/vnet/dpo/lookup_dpo.c b/src/vnet/dpo/lookup_dpo.c
index daa2352f649..677a19fe862 100644
--- a/src/vnet/dpo/lookup_dpo.c
+++ b/src/vnet/dpo/lookup_dpo.c
@@ -63,8 +63,12 @@ static lookup_dpo_t *
lookup_dpo_alloc (void)
{
lookup_dpo_t *lkd;
+ vlib_main_t *vm;
+ u8 did_barrier_sync;
+ dpo_pool_barrier_sync (vm, lookup_dpo_pool, did_barrier_sync);
pool_get_aligned(lookup_dpo_pool, lkd, CLIB_CACHE_LINE_BYTES);
+ dpo_pool_barrier_release (vm, did_barrier_sync);
return (lkd);
}
@@ -1076,7 +1080,7 @@ lookup_dpo_mpls_inline (vlib_main_t * vm,
*/
if (table_from_interface)
{
- fib_index0 =
+ fib_index0 =
mpls_fib_table_get_index_for_sw_if_index(
vnet_buffer(b0)->sw_if_index[VLIB_RX]);
}
@@ -1142,9 +1146,9 @@ lookup_dpo_mpls_inline (vlib_main_t * vm,
if (PREDICT_FALSE(vnet_buffer2(b0)->loop_counter > MAX_LUKPS_PER_PACKET))
next0 = MPLS_LOOKUP_NEXT_DROP;
- if (PREDICT_FALSE(b0->flags & VLIB_BUFFER_IS_TRACED))
+ if (PREDICT_FALSE(b0->flags & VLIB_BUFFER_IS_TRACED))
{
- lookup_trace_t *tr = vlib_add_trace (vm, node,
+ lookup_trace_t *tr = vlib_add_trace (vm, node,
b0, sizeof (*tr));
tr->fib_index = fib_index0;
tr->lbi = lbi0;