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 A05D3A0579; Tue, 20 Apr 2021 11:10:00 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7842341529; Tue, 20 Apr 2021 11:10:00 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 3E3A4411A5 for ; Tue, 20 Apr 2021 11:09:59 +0200 (CEST) IronPort-SDR: xWHwUK3oSbtzezyR7QgmLVRyGTMdzV1HCnHiZTWR6YJ7Lj0kM8ruqYttCFAwP6EQjD0EcSZslI ODYQD007t8ww== X-IronPort-AV: E=McAfee;i="6200,9189,9959"; a="192286310" X-IronPort-AV: E=Sophos;i="5.82,236,1613462400"; d="scan'208";a="192286310" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Apr 2021 02:09:56 -0700 IronPort-SDR: J/496KWGV6tnOsNSMMhh/QV16CnBWkJuV1NpU1RzU+luN9Yy26S75Jt2EK2l9BMS0ZdEdhUKtZ uhzk+YZwreJA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,236,1613462400"; d="scan'208";a="420331898" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by fmsmga008.fm.intel.com with ESMTP; 20 Apr 2021 02:09:55 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Tue, 20 Apr 2021 02:09:55 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Tue, 20 Apr 2021 02:09:54 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2 via Frontend Transport; Tue, 20 Apr 2021 02:09:54 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.172) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2106.2; Tue, 20 Apr 2021 02:09:54 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mw58jYw28oJ1d3OfOFuaEyP2CWuAfrm+ygLVrYian63Bx/VHEcAucrKU110H3uyBcqRXT1n6Ulg1SiMBr1Hfe1gV3TPCn/m+q24fflwVzW7wNdPQQKGKABiyMArRuo8W9bbOHZNvavfQ5LBCORzs227+/pFeSBCZHm8GxalCp24Kw6rifoyoC46ZQOtgUW5onw/apbMqWYMxIsW3MD7Q4sYl4whPFDoTOJOoKti74JCfrapjAAoyA6hNFqUgm9CbfPJZDXxhpvTauNKphNEJzUh+uiO20hq/1EvkurY259AH8GYCO5uOcunzI2aLUxSyyrbbyDAnehJveH86IGSsGA== 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-SenderADCheck; bh=qbbZwTqqylObIn2h35FcNzFtkeT6+wLUL9lpKHdeMg0=; b=YBM9OvoTa4cpTaMqo6gsvsAWWimJDr6xWD0rWifreI7zzbXFHqNZgMwtbabgUm0oSSVCrM186hu0Z3vOnTcJ5QtOfYeKYdVIPWKIuvWLJuPW3/6c5Dz1SZxWKsRfAVIypQ9Hk9UVRIj7oxhKsroZJnXLi3xLnc+rwfsLr6y5L10IH/OJPKL2Dqq3yzw39qe0k9akRipqxk+5Upsz9Zm4WQGO2wVDmgao/eEnHuV5rPlHcn6Pw9dqDD77Lhxhdc+8nTh+Jb5md6oUULj5qwQlFlE4XjQC3KKP5GsamXOQQqgv2glZk0opYAxk6HdE7ZvVF7hulRN9WV8wkZ+MQiQ63A== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qbbZwTqqylObIn2h35FcNzFtkeT6+wLUL9lpKHdeMg0=; b=GRhhNYz54G5jq5MYZVvmUMvz037rBlNDhTQDAdbToRuOwAiVSlWl+kZVcaduw+sIvkrn/SjT5S8KVdlNjh2xJ/yEtZVgshfSTLH+U9yWtzXbPLA1HYKRRst9Z5HrXVzWb1izFHBy3JkwisG7E7AkRTOIV69qNvzS6VM5m3enaic= Received: from DM6PR11MB4491.namprd11.prod.outlook.com (2603:10b6:5:204::19) by DM6PR11MB3577.namprd11.prod.outlook.com (2603:10b6:5:137::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4042.23; Tue, 20 Apr 2021 09:09:52 +0000 Received: from DM6PR11MB4491.namprd11.prod.outlook.com ([fe80::3182:6da2:8c64:f07a]) by DM6PR11MB4491.namprd11.prod.outlook.com ([fe80::3182:6da2:8c64:f07a%3]) with mapi id 15.20.4042.024; Tue, 20 Apr 2021 09:09:52 +0000 From: "Ananyev, Konstantin" To: Jie Zhou , "dev@dpdk.org" CC: "dmitry.kozliuk@gmail.com" , "Li, Xiaoyun" , "roretzla@microsoft.com" , "Kadam, Pallavi" , "thomas@monjalon.net" , "Richardson, Bruce" , "Yigit, Ferruh" Thread-Topic: [dpdk-dev] [PATCH v6 05/10] app/testpmd: add clock_gettime_monotonic Thread-Index: AQHXNXKtOr+tHd4GzE6/P09dLKj0sKq9HmTQ Date: Tue, 20 Apr 2021 09:09:52 +0000 Message-ID: References: <1618595864-27839-1-git-send-email-jizh@linux.microsoft.com> <1618874400-26819-1-git-send-email-jizh@linux.microsoft.com> <1618874400-26819-6-git-send-email-jizh@linux.microsoft.com> In-Reply-To: <1618874400-26819-6-git-send-email-jizh@linux.microsoft.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 authentication-results: linux.microsoft.com; dkim=none (message not signed) header.d=none;linux.microsoft.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [109.255.184.192] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 260d4271-7c3f-4383-6121-08d903dc0ef3 x-ms-traffictypediagnostic: DM6PR11MB3577: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:568; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: CwaYLm7AAHFihtTeDzwOcez/9/f+aQkQT1Q2QIVndbIKgcc4Nqo67HzmSqp/7Q90VF+Dd2HDtFKkNFmkWS6sKk4YRGIGQNtdQJHrSZkJRG0m5Qkqcijp/13LvIXtmVyV0Etw2WLMJdPFuhvwoWY1LYrVkffrxdEfyPGZXHguZ97DN4a/KqcNYlPv3wpQWSeI3LVDfSzC87SbP/erC2GARNd1bw624yM/3AFk+LhGvVR4W80x+B7uGs2ikejxsbcH3g6RbmT/4lY2Buw16TU1WTMlok6bTVVRMiWEXOZ/1ResK6lfy/U/sesuCIImmmLBijA+PO2cmk3qcNgjk2oAE6i5PEHVjMhn30wairycswtByrxx77Y3v5gHXVae59Dwuum3C3RqjyWA7E4qPS2lpfLkuKil9sorQ4Ma1TqZQEfm5WTRq5W2+ntAlbupsdCu8vRhivnGvBr2bJXl/dUvsukyVjl0gi8+RJ1vr9q0MvrIaA1ax920YNCo0K+a/I4pf7nBQrGmqW5GovC3fulkz5jdK+r2/FvcyEeZRNDWJFOJUrwCqS7YkzOGiGwmay9mgo44WVlu2+Nh96Ad2kAPAvk6M5x/sYydXNybhkQ0uW0= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB4491.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(39860400002)(346002)(396003)(136003)(376002)(6506007)(55016002)(8676002)(478600001)(26005)(316002)(66446008)(122000001)(52536014)(86362001)(9686003)(38100700002)(110136005)(5660300002)(54906003)(8936002)(107886003)(186003)(55236004)(76116006)(66946007)(2906002)(83380400001)(64756008)(66556008)(71200400001)(4326008)(33656002)(66476007)(7696005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?KIYdypsdboUhK+Moj6b8sdSrjnRjdVjIKurO1k7nvoMpIgdoSrGyXkOFNWn+?= =?us-ascii?Q?X6P/6CiyCR0AkOJdjv3iZW99mMj8+cM6mLJre5hwO0FMELYdPMqlZKOleeFi?= =?us-ascii?Q?vREwCOMh4bW51AJXN4Lp8wpwxcpqvt4qJrmVv07icolT2LHtxyw05L+6BBxh?= =?us-ascii?Q?oSDd1B+a+oL1RKTS6vMbxvxax1qt9WjWufY6D7xG+skPCT1vzEdK3bPaO2OV?= =?us-ascii?Q?K+MJwAEYKAcWf4UjJzzC0F+X5GX7h7A+vWrogr08c9k4JsThSt3cQHOvUOLa?= =?us-ascii?Q?de7oHtDk4aEMU+yXuvw4k4jNCjPuX31m44tmQZQ9Hum4ld5dCIIiH6f1mIBw?= =?us-ascii?Q?lxL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TLXgGHB6o3SpilNJ5bF/T5My?= =?us-ascii?Q?KBa+zcf1guK2trEJ33fOS6Ug1ZUTqhaR3LFmhMZcmWxpMVbIyh3k7ypyUKLc?= =?us-ascii?Q?Kb8s5Lh4qr7EwBjxKziVGD9l?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4491.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 260d4271-7c3f-4383-6121-08d903dc0ef3 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Apr 2021 09:09:52.6626 (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: Rjv1+VlftVOdNu527x83P38yNtKZAWe5LdY+OSCgVtzq3y6L3qvCQ3Sp1qY86Y74iyvlsfU+GhdsLsT6PVRx6nCLl+kY01QuYC8dej9+c7o= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3577 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v6 05/10] app/testpmd: add clock_gettime_monotonic 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 Sender: "dev" >=20 > Add clock_gettime_monotonic for testpmd on Windows >=20 > Signed-off-by: Jie Zhou > Signed-off-by: Jie Zhou > --- > app/test-pmd/config.c | 33 ++++++++++++++++++++++++++++++++- > 1 file changed, 32 insertions(+), 1 deletion(-) >=20 > diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c > index ef0b9784d..a5f8fec5b 100644 > --- a/app/test-pmd/config.c > +++ b/app/test-pmd/config.c > @@ -63,6 +63,12 @@ >=20 > #define NS_PER_SEC 1E9 >=20 > +#ifdef RTE_EXEC_ENV_WINDOWS > +#define _clock_gettime_monotonic(cur_time) clock_gettime_monotonic(&cur_= time) > +#else > +#define _clock_gettime_monotonic(cur_time) clock_gettime(CLOCK_TYPE_ID, = &cur_time) > +#endif > + > static char *flowtype_to_str(uint16_t flow_type); >=20 > static const struct { > @@ -170,6 +176,27 @@ print_ethaddr(const char *name, struct rte_ether_add= r *eth_addr) > printf("%s%s", name, buf); > } >=20 > +#ifdef RTE_EXEC_ENV_WINDOWS Do we really need to pollute testpmd code with all these ifdefs? Might be better to move it into a separate .h? > +static int > +clock_gettime_monotonic(struct timespec *tp) > +{ > + LARGE_INTEGER pf, pc; > + LONGLONG nsec; > + > + if (QueryPerformanceFrequency(&pf) =3D=3D 0) > + return -1; > + > + if (QueryPerformanceCounter(&pc) =3D=3D 0) > + return -1; > + > + nsec =3D pc.QuadPart * NS_PER_SEC / pf.QuadPart; > + tp->tv_sec =3D nsec / NS_PER_SEC; > + tp->tv_nsec =3D nsec - tp->tv_sec * NS_PER_SEC; > + > + return 0; > +} > +#endif > +