From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6E658A00C2; Fri, 24 Apr 2020 23:32:11 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D9B141D162; Fri, 24 Apr 2020 23:32:09 +0200 (CEST) Received: from mail-lf1-f67.google.com (mail-lf1-f67.google.com [209.85.167.67]) by dpdk.org (Postfix) with ESMTP id CA2401D146 for ; Fri, 24 Apr 2020 23:32:08 +0200 (CEST) Received: by mail-lf1-f67.google.com with SMTP id w145so8936847lff.3 for ; Fri, 24 Apr 2020 14:32:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Qul4chj/Bg8wvvXl+rwsjdtgSpMvGeA27U784WRyMuQ=; b=U6mNOG2V/YmngECJXooPglEVoDMNcwDcmW/HI6ja3X1k6PRrVKScDYvt2DEH8wnTlu FmfFQJgRtidw78tI1S21JJbBVjtdDDQIGKHQXZYq8PR7Mz/wyMmhvC+03lO31k2OAjpu Q8fsLysYP3L1q3M9sfiWxuboLhX4wQgEyIupzCf7QDt5/IRSFxAT1k89tBim1iwpr2oR CYgC4wJQZembRmEtskdYogR4GSRPslbkqCMcJEMUnIUfbNYDQ8GfPMooDLGt2LntwHux LxwRqaKGY/ea5wKO+VjNxMBm9r4IAtwf0yFE78kqv2yZ4HY/poOYUEOnowqrLTHLWwC+ XSTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Qul4chj/Bg8wvvXl+rwsjdtgSpMvGeA27U784WRyMuQ=; b=ty4AG97bO1GhIunw33Cotqeb3mxlJ1zAz9VfUjJnWvIazkJIbiAI6DsBEdSyxLymaA t6ikb/nq1ZX0E3d9nnxeCVroEClXrLBOUCU6j/EeGti8G5HthyGQkcnY+InXArEH6d44 qHjWnIzI4BDV33GjpjJmA76uhX3le4P6jPoswMCI6kqzTsxLnyGGpiT5u9Ah4DOa+Qu3 ybfjYRICE/wpZgNcNXFRwSSz5aYiEWdAP/CIr2Fa3ba9Q3UBmvSP77HzPlM6Ptx0chSg JZX26qQ7yzb2HTnj987dKKa/ITw/LzykzSjTfsEmYoaG13NdhasD42GFHoxuYoYeLDde YhqA== X-Gm-Message-State: AGi0PuZKwEr5saM9G9mvhJSTjgTyNjctZqrKOVWw7Lioai4APNKCUTOh XhsuzNz+17r3ZUAs5hgYjlQ= X-Google-Smtp-Source: APiQypKUFx7xiO97y+DPZ56FOSEsOrWDqQqCdDNVc1dBdv5MmkUvE7G1Uw75NE4CSmA+zrU1ruODtQ== X-Received: by 2002:ac2:5559:: with SMTP id l25mr7555966lfk.55.1587763928165; Fri, 24 Apr 2020 14:32:08 -0700 (PDT) Received: from Sovereign (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id q6sm5047761ljg.67.2020.04.24.14.32.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Apr 2020 14:32:07 -0700 (PDT) Date: Sat, 25 Apr 2020 00:32:02 +0300 From: Dmitry Kozlyuk To: Fady Bader Cc: dev@dpdk.org, thomas@monjalon.net, talshn@mellanox.com, dmitry.kozliuk@gmail.com, harini.ramakrishnan@microsoft.com, ocardona@microsoft.com, anand.rawat@intel.com, ranjit.menon@intel.com Message-ID: <20200425003202.4e0e74b2@Sovereign> In-Reply-To: <20200423144350.4016-3-fady@mellanox.com> References: <20200423144350.4016-1-fady@mellanox.com> <20200423144350.4016-3-fady@mellanox.com> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 2/2] timer: support EAL functions on Windows X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" On 2020-04-23 17:43 GMT+0300 Fady Bader wrote: > +uint64_t > +get_tsc_freq(void) > +{ > + uint64_t tsc_freq; > + LARGE_INTEGER Frequency; > + > + QueryPerformanceFrequency(&Frequency); > + /* > + QueryPerformanceFrequency output is in khz. > + Mulitply by 1K to obtain the true frequency of the CPU (khz -> hz) > + */ > + tsc_freq = ((uint64_t)Frequency.QuadPart * 1000); > + > + return tsc_freq; > +} QueryPerformanceFrequency() output is in Hz of TSC, not CPU clock. To get real time interval from TSC difference, we divide that difference to TSC frequency with no additional 1000 multiplier. P.S. Fixed my address in Cc. -- Dmitry Kozlyuk