From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0043.outbound.protection.outlook.com [104.47.38.43]) by dpdk.org (Postfix) with ESMTP id 69BC61B1F2 for ; Mon, 2 Oct 2017 13:24:26 +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=Klq/LStFptkxhhpscgxFyoweHmN0M3Zz0Q9b+06SM9s=; b=G7O7cvqIgiJOTR8cWEM3QPs4ZxwRKodK0XIOsuN8VqCPikkdXxE51aYjRCkJh2IqzrzXy0awJCI573iBfB7VZ/qkX5azyHnHXkKhFMlwMgj8taRKHq7Wa4KgPdOCY38jtXMyFDdavitxpZdO9hOLjqt2f8bIFLoSstrBbQYcJoQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from jerin (171.76.115.14) by BN3PR07MB2515.namprd07.prod.outlook.com (10.167.4.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Mon, 2 Oct 2017 11:24:23 +0000 Date: Mon, 2 Oct 2017 16:54:04 +0530 From: Jerin Jacob To: Sergio Gonzalez Monroy Cc: dev@dpdk.org, harry.van.haaren@intel.com, bruce.richardson@intel.com Message-ID: <20171002112403.GA13389@jerin> References: <20171002100930.78602-1-sergio.gonzalez.monroy@intel.com> <20171002111738.79520-1-sergio.gonzalez.monroy@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171002111738.79520-1-sergio.gonzalez.monroy@intel.com> User-Agent: Mutt/1.9.1 (2017-09-22) X-Originating-IP: [171.76.115.14] X-ClientProxiedBy: BM1PR01CA0079.INDPRD01.PROD.OUTLOOK.COM (10.174.208.147) To BN3PR07MB2515.namprd07.prod.outlook.com (10.167.4.140) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ad1b544a-4176-4de5-63da-08d509882360 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:BN3PR07MB2515; X-Microsoft-Exchange-Diagnostics: 1; BN3PR07MB2515; 3:0dpYBvVEz8P4lmp/m3xKIbq8B8o9Zgfm54+xmaI2Z/6TprEO7i0Apw03Jsgo/3vg7ezkaTlYIuCgNNUt96nIOctLd+9r5V3pTDXTJKUTp94q9KKjc7+oQe7RCdkniZrpDSD3TRoQgu7v8BmgFywRlV0wfNhJbC0NFWVmAkwI2y+BKLw5CAiUg2t5cZFfZbQhTQ5c9VqBXGZP9TMqVu7jxJXCHkUGuMgQrwJbcjBYKM52j6wRO6gTeNTh9s5NMzix; 25:URx5SaDQn+Gz/qxmGh6hym4orjp4fUyMdcUgrlZQKCVh94JES22Vebb41kO5btdAaJq1hlQs2hpbPz1CRRWnMBf3Vv/5jLHxWbDPZwjOordN6TvH/x+O/hAWBKO349wC0FOxf3tkbTAS1jf9+YOx70wRgFnmKpIoiZkcUXxGRvo0/8U9ouQL08NBim49nghENsQ3tuGdgi8CvUX8jaGmz80YENhFXSIvx0HXbHszvqqbjN9ywJswCB1gZ2Jk/ogur6rOQalryv2qhwhS+wAV+DFyJIZ8RkY7engjBueLYNFHaiPnzyZj7S2Vg+Y58WARJAsTD+qngZDQTAmdG5QSsQ==; 31:VCODw1PnNzsdr+zjkmP0T/rYezUvaGZeY0PTKsp+bERkurxrB5by3M/IkoPCGrTtoK3MokSt9emDbaGSyiEtzMWbANihxi+VLjkpWTF2Q93vLGErVg7oivPO5yrzG+ijmJkYeTTTJLiqsnjLg5na45NG917fcUFk00iwS/q39N05koihjsZUtVbkYKvRJARe9+ua0N4DBt26dsohiGvsJN5fOUS+ImbIrjhpGnM2vSo= X-MS-TrafficTypeDiagnostic: BN3PR07MB2515: X-Microsoft-Exchange-Diagnostics: 1; BN3PR07MB2515; 20:tWNNUTU8EZQpnuIpZJwdjHlhjiZ9TgKyMoGgt/HCF01GbZNM7q2kKUdUbqq5lyELBiFu+vWIsxuSJWS8q5+eRnAdc9H3KX7mAQy1rzUn8DvJ7FRHW+7ZL2/6Ft9WbUF8FJGc64kbXKjyNqYnjsvOgPPx+UB7t6TNMGcCqcGgOh7KAzoaO7Ak8EgPB5m/r4n2okk/tZp3k9kmM21gjDEGjBGgI2QthTifuBXgxuKfGFrlvbFdj8X8gXitNQPioy1FqhQPEKKLDwC1l9lolaM588txGzGi4PIw8Gkb6sdrBhVBr5NqiGeLh0O1kZinJ93l8LS/FB9B7KMqWB44hrETn3vvvSyirUuiuyI/6uTrieEvMrO+o1n0WFieMLlNZPkHhEHxmHoOHxBT3wnPBxWoPbdHvev1P9OnoTRTCsV8j1ph8oyTqpG+0YgMfFLKx1GgQa/GSBuI5jWmCYoRhjX9ublHPJIeBXqMyBLQBCJpyCYkAMr5NQXiQ8blIBiglsiSS9dzGHTQkav/1upMzqethwfOzn/BGDFgHXAFyUR4YIL7NYM3ap+xNw8e299cEcgLH2/me0RxbSCf40krLMOAykYDxMBfHPIeqloRotAV05A=; 4:McSx/Hpo0lRDXiPc5rZyfJp55EXEQlEqlHDTKmgE73pVEL7b9+/kzD6k+G4hnerTkBFT1/w1R1K79m1Vo/HdQrvX4w3TjBnrcCk7/y4qhBGwm4dGcMbt4CZr1toKml2VZsjqtjtLFgSYcPKyJwsYO23Ywtd+nnnaHxxTaq6TSfcxuD6V/A7865b1RY+C+xjWM44/TZWhYH8kvm1Mfbk7VKx0K6oUXKmIUcLsWEnFWzb8Vlr0Bans0En+3372+rmRyafT1QWlPdMOMa+1Kf2ohVVog0dmupyVJyMlJDk8fLU= X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(10201501046)(3002001)(93006095)(100000703101)(100105400095)(6041248)(20161123562025)(20161123564025)(20161123560025)(20161123558100)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN3PR07MB2515; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN3PR07MB2515; X-Forefront-PRVS: 0448A97BF2 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(199003)(13464003)(189002)(54356999)(76176999)(189998001)(5660300001)(305945005)(8936002)(81156014)(42882006)(97736004)(2950100002)(6916009)(106356001)(2906002)(7736002)(33656002)(8676002)(105586002)(6116002)(316002)(229853002)(58126008)(81166006)(3846002)(6246003)(53376002)(6496005)(4326008)(66066001)(33716001)(9686003)(68736007)(53936002)(6666003)(6306002)(16526017)(55016002)(50986999)(101416001)(47776003)(25786009)(16586007)(1076002)(966005)(50466002)(72206003)(23726003)(478600001)(83506001)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR07MB2515; H:jerin; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR07MB2515; 23:6BFAcqJqGC2FfDvrECqJAO63UPlSJz8y3SfQVMVsv?= =?us-ascii?Q?GFVw3fCYqIEzMsoHXQBpuzOeEcAvaih1PC6McvaxWV5biY5+OXyh0BKYgnOe?= =?us-ascii?Q?56oGTnhQn7QSXb/gQtInwniFvi8i5SyyF3Wm3zQupu7UtCRgdcUCiJtr+SJ3?= =?us-ascii?Q?lla6K2OtF5SM/lzYRLOwPwlZD1bI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y5p8Xiz1f0CgUTxhcamAe/N1y3dK1dw4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Oct 2017 11:24:23.8233 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR07MB2515 Subject: Re: [dpdk-dev] [PATCH v3] eal/x86: implement x86 specific tsc hz 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, 02 Oct 2017 11:24:26 -0000 -----Original Message----- > Date: Mon, 2 Oct 2017 12:17:38 +0100 > From: Sergio Gonzalez Monroy > To: dev@dpdk.org > CC: harry.van.haaren@intel.com, bruce.richardson@intel.com > Subject: [dpdk-dev] [PATCH v3] eal/x86: implement x86 specific tsc hz > X-Mailer: git-send-email 2.9.5 > > First, try to use CPUID Time Stamp Counter and Nominal Core Crystal > Clock Information Leaf to determine the tsc hz on platforms that > supports it (does not require privileged user). > > If the CPUID leaf is not available, then try to determine the tsc hz by > reading the MSR 0xCE (requires privileged user). > > Default to the tsc hz estimation if both methods fail. > > Signed-off-by: Sergio Gonzalez Monroy > Acked-by: Harry van Haaren > Tested-by: Bruce Richardson > --- > DEPENDS on: > http://dpdk.org/dev/patchwork/patch/29086/ > > v3: > - acked-by and tested-by tags > > v2: > - fix misspelled word in commit message > - address comment for more clear code > > lib/librte_eal/common/arch/x86/rte_cycles.c | 142 +++++++++++++++++++++ > .../common/include/arch/x86/rte_cycles.h | 7 +- > lib/librte_eal/linuxapp/eal/Makefile | 1 + > 3 files changed, 145 insertions(+), 5 deletions(-) > create mode 100644 lib/librte_eal/common/arch/x86/rte_cycles.c > + > +static uint32_t > +check_model_wsm_nhm(uint8_t model) > +{ > + switch (model) { > + /* Westmere */ > + case 0x25: > + case 0x2C: > + case 0x2F: > + /* Nehalem */ > + case 0x1E: > + case 0x1F: > + case 0x1A: See next comment. > + case 0x2E: > + return 1; > + } > + > + return 0; > +} > + > +static uint32_t > +check_model_gdm_dnv(uint8_t model) > +{ > + switch (model) { > + /* Goldmont */ > + case 0x5C: > + /* Denverton */ Not adding "/* fall-through */" may break gcc 7 build. > + case 0x5F: > + return 1; > + } > + > + return 0; > +} > +