aboutsummaryrefslogtreecommitdiffstats
path: root/vlib
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2016-11-08 13:20:42 +0100
committerDave Barach <openvpp@barachs.net>2016-11-08 19:29:53 +0000
commit3a4ed3934585eb841fa36f6f062adf4dce9b4661 (patch)
treed8e2095e3990897140e31796a53c50ba4a960017 /vlib
parent9f6186e055eeb7f25a6ff43834c4bcee56699b3c (diff)
pg: maintain per-worker bitmap of enabled streams
Change-Id: I38e476c8080faa5a8647ce6be5a71090e0aa8d5b Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'vlib')
-rw-r--r--vlib/vlib/threads.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/vlib/vlib/threads.h b/vlib/vlib/threads.h
index e30b9e35118..e264435c3ed 100644
--- a/vlib/vlib/threads.h
+++ b/vlib/vlib/threads.h
@@ -365,6 +365,18 @@ vlib_get_worker_cpu_index (u32 worker_index)
return worker_index + 1;
}
+always_inline u32
+vlib_get_worker_index (u32 cpu_index)
+{
+ return cpu_index - 1;
+}
+
+always_inline u32
+vlib_get_current_worker_index ()
+{
+ return os_get_cpu_number () - 1;
+}
+
always_inline vlib_main_t *
vlib_get_worker_vlib_main (u32 worker_index)
{