From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpcmd0641.aruba.it (smtpcmd0641.aruba.it [62.149.156.41]) by dpdk.org (Postfix) with ESMTP id E2E2591 for ; Wed, 28 Nov 2018 11:35:13 +0100 (CET) Received: from LANZUISI-NBK ([93.146.250.201]) by smtpcmd06.ad.aruba.it with bizsmtp id 5NbC1z00L4MU9Ql01NbD2j; Wed, 28 Nov 2018 11:35:13 +0100 Received: from [172.16.17.52] by LANZUISI-NBK (PGP Universal service); Wed, 28 Nov 2018 11:35:08 +0100 X-PGP-Universal: processed; by LANZUISI-NBK on Wed, 28 Nov 2018 11:35:08 +0100 To: "dev@dpdk.org" From: Matteo Lanzuisi Message-ID: <55824f2a-44b5-1245-47b7-b9e3fd1b92eb@resi.it> Date: Wed, 28 Nov 2018 11:35:07 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: it DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aruba.it; s=a1; t=1543401313; bh=IVbN+iMqgCydKCcW0TX4nh2yXEOG6MJ0N2R1nCq/ryM=; h=To:From:Subject:Date:MIME-Version:Content-Type; b=PJlebkbhy98KwvD3VIV5r0yibxuBnZqzMDIyxSW3Iipv2fYphTcyAZ17kjmKcdCOL TIm5VXnEBkt9/db1gKXKFc2pOpl/+h/d72DAZ85O3PqY5hVrSOfgPZPJ19Fu3H90sQ xJUkcsUxaUiCqEk/ZFL1b9u7//7myLVfJeqvDZ+JE+aFlM+uFG08UDyo0k2u5Srvbh bKU2MI0dLqyPsDi2UksM3GDz/Yqp0OO6U8o66Q/BE1jbAU8zTk79wrDFlf0zsygJu1 fTDzm2qbVdKW5vf/ckwZSJE3dmlYShO1pS5KF8rRS3JxSACt04226kjYr+70WWeirG Y1FPGqJ+mbvUw== Subject: [dpdk-dev] set_tsc_freq() wrong return value - bug? 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: , X-List-Received-Date: Wed, 28 Nov 2018 10:35:14 -0000 Hi all, during some tests with dpdk 18.02.2 on RedHat 7 kernel 3.10.0-862.el7.x86_64 using Intel X710 and 2 x Intel(R) Xeon(R) Gold 6130 CPU @ 2.10GHz I found the following. I put some log in the function set_tsc_freq as you can see below void set_tsc_freq(void) {         uint64_t freq;         freq = get_tsc_freq_arch();         RTE_LOG(WARNING, EAL, "Function get_tsc_freq_arch() returns %lu\n", freq);         if (!freq)         {                 freq = get_tsc_freq();                 RTE_LOG(WARNING, EAL, "Function get_tsc_freq() returns %lu\n", freq);         }         if (!freq)         {                 freq = estimate_tsc_freq();                 RTE_LOG(WARNING, EAL, "Function estimate_tsc_freq() returns %lu\n", freq);         }         RTE_LOG(DEBUG, EAL, "TSC frequency is ~%" PRIu64 " KHz\n", freq / 1000);         eal_tsc_resolution_hz = freq; } the output of this function is: "EAL: Function get_tsc_freq_arch() returns 2100000000" but with this value if I use the rte_get_timer_cycles() in my application and try to convert the return value into seconds I saw that the more time passes the more date is wrong. Moreover, if I comment some rows in the set_tsc_freq function this way void set_tsc_freq(void) {         uint64_t freq;         //freq = get_tsc_freq_arch();         //RTE_LOG(WARNING, EAL, "Function get_tsc_freq_arch() returns %lu\n", freq);         //if (!freq)         //{                 freq = get_tsc_freq();                 RTE_LOG(WARNING, EAL, "Function get_tsc_freq() returns %lu\n", freq);         //}         if (!freq)         {                 freq = estimate_tsc_freq();                 RTE_LOG(WARNING, EAL, "Function estimate_tsc_freq() returns %lu\n", freq);         }         RTE_LOG(DEBUG, EAL, "TSC frequency is ~%" PRIu64 " KHz\n", freq / 1000);         eal_tsc_resolution_hz = freq; } the result is "EAL: Function get_tsc_freq() returns 2094994596" with this value the conversion into seconds from rte_get_timer_cycles() is always correct. Is this a bug? Or am I doing something wrong? Regards, Matteo