summaryrefslogtreecommitdiffstats
path: root/src/vlib/linux
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2024-02-29 16:14:27 +0100
committerBeno�t Ganne <bganne@cisco.com>2024-03-04 08:53:08 +0000
commit4b6614030f384f7c8d847360cacf5c7f7560c6be (patch)
treeb560c46a2cda2bf6b16e147a52a70ed83c3ce1ce /src/vlib/linux
parent2921e0234185f615d7530343b340573e2cb5caec (diff)
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>
Diffstat (limited to 'src/vlib/linux')
-rw-r--r--src/vlib/linux/pci.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/vlib/linux/pci.c b/src/vlib/linux/pci.c
index 0435d569bec..3af97414ed8 100644
--- a/src/vlib/linux/pci.c
+++ b/src/vlib/linux/pci.c
@@ -38,6 +38,8 @@
*/
#include <vppinfra/linux/sysfs.h>
+#include <vppinfra/bitmap.h>
+#include <vppinfra/unix.h>
#include <vlib/vlib.h>
#include <vlib/pci/pci.h>
@@ -257,11 +259,7 @@ vlib_pci_get_device_info (vlib_main_t * vm, vlib_pci_addr_t * addr,
}
if (di->numa_node == -1)
{
- /* if '/sys/bus/pci/devices/<device id>/numa_node' returns -1 and
- it is a SMP system, set numa_node to 0. */
- 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 (clib_bitmap_count_set_bits (bmp) == 1)
di->numa_node = 0;
}