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 CDDC2428AF; Wed, 5 Apr 2023 11:00:13 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6990E41153; Wed, 5 Apr 2023 11:00:13 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 87DB041151 for ; Wed, 5 Apr 2023 11:00:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680685211; x=1712221211; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=ZDSl0yurQzuQjBAmTq11R70Z5tIFCP3xNO9HTne1xds=; b=aK4nzflDwM/Bh+skDSCtR2XVbM3moOaqvkryJX7UNDUyJ54jdnXPLFAF GnCRoVC1QuvsI+zRqhTD9nNAlAhz0Xrttx6osTfdfkgpY4XOw6P3AAer2 3GZGvE5JX3mvUjfk5/QSdaYpOPm8hyp59ffbWzxI8kIGI+8wzvKQF669A WjhrX+kB7+k1UjfjQj5hcwWsQ5fPKtccwG/anFKLTpSAltryqMAvt5G7B elpNOwrsOfS+L8150bDIpSh9YyqaSAw8IQo96lSH2RZEH0p0BH2IjiwHf cOjEH1o+5Krxy6jD5lB1OxSPBZI0bQvMrr452QPLYf7VzPzAC49vrIxO/ g==; X-IronPort-AV: E=McAfee;i="6600,9927,10670"; a="344118539" X-IronPort-AV: E=Sophos;i="5.98,319,1673942400"; d="scan'208";a="344118539" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Apr 2023 02:00:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10670"; a="1016404396" X-IronPort-AV: E=Sophos;i="5.98,319,1673942400"; d="scan'208";a="1016404396" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmsmga005.fm.intel.com with ESMTP; 05 Apr 2023 02:00:09 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Wed, 5 Apr 2023 02:00:09 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Wed, 5 Apr 2023 02:00:08 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21 via Frontend Transport; Wed, 5 Apr 2023 02:00:08 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.169) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.21; Wed, 5 Apr 2023 02:00:08 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A5N4bTEuHVluYY6y9AheFB/G4RopAoS0B6vBlJBm8K/xwOcNbkRv9ohMHDgth2lwLFscqHb14/GB2/tcyqsngNSSbYXMskEtEsrXGYbpWXFRJEWi+Htp11tQUmfcmMgioPLbTZgDr8zZ0CBXZAD0uhC/aoknQuPnygfayyBzOlUOfK+GUIg3arPWS2UPQVGuXvrMfbLJD1ry+egGEztt9WAYPhB4+O9anwV8Y+MmoVF5TW7PMwEHFMIA13s96cLdW4hXuD/8pesmVh/eoFtuQbD5MsweX3TxXX197+UBcDryZtEQ2d4iYgNRz4NpI+paMyP24cmVnRA5DDbZztI9Vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9XqKzeJLmkQwshiO4cf8OAVKAbJSwE0bmQZl0fpz/rs=; b=HcsJWGEJgHVlMmwVZB18xaZ4wjftdqOu6XnKMf3mUvAdS0FXibzclVeRAGKDqNuAYEsApFFP9fw+d8J+HoVGCYskfOhZlXgmM0UJIVf8/jaBS/ah6CGVDWKxb5zf3eooHYHk+ZpAZae/8tmnwjsbDEUcRPG7r/TMjE1JgOHTJgLS1Z9K9kvJDNaA6KG/Y6VaFL/UQgPgPUt4XW/ch7jLsI/shCHzDszvCb+fwA5xRBWEnaSnhekp+ybbw2X1XbpJBYJwmoEqWlAHD0AArKnpFTsSvnOCqFfWvH6QUIQH39W4VqHtOxkOj6dHelMC9dTGWV/j09T7BdQpCCaa90TYjA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) by CH0PR11MB5491.namprd11.prod.outlook.com (2603:10b6:610:d6::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.35; Wed, 5 Apr 2023 09:00:01 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::18d0:ac53:aa1d:d19c]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::18d0:ac53:aa1d:d19c%6]) with mapi id 15.20.6254.035; Wed, 5 Apr 2023 09:00:01 +0000 Date: Wed, 5 Apr 2023 09:59:54 +0100 From: Bruce Richardson To: Tyler Retzlaff CC: , , , , Subject: Re: [PATCH v2 1/9] eal: use rdtsc intrinsic when compiling with msvc Message-ID: References: <1680558751-17931-1-git-send-email-roretzla@linux.microsoft.com> <1680638847-26430-1-git-send-email-roretzla@linux.microsoft.com> <1680638847-26430-2-git-send-email-roretzla@linux.microsoft.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1680638847-26430-2-git-send-email-roretzla@linux.microsoft.com> X-ClientProxiedBy: LO4P265CA0094.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2bc::9) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|CH0PR11MB5491:EE_ X-MS-Office365-Filtering-Correlation-Id: dbf689bd-afc3-4323-261e-08db35b42356 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +9askgdDEQ0Co4I0oCK4/yjkH6VvbwXn6nAzFsac7VloHuOijQ13ESTuuTK6TTvptjPqDHYkPPQf/Df/Q9zBOaK2YZ8m+c4VVj1LgXA3BKeJw9pObpytQWkB6HsamuLFYpvnuJEonC0pbleZ0xgAX9Gz677SnynxorOxZhPeRHGZSnQENUZySyvpbFYEtQU3bXwPDLa13yJbuenmCvWdc6aWW/RthqBZS40aE2ycxJVjz7Ze9h4n0NTRDhW+Q41CsBDXDdFxbg5xUvjkaUQ0Rb+4jR1Ea8jQSXjk+ASqhL7RoV5EvLnOi21VNM0LLZEFHC5rzO6xvvYLlbkVb9vaIxJC8F8EQQhQt6bKcBRd0X86IGkzC4SU8twWhu/UKz573FYnJbhAPUewj8BGYN0x2X2DB95ahu0y58DkLyN+zOlyL4IiijKUdlEk3M3gwAXw3R98C1eoiEnZ7Jprm2V51/V04/bH8ipUQ2vW3ixauo1W55JxAJLkMUmzYoScfwOZNqNsnDL/vGeepUrIlsNMa59g/wDqA8VLJ3qC/HeprJPJ9O39K7Kg5IpeXOtwr0zk X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR11MB7309.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(396003)(366004)(39860400002)(376002)(346002)(136003)(451199021)(6666004)(186003)(26005)(66946007)(8676002)(6512007)(478600001)(41300700001)(316002)(6506007)(6916009)(4326008)(82960400001)(66476007)(66556008)(6486002)(38100700002)(86362001)(5660300002)(2906002)(44832011)(8936002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?izqEebsnqBhqpYfL2N0XSvBzLDBAfK4whcKLiyvq/TH1CqjPTZ0kLxyPdY5l?= =?us-ascii?Q?49ouyJzpaFC3XCuDZlCcYsToMxMCy90CK8H9+Co0u8ScOqWJlLyKAb5b3Lwn?= =?us-ascii?Q?j+4ZBhhOR6Aa7VM+RiI7pKqZfIzRmorY289TuNHGfRfEbD+QEiNqqtMNvJU0?= =?us-ascii?Q?iTXHAtJwkPG6PFq47TWdx+hgiYSdArOkXfaWe+bX64El3er7hnYpzBHl3Zl9?= =?us-ascii?Q?e0Tce5OxtT75MPUnO6ZStzD4a1pqtsrfN65wXsccPDpkgZ4OlQUjG11O2C9M?= =?us-ascii?Q?wYFIn6r6VvmUoMrWVL19P9x7CjQUV1WfRVG4lqj0v8jL3rtW+pU1W5xh0m7i?= =?us-ascii?Q?UQYtSJmlYx3qJ0n5Bu5o5PQwi/oyVWHN6xD/E40EDIcRTp7aXC9EZ7QsBHyI?= =?us-ascii?Q?E/DqL7TuWHpnnUvz+05DStCOSajErNm64SPhvatzf4miNDnUb63+WRHhHzbV?= =?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CZ8MZF5dNuFnXOxGDN61d2wy+0RX3cJ7LjYC?= =?us-ascii?Q?68o0HrHgKvtLKOwHb4fW0X1BQO1Y4vLaK+7xK5PSRzH4EP+LA7aMgso21CZb?= =?us-ascii?Q?M4MgBBO1jDkTOvW/p/G1DK8Bx8qOF7ZES32O8r4Jd1P0OYjDWo1PXJ0PQvF7?= =?us-ascii?Q?8w8X8OrmOScNk5iN2+zTkz7mLsoMPNO/94YxE82PFItU53dDLNOmfQ5DW9nW?= =?us-ascii?Q?2flzKP1HitLl3cXmeeVMocfp3b8zlNoZOYFyYNBd4VQHgk39/q4StoyB3Znc?= =?us-ascii?Q?zQ=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: dbf689bd-afc3-4323-261e-08db35b42356 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Apr 2023 09:00:00.8775 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: eG3cXAM0NthJrsE1osygQ1pWyDDI2xO72vjwNFKoCExT7i4hIrtrHf+AMAm5VYzMsdqQmMEdhHBY0RKPYtgXbN0kjyGUHqwe1+3ZSp7aonE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR11MB5491 X-OriginatorOrg: intel.com 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 On Tue, Apr 04, 2023 at 01:07:19PM -0700, Tyler Retzlaff wrote: > Inline assembly is not supported for msvc x64 instead use __rdtsc > intrinsic. > > Signed-off-by: Tyler Retzlaff > --- > lib/eal/x86/include/rte_cycles.h | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/lib/eal/x86/include/rte_cycles.h b/lib/eal/x86/include/rte_cycles.h > index a461a4d..0c142ce 100644 > --- a/lib/eal/x86/include/rte_cycles.h > +++ b/lib/eal/x86/include/rte_cycles.h > @@ -6,6 +6,10 @@ > #ifndef _RTE_CYCLES_X86_64_H_ > #define _RTE_CYCLES_X86_64_H_ > > +#ifdef RTE_TOOLCHAIN_MSVC > +#include > +#endif > + > #ifdef __cplusplus > extern "C" { > #endif > @@ -23,6 +27,7 @@ > static inline uint64_t > rte_rdtsc(void) > { > +#ifndef RTE_TOOLCHAIN_MSVC > union { > uint64_t tsc_64; > RTE_STD_C11 > @@ -47,6 +52,9 @@ > "=a" (tsc.lo_32), > "=d" (tsc.hi_32)); > return tsc.tsc_64; > +#else > + return __rdtsc(); > +#endif > } Checking with google it seems that gcc/clang have an __rdtsc intrinsic as well, so we may be able to avoid ifdefs here completely. /Bruce