From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0067.outbound.protection.outlook.com [104.47.40.67]) by dpdk.org (Postfix) with ESMTP id 415A85A3E for ; Mon, 1 May 2017 21:12:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=4e7Gaec62oR71lgVefXmxqzDoHXRgSgOSbNIV2l/Y84=; b=SbbYxGVFeIa8A5krjr7u5YXKGiPkSSbaijBvn27mcxqVGRTYB+D9ikfe37XVWN/wSCslq/ywCtrtbzj+l4dpC7QmDPsLrGHcMDGZbJcusFCx5j3QuLD/q7gpylp5p5g/EvDCWBRbG3vtqQdzephmbZiuNugMAQ+fDt6Fqp1fvOg= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=caviumnetworks.com; Received: from jerin.domain.name (171.76.125.157) by BLUPR0701MB1714.namprd07.prod.outlook.com (10.163.85.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1047.13; Mon, 1 May 2017 19:12:30 +0000 From: Jerin Jacob To: dev@dpdk.org Cc: thomas@monjalon.net, Jerin Jacob Date: Tue, 2 May 2017 00:42:07 +0530 Message-Id: <20170501191207.6480-1-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.12.2 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [171.76.125.157] X-ClientProxiedBy: HKXPR03CA0020.apcprd03.prod.outlook.com (10.163.104.20) To BLUPR0701MB1714.namprd07.prod.outlook.com (10.163.85.140) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5d963f7e-f120-4c15-938c-08d490c60472 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:BLUPR0701MB1714; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 3:7A5f90Q/49AcRsB8w85LXOpZ1/MD1jzhGR7ffdlSXtC2BRLzLXkgivaG51rdcxiPAKny/HjwhC05+tRZ/o+SlITIVm+iSEJRcy+Z/t3+RqQQ5hZrLYDDiKt0E5CNfpiThaTRLIN4q7wXM0ro3wn0WlveIL/iZYKeFqtUdD/jjFmuiBGH3UkMJHe7WX6W3tS0JQmuPCBb//H6iWinODAgldJpanSWh8CywqJSoM8cwmRtYJgPQ+jYp/91AZkPPKDlwvnryyQdN/IwAj2hoW9SoDDhxgE6pMLkFgX9za2LeW72cjPQ0MY2TTLa6n/TKxV4YvcZjn0ca996s6Es8KidjA==; 25:znr7b9DSLyOBOb8Ii9LqGoxDFMph4uFKI/bJaz6ambHDiBPeoMXNXWQtJJuW9vna6f48zd4DeWJTcNqJTsF/2+rHtomgKdOi+Y4A5tONGuTIWIvJHFmQS7vBix5z9JsKyuZXhsof9MgCdFyXfC1BRW2vS8XAwZT1BBHyB6/okvkxb5H3gaJdGS5dZI4VOKViT1WbKAFE4j6XA5RQdFyEw2NR6ghBrc85MpQdpr+BaAkvkLhvgLaRAShWjUIMWxcH8GQPSGiMlhp+M96AKx8ZOF7A2xkcoUR9ZtShJlQJEE5qjERY3pyqXTdeRe0asjbNhGWwjCrQiC4FUMQM8t5Gi4KSzVr/nd1mbBDHeo/fK0zJw0BAeoWC7l/34xmAHaRXDmtMSQXM39sMhnTOJlQ0o4pP9j95ccsku0FpUNT6/bdkAJg41ICyzMKO0Nmsvr559GKDdeIwy+nGNpEA7WzxIw== X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 31:sB5U9Swptg/G5/HXANtdsr1GQ1n/QhS87uKRyTN8CNMvWM/K46YmhFsxqpi8rQiBhY76thFWP+NvVol/f+4hH+H6IZJCtIYhib8EmIwB1/aR2ZIz8q4HaHYlbiOKcNC3K0YF/6SrNSDVsM4xFBLJquTp7Tr4QbUXH6HZnYkrs0f6S9wy8l9L6e/vzAvc6gD2wXlAU6efQ0ag4UmXEW7UbMEophLaE4KOB6QaYhz4Tnw=; 20:THIqArp5G/7ru7saC1dnKvsk6n/j6xC56x4/hBB15diU2KOvffp0wel540EokrsTfGZHcMTzXgwe7WwD3LDa6OxO3S+hL8hqM9cin/7xO2NR36+2G5Aq//aj9gdh5Ai9+utNxagpOJob4orjGKYHsEpzi3TfbWcxszoZ/u9+MsJ9ZUxFG9+4ZQXnOZ1GFaxnxihtvkQmXG0I2tBFVt4VrucURKaVFtc2XIJB8VUrl+5iWcDG3fjZ4BKYcvZQOQ7IxvS99IxKa16xq3sZJIcN+AyJxBbC1HviMz3tHhmgJhJdpI//h9w9BYG6ZnztujLtUca67k19QI2RXzagj6ZdeYvkj4CiEoRw0P5eLpXrVRIlR7f0D05Rp3TXUaBixRIff7amlA+50H6n3LIf/xu64BR0tTxi9SJOIiFoBqFxUppi94A4dI2HDgD0pR3Tt/i8mq+OBj6n7gV8/lFK4bGI3OPwSqRuEs2wQ63PyBjoK74kpp/04YnyMgf0JifbiMcs1CoKxLZNi5rpcdPi8XRkoPk1CmwbK+wzZgGhZEU0CS2TyYHaGLmqF6t4r1ad72gtPOtBQaNKI60Zf+rK3oFTQ7VuGefit9ZDe4P1mqNRAkw= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(10201501046)(3002001)(6041248)(201703131423075)(201702281528075)(201703061421075)(20161123560025)(20161123564025)(20161123562025)(20161123555025)(6072148); SRVR:BLUPR0701MB1714; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1714; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 4:C49R1RtaP3qrpVvNj4lqeDmximzhfrrDJJL0LjkM2hl7sTlwU++8tdh850WbAvfllpYjGjf+Tv+BG05dEHq0q8TL1cbJBrEfSvsIDgAEtXIFgL4awqTvO5nUMaAP3fDr3XOpSXuCy2uL9k7u74F0HJpYrFMZQOtuwEW/aYNA7/bHaRctJCpaSqeSZkt2d4vEZ909qeUoavDe7xNNKEgN8Kq3al9bh9iwtYnTiZ4yOyHtqzO4PaG1wqbhOE3a9WLmsct30aTbeBfyW38TX41s4T6I9t3GNlcL5GW9Q5Jv4kPlDF2fImMilM2TcCWD+zc3YemKvVqelOyA2VyhnHnQ4WfFv1kP4euq/HC9sXTr/FH7yIBq8jP2S3lCdko5LsaktCHo1R5AwNqiOY59VKUGWGs16bfx5Vw7BqheaFMO0aZt3AXFC+hZ0tJ1V1KJx/C355Yn3tNUmY9eTOshi8pIpm7VvGCRj5RfZ4SAhdhDSei21SeleSlrkFIXcuGoxWgHkYEzAd2goC3KM4uP7qPM9W/hGuy60Uz8izfZcR7J/iHJXf/o801QA6snl8iw524/vwOBmK/cCdPytnL/NfC7mW2dW0YKRXIt4PFfYfFeUSwhWgB09gOm8jHHEcQTBwAuaY9gtvna5WfJNL7bmaMGk4PZV4RL8uXexYFAZjTZDpPAA+wv2KvN2yYchCVh8oOM X-Forefront-PRVS: 02945962BD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39400400002)(39410400002)(39850400002)(39840400002)(39450400003)(189998001)(25786009)(53936002)(5003940100001)(110136004)(47776003)(6486002)(81166006)(107886003)(50226002)(8676002)(7736002)(6666003)(42882006)(2906002)(305945005)(6916009)(36756003)(4326008)(38730400002)(1076002)(5660300001)(6116002)(508600001)(3846002)(33646002)(6506006)(50466002)(48376002)(42186005)(2351001)(53416004)(50986999)(2361001)(6512007)(66066001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1714; H:jerin.domain.name; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1714; 23:+zOh09rgIJ1BJzMMFt6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RFPLpng9Y= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 7:BHHh2jIS04SpPur4p8Vd2aGHPD85gvHGFFYQKAcKQBaSmpFwGLr1bvP6dhWBvGnp0KV6y+5MCObZNqUIY7Z1BEZ5N5tth6+NhV5wu46A/1iMknAmPag9lop4mf9V+W0fSQxxH0Y6NYjRCkgVl0mjEmSoJANWYYWy9BvxP7kmAMPi7zXEdhv8koD1KT8M3rpF7Q7hg7OTNnG3TLCq4GIT3isbdKSYOOiEqzRJPeYNbo89l6S5JOhkoreqKAIMXYC6IAbqdqW4lSbQF2A/zZ8VYmphnPgSqTc5AkmTGn6Gr8mz/6fPnIH0zo3R+Lzv7owOu6AUQYdYhQPKgl0Xb5q0+Q== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 May 2017 19:12:30.3210 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1714 Subject: [dpdk-dev] [PATCH] eal: optimize timer routines 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: Mon, 01 May 2017 19:12:36 -0000 Since DPDK has only two timer sources, Avoid &eal_timer_source memory read and followed by the switch case statement when RTE_LIBEAL_USE_HPET is not defined. Signed-off-by: Jerin Jacob --- lib/librte_eal/common/include/generic/rte_cycles.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/librte_eal/common/include/generic/rte_cycles.h b/lib/librte_eal/common/include/generic/rte_cycles.h index 00103ca9f..2f3dea06e 100644 --- a/lib/librte_eal/common/include/generic/rte_cycles.h +++ b/lib/librte_eal/common/include/generic/rte_cycles.h @@ -150,15 +150,17 @@ int rte_eal_hpet_init(int make_default); static inline uint64_t rte_get_timer_cycles(void) { +#ifdef RTE_LIBEAL_USE_HPET switch(eal_timer_source) { case EAL_TIMER_TSC: return rte_get_tsc_cycles(); case EAL_TIMER_HPET: -#ifdef RTE_LIBEAL_USE_HPET return rte_get_hpet_cycles(); -#endif default: rte_panic("Invalid timer source specified\n"); } +#else + return rte_get_tsc_cycles(); +#endif } /** @@ -170,15 +172,17 @@ rte_get_timer_cycles(void) static inline uint64_t rte_get_timer_hz(void) { +#ifdef RTE_LIBEAL_USE_HPET switch(eal_timer_source) { case EAL_TIMER_TSC: return rte_get_tsc_hz(); case EAL_TIMER_HPET: -#ifdef RTE_LIBEAL_USE_HPET return rte_get_hpet_hz(); -#endif default: rte_panic("Invalid timer source specified\n"); } +#else + return rte_get_tsc_hz(); +#endif } /** * Wait at least us microseconds. -- 2.12.2