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 BA6A042926; Wed, 12 Apr 2023 12:29:28 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A51CC40FAE; Wed, 12 Apr 2023 12:29:28 +0200 (CEST) Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by mails.dpdk.org (Postfix) with ESMTP id 0A1484067B for ; Wed, 12 Apr 2023 12:29:28 +0200 (CEST) Received: from frapeml500006.china.huawei.com (unknown [172.18.147.201]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4PxJmT0TTXz6J7HP; Wed, 12 Apr 2023 18:27:05 +0800 (CST) Received: from frapeml500007.china.huawei.com (7.182.85.172) by frapeml500006.china.huawei.com (7.182.85.219) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Wed, 12 Apr 2023 12:29:27 +0200 Received: from frapeml500007.china.huawei.com ([7.182.85.172]) by frapeml500007.china.huawei.com ([7.182.85.172]) with mapi id 15.01.2507.023; Wed, 12 Apr 2023 12:29:26 +0200 From: Konstantin Ananyev To: Tyler Retzlaff , "dev@dpdk.org" CC: "bruce.richardson@intel.com" , "david.marchand@redhat.com" , "thomas@monjalon.net" , "mb@smartsharesystems.com" Subject: RE: [PATCH v4 01/14] eal: use rdtsc intrinsic Thread-Topic: [PATCH v4 01/14] eal: use rdtsc intrinsic Thread-Index: AQHZbLpb/4wQdge6hECzu8NZS95e1a8necig Date: Wed, 12 Apr 2023 10:29:26 +0000 Message-ID: <31034d7fb6e34143a4a8aea81d7b1a57@huawei.com> References: <1680558751-17931-1-git-send-email-roretzla@linux.microsoft.com> <1681247548-18590-1-git-send-email-roretzla@linux.microsoft.com> <1681247548-18590-2-git-send-email-roretzla@linux.microsoft.com> In-Reply-To: <1681247548-18590-2-git-send-email-roretzla@linux.microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.206.138.42] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-CFilter-Loop: Reflected 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 > Inline assembly is not supported for MSVC x64. Convert code to use > __rdtsc intrinsic. >=20 > Signed-off-by: Tyler Retzlaff > --- > lib/eal/x86/include/rte_cycles.h | 14 ++++++++------ > 1 file changed, 8 insertions(+), 6 deletions(-) >=20 > diff --git a/lib/eal/x86/include/rte_cycles.h b/lib/eal/x86/include/rte_c= ycles.h > index a461a4d..cca5122 100644 > --- a/lib/eal/x86/include/rte_cycles.h > +++ b/lib/eal/x86/include/rte_cycles.h > @@ -6,6 +6,12 @@ > #ifndef _RTE_CYCLES_X86_64_H_ > #define _RTE_CYCLES_X86_64_H_ >=20 > +#ifndef RTE_TOOLCHAIN_MSVC > +#include > +#else > +#include > +#endif > + > #ifdef __cplusplus > extern "C" { > #endif > @@ -23,6 +29,7 @@ > static inline uint64_t > rte_rdtsc(void) > { > +#ifdef RTE_LIBRTE_EAL_VMWARE_TSC_MAP_SUPPORT > union { > uint64_t tsc_64; > RTE_STD_C11 > @@ -32,7 +39,6 @@ > }; > } tsc; >=20 > -#ifdef RTE_LIBRTE_EAL_VMWARE_TSC_MAP_SUPPORT > if (unlikely(rte_cycles_vmware_tsc_map)) { > /* ecx =3D 0x10000 corresponds to the physical TSC for VMware */ > asm volatile("rdpmc" : > @@ -42,11 +48,7 @@ > return tsc.tsc_64; > } > #endif > - > - asm volatile("rdtsc" : > - "=3Da" (tsc.lo_32), > - "=3Dd" (tsc.hi_32)); > - return tsc.tsc_64; > + return __rdtsc(); > } >=20 > static inline uint64_t > -- Acked-by: Konstantin Ananyev =20 > 1.8.3.1