avoid using thread local storage for thread index
It is cheaper to get thread index from vlib_main_t if available...
Change-Id: I4582e160d06d9d7fccdc54271912f0635da79b50
Signed-off-by: Damjan Marion <damarion@cisco.com>
diff --git a/src/vnet/ipsec/ipsec.h b/src/vnet/ipsec/ipsec.h
index e457e33..d1aedb1 100644
--- a/src/vnet/ipsec/ipsec.h
+++ b/src/vnet/ipsec/ipsec.h
@@ -355,7 +355,7 @@
always_inline void
ipsec_alloc_empty_buffers (vlib_main_t * vm, ipsec_main_t * im)
{
- u32 thread_index = vlib_get_thread_index ();
+ u32 thread_index = vm->thread_index;
uword l = vec_len (im->empty_buffers[thread_index]);
uword n_alloc = 0;