Re: [dpdk-dev] [PATCH 1/6] eal: add internal API for current time

2021-03-01 Thread Nick Connolly
Calculation of usec value is incorrect - 'ticks' is not adjusted for epoch, whereas 'sec' has been, also subtraction has mismatched units - ticks in 100ns and sec * USEC_PER_SEC in usecs. Ignore - fixed in later version which I hadn't spotted.

Re: [dpdk-dev] [PATCH 1/6] eal: add internal API for current time

2021-03-01 Thread Nick Connolly
Calculation of usec value is incorrect - 'ticks' is not adjusted for epoch, whereas 'sec' has been, also subtraction has mismatched units - ticks in 100ns and sec * USEC_PER_SEC in usecs. On 14/02/2021 01:20, Dmitry Kozlyuk wrote: + GetSystemTimePreciseAsFileTime(&ft); + ticks = (

[dpdk-dev] [PATCH 1/6] eal: add internal API for current time

2021-02-13 Thread Dmitry Kozlyuk
Many PMDs use POSIX gettimeofday(). Add rte_time_get_us() function to obtain current time with microsecond precision on all platforms. Signed-off-by: Dmitry Kozlyuk --- lib/librte_eal/include/rte_time.h| 17 + lib/librte_eal/rte_eal_exports.def | 1 + lib/librte_eal/unix/e