1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2014 Intel Corporation
6 #include <sys/sysctl.h>
10 #include <rte_lcore.h>
11 #include <rte_common.h>
12 #include <rte_debug.h>
14 #include "eal_private.h"
15 #include "eal_thread.h"
17 /* No topology information available on FreeBSD including NUMA info */
19 eal_cpu_core_id(__rte_unused unsigned lcore_id)
28 int mib[2] = {CTL_HW, HW_NCPU};
29 size_t len = sizeof(ncpu);
32 sysctl(mib, 2, &ncpu, &len, NULL, 0);
33 RTE_LOG(INFO, EAL, "Sysctl reports %d cpus\n", ncpu);
39 eal_cpu_socket_id(__rte_unused unsigned cpu_id)
44 /* Check if a cpu is present by the presence of the
45 * cpu information for it.
48 eal_cpu_detected(unsigned lcore_id)
50 const unsigned ncpus = eal_get_ncpus();
51 return lcore_id < ncpus;