app/testpmd: use clock time in throughput calculation
authorHonnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Mon, 6 Jul 2020 23:32:29 +0000 (18:32 -0500)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 7 Jul 2020 21:38:28 +0000 (23:38 +0200)
commitaac2b6a78d7728ee39aed8822cba102b3a99a6bf
tree58ed4dae94cc7bc70a9e69d015ce9d705d7d331d
parentcd6760da1076d43c3ef9624c4efca0921b5cb58d
app/testpmd: use clock time in throughput calculation

The throughput calculation requires a counter that measures
passing of time. However, the kernel saves and restores the PMU
state when a thread is unscheduled and scheduled. This ensures
that the PMU cycles are not counted towards a thread that is
not scheduled. Hence, when RTE_ARM_EAL_RDTSC_USE_PMU is enabled,
the PMU cycles do not represent the passing of time.
This results in incorrect calculation of throughput numbers.
Use clock_gettime system call to calculate the time passed since
last call.

Bugzilla ID: 450
Fixes: 0e106980301d ("app/testpmd: show throughput in port stats")
Cc: stable@dpdk.org
Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Tested-by: Phil Yang <phil.yang@arm.com>
Tested-by: Ali Alnubani <alialnu@mellanox.com>
app/test-pmd/config.c