vppinfra: add os_get_online_cpu_core() and os_get_online_cpu_node()

Type: improvement
Change-Id: I6f99f09c7724ce656a4f41a1d5f9c88d74c00faf
Signed-off-by: Damjan Marion <damarion@cisco.com>
diff --git a/src/vlib/buffer.c b/src/vlib/buffer.c
index b5200ba..e1dcf7e 100644
--- a/src/vlib/buffer.c
+++ b/src/vlib/buffer.c
@@ -44,6 +44,8 @@
  */
 
 #include <vppinfra/linux/sysfs.h>
+#include <vppinfra/bitmap.h>
+#include <vppinfra/unix.h>
 #include <vlib/vlib.h>
 #include <vlib/unix/unix.h>
 #include <vlib/stats/stats.h>
@@ -840,9 +842,7 @@
 
   clib_spinlock_init (&bm->buffer_known_hash_lockp);
 
-  if ((err = clib_sysfs_read ("/sys/devices/system/node/online", "%U",
-			      unformat_bitmap_list, &bmp)))
-    clib_error_free (err);
+  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)))