summaryrefslogtreecommitdiffstats
path: root/src/vppinfra/cpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vppinfra/cpu.c')
-rw-r--r--src/vppinfra/cpu.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/vppinfra/cpu.c b/src/vppinfra/cpu.c
index 4631eb3b896..d2edc61cfbf 100644
--- a/src/vppinfra/cpu.c
+++ b/src/vppinfra/cpu.c
@@ -222,7 +222,21 @@ format_cpu_flags (u8 * s, va_list * args)
#endif
}
+__clib_export u32
+clib_get_current_cpu_id ()
+{
+ unsigned cpu, node;
+ syscall (__NR_getcpu, &cpu, &node, 0);
+ return cpu;
+}
+__clib_export u32
+clib_get_current_numa_node ()
+{
+ unsigned cpu, node;
+ syscall (__NR_getcpu, &cpu, &node, 0);
+ return node;
+}
/*
* fd.io coding-style-patch-verification: ON