vppinfra: os agnostic api for getting CPU information

Avoid direct sysfs reads when possible...

Type: improvement
Change-Id: I2b84cd18f3da47925d068951f24b79b5b6e20bb1
Signed-off-by: Damjan Marion <damarion@cisco.com>
diff --git a/src/vlib/buffer.c b/src/vlib/buffer.c
index b43c1da..674f15d 100644
--- a/src/vlib/buffer.c
+++ b/src/vlib/buffer.c
@@ -43,7 +43,6 @@
  * Allocate/free network buffers.
  */
 
-#include <vppinfra/linux/sysfs.h>
 #include <vppinfra/bitmap.h>
 #include <vppinfra/unix.h>
 #include <vlib/vlib.h>
@@ -837,10 +836,7 @@
   clib_spinlock_init (&bm->buffer_known_hash_lockp);
 
   bmp = os_get_online_cpu_node_bitmap ();
-
-  if ((err = clib_sysfs_read ("/sys/devices/system/node/has_memory", "%U",
-			      unformat_bitmap_list, &bmp_has_memory)))
-    clib_error_free (err);
+  bmp_has_memory = os_get_cpu_with_memory_bitmap ();
 
   if (bmp && bmp_has_memory)
     bmp = clib_bitmap_and (bmp, bmp_has_memory);