examples/l2fwd-crypto: fix stats refresh rate
authorRaja Zidane <rzidane@nvidia.com>
Thu, 7 Apr 2022 11:42:49 +0000 (14:42 +0300)
committerAkhil Goyal <gakhil@marvell.com>
Fri, 29 Apr 2022 09:48:30 +0000 (11:48 +0200)
commitaf676be9e6671b25c69af2aa5fc2d40d562137f6
tree2cc2e9751833d5dd97e9f1e14c7084dfbfdba078
parenta80ea5c082f252f6e6fd4aa0c549913a80ef6c67
examples/l2fwd-crypto: fix stats refresh rate

TIMER_MILLISECOND is defined as the number of cpu cycles per millisecond,
current definition is correct for cores with frequency of 2GHZ, for cores
with different frequency, it caused different periods between refresh,
(i.e. the definition is about 14ms on ARM cores).
The devarg that stated the period between stats print was not used,
instead, it was always defaulted to 10 seconds (on 2GHZ core).

Use DPDK API to get CPU frequency, to define TIMER_MILLISECOND.
Use the refresh period devarg instead of defaulting to 10s always.

Fixes: 387259bd6c67 ("examples/l2fwd-crypto: add sample application")
Cc: stable@dpdk.org
Signed-off-by: Raja Zidane <rzidane@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
examples/l2fwd-crypto/main.c