From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A7875A0A02; Tue, 4 May 2021 18:49:53 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 222974014D; Tue, 4 May 2021 18:49:53 +0200 (CEST) Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by mails.dpdk.org (Postfix) with ESMTP id E484040147 for ; Tue, 4 May 2021 18:49:50 +0200 (CEST) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 4F57C1420; Tue, 4 May 2021 12:49:49 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Tue, 04 May 2021 12:49:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm1; bh= Yv6tc1iNPxybux0JKEL0gDtXMCJ/1lR3hgGBljpQCnw=; b=lGvEiHXsgIvKd1+Z 1dXk+D4wPE/UYHuu5l5JxLyzUP3o5qLSMN2OvNQI7Q4bm9XNH7ygszUNs7QnLEDI mwAVrudPDqJ/9k5vTIEnXJPhBNccMtHuusJ1QtfJMR27rfSb+0Xn259kjc2vkK1L KXlmuepO1pNt2GKL4aVkD2b8NgAlzOnGOokrnrTUb3khUJYZjlbdGK4mAYCuKQzv IR8cfNstX0uxUbxKUQE7LN8PP7GSy/tvIL+IzKuzsDXRdlvs2B6c5K+u7lEs52kQ UH+1BtybECZ7PhXDWRJABoSZGMbolHCJBwXyvy3CAjbeuLVU4pupLIC8oYvwxAEQ Usm/VQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=Yv6tc1iNPxybux0JKEL0gDtXMCJ/1lR3hgGBljpQC nw=; b=fod2svqx/nJv4YL7+ap+MWSg4DjFWuZqfsAngTjzCjAvYfmOk9kke3YQM JwHSBSbtzbExrm1MZ17bs+WldO8mH/MyPbQHkW/zq5TojeOFxDfrFYwhIMSKM+oR swFFzyFxG2HSdDV16YZpq1Rb9mIakMkg+4Ry0ueEmgsy2JjV8ihnLwh2fvbrn9b6 0V5Aus/DTvwvidH7tfoIDNbW/nWB/z9ldEmbMPhQUZVnK9+j063MhWujHG6Wzeta Hg1VFtZEFvurcsn3Yp90zXI9zvrd+0RYyRGlKV35I09BuiwlQWZYKFQ4dO7UHgdE l/j79aY/G/S0mwWcmC5/0D8Rq37sw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdefiedguddtkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdej ueeiiedvffegheenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgr lhhonhdrnhgvth X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 4 May 2021 12:49:47 -0400 (EDT) From: Thomas Monjalon To: "Min Hu (Connor)" Cc: dev@dpdk.org, ferruh.yigit@intel.com, mb@smartsharesystems.com, skori@marvell.com, jerinj@marvell.com Date: Tue, 04 May 2021 18:49:45 +0200 Message-ID: <3448381.piLNI76ssM@thomas> In-Reply-To: <1619662241-61955-1-git-send-email-humin29@huawei.com> References: <1619597563-56716-1-git-send-email-humin29@huawei.com> <1619662241-61955-1-git-send-email-humin29@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v2] eal: fix use wrong time API X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 29/04/2021 04:10, Min Hu (Connor): > 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 > Signed-off-by: Min Hu (Connor) > --- [...] > --- a/lib/eal/common/eal_common_proc.c > +++ b/lib/eal/common/eal_common_proc.c > - if (gettimeofday(&now, NULL) < 0) { > - RTE_LOG(ERR, EAL, "Cannot get current time\n"); > - goto no_trigger; > - } > - ts_now.tv_nsec = now.tv_usec * 1000; > - ts_now.tv_sec = now.tv_sec; > + clock_gettime(CLOCK_MONOTONIC, &ts_now); Why not testing the return value? I think this change would not be appropriate after -rc1. If you agree, I will postpone to DPDK 21.08.