From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f49.google.com (mail-pa0-f49.google.com [209.85.220.49]) by dpdk.org (Postfix) with ESMTP id 4D2F18D9B for ; Wed, 14 Oct 2015 02:33:10 +0200 (CEST) Received: by pabws5 with SMTP id ws5so5174689pab.1 for ; Tue, 13 Oct 2015 17:33:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=gHsfaZihlDPqo4xing3AVp0whYwmMX5+zdWY0ZM8wuw=; b=TEUMxkG8qnR+Ox7yeiGgTzqGrkCy0OFHArVkyf+fIJ/i+SNFiVUG/W1P4EGG9FCAg+ V3dHUyqhU+4kjny/vlx/8GngsiqfmOxArPcrydnHHGevklmQZzZcBbVH0OAG3RMtUIOv HX5CBqdSkwM6U2AkPVaGFHutvkYtTBgLmQGXpUlr76GWS9NnxWqK235QGe+T15H/iT/Y plbZ19nisZSCVZf2imaga2Xv3G5bFwlXWB+qoUy2Le+PaT3k4pz7fYTcuuZ1/5Jgzutk vdN/7F9ifdt9qt/vWem6tRJZJ2s/zmInwOO42Qx/FEI8B5CNvp1NAKQaHPFjRwUomm0y dhGQ== X-Gm-Message-State: ALoCoQlR76MSL/Cm4+3cE2ytCE/gIBn441EUAXEYgcUt1PMesUUCeXbP4bFZdObsj0s6dH7uMvQx X-Received: by 10.66.141.111 with SMTP id rn15mr392828pab.70.1444782789751; Tue, 13 Oct 2015 17:33:09 -0700 (PDT) Received: from xeon-e3 (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by smtp.gmail.com with ESMTPSA id bn1sm6042581pad.17.2015.10.13.17.33.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Oct 2015 17:33:09 -0700 (PDT) Date: Tue, 13 Oct 2015 17:33:20 -0700 From: Stephen Hemminger To: Wen-Chi Yang Message-ID: <20151013173320.46e07232@xeon-e3> In-Reply-To: <1433472396-18852-1-git-send-email-wolkayang@gmail.com> References: <1433472396-18852-1-git-send-email-wolkayang@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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, 14 Oct 2015 00:33:10 -0000 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 Agreed, this should be applied. Does BSD version have same problem? Acked-by: Stephen Hemminger