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 1393BA054F; Mon, 1 Mar 2021 23:31:40 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9C6664069E; Mon, 1 Mar 2021 23:31:39 +0100 (CET) Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) by mails.dpdk.org (Postfix) with ESMTP id D8B2240041 for ; Mon, 1 Mar 2021 23:31:37 +0100 (CET) Received: by mail-wr1-f53.google.com with SMTP id v15so17840597wrx.4 for ; Mon, 01 Mar 2021 14:31:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mayadata-io.20150623.gappssmtp.com; s=20150623; h=from:subject:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=xSZ5rnFgckywaJTP1L85QSLTWySIoL+gH09/d8GeH40=; b=xOfRCUXlRbwsDZocF+az6xmYKcY3ucUBv2TL0QPJq8uUeLfYARlgcA1HSj/OW+LIRZ P82qq5BhR0icCPYlJPOZI7Wahr6CTQi/nn2LsMMkhJyi7DzO3vgL7y6rDQ8puyi/zR+z 4a78GHyui6cxYABgMWi7pYakD6m9ydGHhlY1UvEHDDPfDr2DO052whCG8LK4XEHGdIJ5 pXX96BN39/dNsCmFXGwIipuBX5DLlBtBn+q29Fa8QlScLrnF4jGYRyQ5vDa4tmDH77JV HV+zkjoSBwSFMbVFnrK2MsAZuR1ytRs+JTQ1YS2NFhmMaUm6W/1LKkUt6ZN8niF2wxZq WAIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=xSZ5rnFgckywaJTP1L85QSLTWySIoL+gH09/d8GeH40=; b=Lb2CkfDSWVjAVsV2+WSInTbx9bWp1dJtzDHcIPuY+CaZwYXxvJr7RRhnWpmH/c3BsT 06MUjJmRW0+dq1ZfWByHH1CTMEF/SERRgmC0rvhWWgneoIVQ7ly5fthULcLugFtCep6m QQ239/9CLTbk5tr/JFWdJ9L85kf5wkchwbChNICYiZxfV9z91MYFEW8sTXyieaWPmido sQK48anU6wIsYG+gJFcvk/89iJ5lNx9AxzAvEu9/g5VQ7wKr6jb7V5qwvCqnj/4ogt38 8Epvjn9SfiR/KRuAbYQzf5ZmHy/C1mKNhN8MZQd4b593YcHB3ka7vgs4IWiSr3DnGTA4 2FNA== X-Gm-Message-State: AOAM531aboUBP4NEnbxt3oNEeWsMxLLu9i1uAY5mh7LptWISZ2CrNL9l apWChC0b2Q7c1t/3xcpsVcjTWg== X-Google-Smtp-Source: ABdhPJwCglTQGNaQc9R9pKwVVt9H1b34Gk2m8ROotEhzavTwn+/qIF5ggoMrXN9djWuOUqpKq+VnsA== X-Received: by 2002:a05:6000:18f:: with SMTP id p15mr19155345wrx.23.1614637897195; Mon, 01 Mar 2021 14:31:37 -0800 (PST) Received: from [192.168.0.33] (cpc98320-croy25-2-0-cust77.19-2.cable.virginm.net. [80.235.134.78]) by smtp.gmail.com with ESMTPSA id z3sm27188556wrw.96.2021.03.01.14.31.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 01 Mar 2021 14:31:36 -0800 (PST) From: Nick Connolly X-Google-Original-From: Nick Connolly To: Dmitry Kozlyuk , dev@dpdk.org Cc: Tyler Retzlaff , Mike Wells , Narcisa Ana Maria Vasile , Dmitry Malloy , Pallavi Kadam , Ray Kinsella , Neil Horman References: <20210214012013.23165-1-dmitry.kozliuk@gmail.com> <20210214012013.23165-2-dmitry.kozliuk@gmail.com> Message-ID: <0530e805-cee2-676a-7967-a97926972cec@mayadata.io> Date: Mon, 1 Mar 2021 22:31:34 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <20210214012013.23165-2-dmitry.kozliuk@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB Subject: Re: [dpdk-dev] [PATCH 1/6] eal: add internal API for current time 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" 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 = ((uint64_t)ft.dwHighDateTime << 32) | ft.dwLowDateTime; > + sec = (ticks - EPOCH) / (TICKS_PER_USEC * USEC_PER_SEC); > + now->sec = sec; > + now->usec = (ticks - sec * USEC_PER_SEC) / TICKS_PER_USEC;