diff options
author | Damjan Marion <damarion@cisco.com> | 2024-02-12 19:44:58 +0000 |
---|---|---|
committer | Mohammed HAWARI <momohawari@gmail.com> | 2024-03-18 16:01:35 +0000 |
commit | 3eb6cbec50a5cbe4c3465d60ba6aea7bf2845cd1 (patch) | |
tree | 0f45044087400911e213048c1967ac96a9f8ea29 /src/vlib/buffer.c | |
parent | 8799bf6ca6b78321049bbc397256dd8b3884d829 (diff) |
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>
Diffstat (limited to 'src/vlib/buffer.c')
-rw-r--r-- | src/vlib/buffer.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/vlib/buffer.c b/src/vlib/buffer.c index b43c1dace97..674f15d5dc6 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 @@ vlib_buffer_main_init (struct vlib_main_t * vm) 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); |