From cb3372ddc87ef35a74da4dabc2046f760e386b05 Mon Sep 17 00:00:00 2001 From: Tom Jones Date: Fri, 26 Jan 2024 17:34:51 +0000 Subject: vppinfra: Only prealloc hugepages on Linux FreeBSD doesn't support sysfs or preallocating hugepages directly. In lieu of refactoring clib_sysfs calls place this one behind an #ifdef linux. Type: improvement Change-Id: I4079ca70175e4cec44d913db2b0407a3ca6306c9 Signed-off-by: Tom Jones --- src/vppinfra/pmalloc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/vppinfra/pmalloc.c b/src/vppinfra/pmalloc.c index ee80d109c03..0bd343494e9 100644 --- a/src/vppinfra/pmalloc.c +++ b/src/vppinfra/pmalloc.c @@ -241,6 +241,7 @@ pmalloc_map_pages (clib_pmalloc_main_t * pm, clib_pmalloc_arena_t * a, return 0; } +#ifdef __linux__ if (a->log2_subpage_sz != clib_mem_get_log2_page_size ()) { pm->error = clib_sysfs_prealloc_hugepages (numa_node, @@ -249,6 +250,7 @@ pmalloc_map_pages (clib_pmalloc_main_t * pm, clib_pmalloc_arena_t * a, if (pm->error) return 0; } +#endif /* __linux__ */ rv = clib_mem_set_numa_affinity (numa_node, /* force */ 1); if (rv == CLIB_MEM_ERROR && numa_node != 0) -- cgit 1.2.3-korg