aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/memif
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2018-07-11 12:47:43 +0200
committerFlorin Coras <florin.coras@gmail.com>2018-07-11 15:13:41 +0000
commit067cd6229a47ea3ba8b59a2a04090e80afb5bd2c (patch)
tree13d81219dbe0483dda02922ed5a6b6cb4c7632db /src/plugins/memif
parentb6b04f0c2a64d6edd536add6900e9d458c2fe8d1 (diff)
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>
Diffstat (limited to 'src/plugins/memif')
-rw-r--r--src/plugins/memif/device.c2
-rw-r--r--src/plugins/memif/node.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/memif/device.c b/src/plugins/memif/device.c
index 87c9404bd8e..5c8eb3f082c 100644
--- a/src/plugins/memif/device.c
+++ b/src/plugins/memif/device.c
@@ -409,7 +409,7 @@ CLIB_MULTIARCH_FN (memif_interface_tx) (vlib_main_t * vm,
vnet_interface_output_runtime_t *rund = (void *) node->runtime_data;
memif_if_t *mif = pool_elt_at_index (nm->interfaces, rund->dev_instance);
memif_queue_t *mq;
- u32 thread_index = vlib_get_thread_index ();
+ u32 thread_index = vm->thread_index;
memif_per_thread_data_t *ptd = vec_elt_at_index (memif_main.per_thread_data,
thread_index);
u8 tx_queues = vec_len (mif->tx_queues);
diff --git a/src/plugins/memif/node.c b/src/plugins/memif/node.c
index 6e2807a2054..2b8c4f2d228 100644
--- a/src/plugins/memif/node.c
+++ b/src/plugins/memif/node.c
@@ -187,7 +187,7 @@ memif_device_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
u32 n_left, *to_next = 0;
u32 bi0, bi1, bi2, bi3;
vlib_buffer_t *b0, *b1, *b2, *b3;
- u32 thread_index = vlib_get_thread_index ();
+ u32 thread_index = vm->thread_index;
memif_per_thread_data_t *ptd = vec_elt_at_index (mm->per_thread_data,
thread_index);
vlib_buffer_t *bt = &ptd->buffer_template;
@@ -542,7 +542,7 @@ memif_device_input_zc_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
u16 s0, s1, s2, s3;
memif_desc_t *d0, *d1, *d2, *d3;
vlib_buffer_t *b0, *b1, *b2, *b3;
- u32 thread_index = vlib_get_thread_index ();
+ u32 thread_index = vm->thread_index;
memif_per_thread_data_t *ptd = vec_elt_at_index (mm->per_thread_data,
thread_index);
u16 cur_slot, last_slot, ring_size, n_slots, mask, head;