From: Tom Jones Date: Fri, 26 Jan 2024 13:48:49 +0000 (+0000) Subject: vppinfra: Stub out get_current_cpu and get_current_numa on FreeBSD X-Git-Tag: v24.10-rc0~223 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=ac80b8be8be5757b667a9aa7ddf258b36f695a5a;p=vpp.git vppinfra: Stub out get_current_cpu and get_current_numa on FreeBSD FreeBSD has its own set of syscalls for getting current CPU and NUMA domain information. Stub out these calls and return CPU 0 and NUMA domain 0 as placeholders until we bring in FreeBSD specific calls. Type: improvement Change-Id: Id61df0273b0bcc6acf4844ee626e4f246f9f217b Signed-off-by: Tom Jones --- diff --git a/src/vppinfra/cpu.c b/src/vppinfra/cpu.c index 79e7dc0955e..385a4e25408 100644 --- a/src/vppinfra/cpu.c +++ b/src/vppinfra/cpu.c @@ -252,17 +252,25 @@ format_cpu_flags (u8 *s, va_list *args) __clib_export u32 clib_get_current_cpu_id () { +#ifdef __linux__ unsigned cpu, node; syscall (__NR_getcpu, &cpu, &node, 0); return cpu; +#else + return 0; +#endif /* __linux__ */ } __clib_export u32 clib_get_current_numa_node () { +#ifdef __linux__ unsigned cpu, node; syscall (__NR_getcpu, &cpu, &node, 0); return node; +#else + return 0; +#endif /* __linux__ */ } __clib_export u8 *