[dpdk-dev] [PATCH] examples/timer: fix incorrect time interval

Carrillo, Erik G erik.g.carrillo at intel.com
Wed Apr 21 21:12:32 CEST 2021


> -----Original Message-----
> From: Min Hu (Connor) <humin29 at huawei.com>
> Sent: Thursday, April 15, 2021 2:12 AM
> To: dev at dpdk.org
> Cc: Yigit, Ferruh <ferruh.yigit at intel.com>; rsanford at akamai.com; Carrillo,
> Erik G <erik.g.carrillo at intel.com>
> Subject: [PATCH] examples/timer: fix incorrect time interval
> 
> From: Chengchang Tang <tangchengchang at huawei.com>
> 
> Timer sample example assumes that the frequency of the timer is about
> 2Ghz to control the period of calling rte_timer_manage(). But this
> assumption is easy to fail. For example. the frequency of tsc on ARM64 is
> much less than 2Ghz.
> 
> This patch uses the frequency of the current timer to calculate the correct
> time interval to ensure consistent result on all platforms.
> 
> In addition, the rte_rdtsc() is replaced with the more recommended
> rte_get_timer_cycles function in this patch.
> 
> Fixes: af75078fece3 ("first public release")
> Cc: stable at dpdk.org
> 
> Signed-off-by: Chengchang Tang <tangchengchang at huawei.com>
> Signed-off-by: Min Hu (Connor) <humin29 at huawei.com>

This LGTM - thanks.

Acked-by: Erik Gabriel Carrillo <erik.g.carrillo at intel.com>


More information about the dev mailing list