eal/armv8: fix timer frequency calibration with PMU
authorHonnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Fri, 26 Jun 2020 20:35:01 +0000 (15:35 -0500)
committerDavid Marchand <david.marchand@redhat.com>
Tue, 7 Jul 2020 11:20:50 +0000 (13:20 +0200)
commit97c910139baf007b729388b0c3c24b894e4b6d3e
tree911ad3fcb810372278621d21a26e7a404f3ec1b1
parenta7551b6c6010f8ec70126687121509b33eb15804
eal/armv8: fix timer frequency calibration with PMU

get_tsc_freq uses 'nanosleep' system call to calculate the CPU
frequency. However, 'nanosleep' results in the process getting
un-scheduled. The kernel saves and restores the PMU state. This
ensures that the PMU cycles are not counted towards a sleeping
process. When RTE_ARM_EAL_RDTSC_USE_PMU is defined, this results
in incorrect CPU frequency calculation. This logic is replaced
with generic counter based loop.

Bugzilla ID: 450
Fixes: f91bcbb2d9a6 ("eal/armv8: use high-resolution cycle counter")
Cc: stable@dpdk.org
Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
lib/librte_eal/arm/include/rte_cycles_64.h
lib/librte_eal/arm/rte_cycles.c