From: Dave Barach Date: Tue, 1 Jan 2019 14:45:08 +0000 (-0500) Subject: Default huge page size to the regular page size X-Git-Tag: v19.04-rc0~63 X-Git-Url: https://gerrit.fd.io/r/gitweb?p=vpp.git;a=commitdiff_plain;h=036343b8b15389df52db12ff62da0133a8f030fd Default huge page size to the regular page size With this simple tweak, vpp is OK for "make test" or non-dpdk driver operation over a kernel which doesn't support hugepages at all. Tested on a Raspberry-pi 3B+ running the Ubuntu 18.04 64-bit server beta image. It's amazing that such a minimal system will not only self-compile vpp, but also run the unit tests. It's slow, but what do you expect for that amount of money? Change-Id: I7f080f871c828cc4b44be13809495278fadbd717 Signed-off-by: Dave Barach --- diff --git a/src/vppinfra/linux/mem.c b/src/vppinfra/linux/mem.c index 8edae74f9cd..407e923fb78 100644 --- a/src/vppinfra/linux/mem.c +++ b/src/vppinfra/linux/mem.c @@ -63,6 +63,12 @@ clib_mem_get_default_hugepage_size (void) if (size) goto done; + /* + * If the kernel doesn't support hugepages, /proc/meminfo won't + * say anything about it. Use the regular page size as a default. + */ + size = clib_mem_get_page_size () / 1024; + if ((fd = open ("/proc/meminfo", 0)) == -1) return 0;