From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com [209.85.212.175]) by dpdk.org (Postfix) with ESMTP id DA60AC314 for ; Wed, 21 Oct 2015 17:11:23 +0200 (CEST) Received: by wicll6 with SMTP id ll6so79225627wic.1 for ; Wed, 21 Oct 2015 08:11:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=+nX/BgbzitvdTvFVNY91cxEIOYaI+j+gR47fhTDihE8=; b=Np+Vl4+WaG2hM/BB5JE98BaxPnFoxjRL7evrTufmiLMh9joN6MmuF2d3/6zWD5+ZMo 7mGVHHS8hz48cancpBAwmutHxPSsQ+YaekI58SddBQTQ1xzkPjj2RY1ROu0zji6IjPzL QSWAMKXBsw1t3FF/PfiidrLi+k9Tpp+E0bwM5fX4ozwZ0gDt6HoR89m8HljZ2BwBq8cn u5hHNsgXHmlwfAoXWxRYW9IDURLbI/6dhzfBtzndf0R5vqVUvgN0CTVHRortUQFErNn9 v/OeAhC/gN2Sn41+oxTaUEKQnstVrwtHiDsLyFNtA8WsVSGCfje+yDgU+UpTUFJ7x8B/ OoeA== X-Gm-Message-State: ALoCoQkBBy0qH+Xhx/iLakpCS+IyRjlCDKNZ/qcf2xYLEyqVIppEhEIVgQ+bp6WsYWtc/sw/CA9F X-Received: by 10.194.242.167 with SMTP id wr7mr11512526wjc.27.1445440283685; Wed, 21 Oct 2015 08:11:23 -0700 (PDT) Received: from xps13.localnet (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id ly4sm10978383wjb.4.2015.10.21.08.11.22 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Oct 2015 08:11:22 -0700 (PDT) From: Thomas Monjalon To: Wen-Chi Yang Date: Wed, 21 Oct 2015 17:10:18 +0200 Message-ID: <1790131.1sIkGeekIY@xps13> Organization: 6WIND User-Agent: KMail/4.14.10 (Linux/4.1.6-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <20151013173320.46e07232@xeon-e3> References: <1433472396-18852-1-git-send-email-wolkayang@gmail.com> <20151013173320.46e07232@xeon-e3> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH] rte_alarm: modify it to make it not to be affected by discontinuous jumps in the system time X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2015 15:11:24 -0000 2015-10-13 17:33, Stephen Hemminger: > On Fri, 5 Jun 2015 10:46:36 +0800 > Wen-Chi Yang wrote: > > > Due to eal_alarm_callback() and rte_eal_alarm_set() use gettimeofday() > > to get the current time, and gettimeofday() is affected by jumps. > > > > For example, set up a rte_alarm which will be triggerd next second ( > > current time + 1 second) by rte_eal_alarm_set(). And the callback > > function of this rte_alarm sets up another rte_alarm which will be > > triggered next second (current time + 2 second). > > Once we change the system time when the callback function is triggered, > > it is possiblb that rte alarm functionalities work out of expectation. > > > > Replace gettimeofday() with clock_gettime(CLOCK_MONOTONIC_RAW, &now) > > could avoid this phenomenon. > > > > Signed-off-by: Wen-Chi Yang > > Acked-by: Stephen Hemminger Applied, thanks