Thread (6 messages) flat view 6 messages, 3 authors, 2021-02-10

Re: [dpdk-dev] Feature Discussion: CPU topology detection on FreeBSD

From: Bruce Richardson <hidden>
Date: 2021-01-29 10:05:46

On Thu, Jan 28, 2021 at 04:07:07AM +0000, Oscar Zhao wrote:
Hello dpdk devs,

I would like to discuss the feasibility of implementing CPU topology detection on FreeBSD. Currently both eal_cpu_core_id() and eal_cpu_socket_id() in rte_eal library always return 0 on FreeBSD, making NUMA-aware development impossible without resorting to external libraries or system APIs.

The CPU topology information is available via sysct kern.sched.topology_spec. The only issue is that the return value is an XML formatted object (see https://forums.freebsd.org/threads/number-of-cpus-and-cores.41299/). (https://forums.freebsd.org/threads/number-of-cpus-and-cores.41299/) I'm not sure how feasible it is to parse XML inside DPDK.

On a side note, obtaining the physical NUMA node id of a core is easy - sysctl dev.cpu.[cpu#].%domain returns the corresponding node id but I have yet found a straightforward way to detect hyperthreads besides the XML thing.

Oscar
Even adding in the numa node information would be a welcome start.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help