ipc: use monotonic clock
authorChengwen Feng <fengchengwen@huawei.com>
Tue, 11 May 2021 10:41:23 +0000 (18:41 +0800)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 12 May 2021 14:49:08 +0000 (16:49 +0200)
commitcc994d3922b7cd464d84fbef110dd65348e0a0da
treeb9daf505a316ebd855082ba70074287813ab22d5
parent5cf6947c95990067d8c980c85a01cb7c037f2dc5
ipc: use monotonic clock

Currently, the mp uses gettimeofday() API to get the time, and used as
timeout parameter.

But the time which gets from gettimeofday() API isn't monotonically
increasing. The process may fail if the system time is changed.

This fixes it by using clock_gettime() API with monotonic attribution.

Fixes: 783b6e54971d ("eal: add synchronous multi-process communication")
Fixes: f05e26051c15 ("eal: add IPC asynchronous request")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
lib/eal/common/eal_common_proc.c