Thread safe internal buffer manager
Change-Id: I45845b952aa42a854e1c2c396b85f905de987020
Signed-off-by: Damjan Marion <damarion@cisco.com>
diff --git a/src/vlib/buffer.c b/src/vlib/buffer.c
index 53b60c1..a5c955c 100644
--- a/src/vlib/buffer.c
+++ b/src/vlib/buffer.c
@@ -305,12 +305,6 @@
if (CLIB_DEBUG == 0)
return;
- ASSERT (vlib_get_thread_index () == 0);
-
- /* smp disaster check */
- if (vec_len (vlib_mains) > 1)
- ASSERT (vm == vlib_mains[0]);
-
is_free = expected_state == VLIB_BUFFER_KNOWN_ALLOCATED;
b = buffers;
for (i = 0; i < n_buffers; i++)
@@ -1050,6 +1044,7 @@
bm->cb.vlib_buffer_free_no_next_cb = &vlib_buffer_free_no_next_internal;
bm->cb.vlib_buffer_delete_free_list_cb =
&vlib_buffer_delete_free_list_internal;
+ clib_spinlock_init (&bm->buffer_known_hash_lockp);
}
/** @endcond */