OpenFastPath / ofp

OpenFastPath project
BSD 3-Clause "New" or "Revised" License
351 stars 126 forks source link

CLI command "stat" doesn't always output CPU core statistics correctly #183

Closed ViktorTikkanen closed 6 years ago

ViktorTikkanen commented 7 years ago

Currently "stat" command assumes that all the CPU cores in the system are available to the ODP/OFP. Thus it starts output from core 0 and handles first odp_cpu_count() cores (the number returned by odp_cpu_count can be smaller than number of online CPU cores in the system).

In case when some (N) cores are not available (e.g. reserved by Linux for other processes), statistics for last N cores is not output by "stat" command at all.

CPU core statistics output should be done based on CPU mask e.g. with help of ODP routines odp_cpumask_all_available(), odp_cpumask_first() and odp_cpumask_next().