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 AD253A0503; Wed, 18 May 2022 11:06:03 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6204140156; Wed, 18 May 2022 11:06:03 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 60CD3400D6 for ; Wed, 18 May 2022 11:06:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652864760; x=1684400760; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=cVoLoNCFy8Im6lChMEaL3euOj/7vedYCDKPpdmnGZ4U=; b=hfTe2obmSDE9MBmmM9a/9eAWYcLGvyVDOB3P+WHFbj+GXffFf8w14RnH /vIlHc0JLU1MpwmOM26Qqd5wgMcgTxilYkUGFRllFoR+LGocKnHJqhruZ ExvNMgGj4mV9Q4Crk/N0SNd1n+GPNTZqUbxL7Rs7f6DMDPReoRHnBNYj9 fmu8nXyU+GRSpvCZ2SJttxVVIzOH/jrnX+hkc+6PRtl6kuVHgvTy3of55 7MavrmKJQpcCa4ogduDNbxp4KtDEsiyoL4IpBL6AJY9s7gt+XFpcdHzYi UPoHjQYnFVLodT+ssSMenVzUv1sbpX62piR8pxpqxk4Ef+JfjAmR6gPhx A==; X-IronPort-AV: E=McAfee;i="6400,9594,10350"; a="252087581" X-IronPort-AV: E=Sophos;i="5.91,234,1647327600"; d="scan'208";a="252087581" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 May 2022 02:05:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,234,1647327600"; d="scan'208";a="545345509" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga006.jf.intel.com with ESMTP; 18 May 2022 02:05:58 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Wed, 18 May 2022 02:05:58 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Wed, 18 May 2022 02:05:58 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.102) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Wed, 18 May 2022 02:05:57 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bT3gYEBGkqYZWqaUwFciLOyV/wdZmMgvraU1zil7/cmtuHqhaGZhFrODPXaDSPGt/zyRKqVe/KmVAQsaGhN+AIiN8rhW8WBlImSF2MYL6UA5VcabW09etWyI63jTjtKxXcCCYox9FqrP2SFZorlgi9lK4bPMd53biF6nn1V+3TNXLnzNs0o9TM0l6GbIbWjfRqqIKLKDgRbwHgeNlyCum9xtsy6Wo9+ycQOtYTBBKkCwff3toiWm1QxsxJTaKVGn/ZexlJwdMS/kDOkQYS0HnsUNWvpfMOfhgtVMPOzjU5A8AvNgFGJpDPC6NJ6vz6h6vXEnjbXqyfOdZGiAChnrNg== 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=Gd0DqPJMkhKI/O1Y8TvThrK5nvly+nuAG9YCiw21bes=; b=fEDrSzHQ7wMbpr4ajmz9Pe4/hzzZY3ac5t6J7dVbcf9H6kXHJR7xFjlPBsGSJk2dv/W4hBqTeISVyFvR3yp5npVUpqZ33IbooG5dybS+0asRekMBeUrPLkWGnL8MGT6hN7RB0nEziq8SHTIJVwGhJ4aoQktDlYBnZHWsg/9cMUPGLZYBSe7awH9Gj1cZJiAcKeCOSJdUZcw6pCnO7/s7NlG7X9kshn2CaaqOiWZQFtcAjtfA3g7uvaDEM89imKstIkgxwAm4bKJDpWjykgcHpPX3izuVsEqYpIQUPCL1q0+kBgxIPhdchsxpGYNyN/11ByDJq94jZryDHGn0OLTHJA== 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 PH0PR11MB5093.namprd11.prod.outlook.com (2603:10b6:510:3e::23) by MWHPR11MB1727.namprd11.prod.outlook.com (2603:10b6:300:1f::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.13; Wed, 18 May 2022 09:05:56 +0000 Received: from PH0PR11MB5093.namprd11.prod.outlook.com ([fe80::28af:8ec5:1817:1af1]) by PH0PR11MB5093.namprd11.prod.outlook.com ([fe80::28af:8ec5:1817:1af1%3]) with mapi id 15.20.5250.018; Wed, 18 May 2022 09:05:56 +0000 Message-ID: Date: Wed, 18 May 2022 10:05:51 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.9.0 Subject: Re: [PATCH v2 3/4] lib/power: add get and set API for scaling freq min and max with pstate mode Content-Language: en-US To: Kevin Laatz , CC: David Hunt , Ray Kinsella References: <20220408140847.1319312-1-kevin.laatz@intel.com> <20220419112501.1835458-1-kevin.laatz@intel.com> <20220419112501.1835458-4-kevin.laatz@intel.com> From: "Burakov, Anatoly" In-Reply-To: <20220419112501.1835458-4-kevin.laatz@intel.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0370.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a3::22) To PH0PR11MB5093.namprd11.prod.outlook.com (2603:10b6:510:3e::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fadfcc33-3346-4bb0-d904-08da38ad9e27 X-MS-TrafficTypeDiagnostic: MWHPR11MB1727:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KVPlxtckjHEelu1YUfNZUPc1sp4hpW+C3qcZv9SW3o4IqynL4aozABlysQ/uF8ZxMjW4dempBeQEWEC/5eXL/6BSgpSOy3vK953mHNq3+kOWA8I1z93NzQmIzydW5B0g+1Jz7RnwinGOKA2FCnfp5tPKTzyxdotZRTHlmFrWOOPnZwk2qtjRazw1/FadF7M+XUDRNTlvn+k4F1kkkriLd9lEeZS5ki4lNn0oLnF4k69rXFc15HDibjIZRupfv13qs5/s0I6F7MTXhq2P9dx42kLpMuTiRmqax+H1YnZtAcAlBNTHnZ8YlAAd9GyEbJnrPWz4bUqdOlE4UEu6dBWsmJfrNifDK3kbTeqCLDu99+YU+rN0o4kuxpmv5/1R86+U3yZ+gXf0P5o5+uHRQ317fQsD3wsvlKQXsy9EYogu5gJxlk3SereiYNLDWpEN3crsAFY3GPmox90jZKthoIayANJU5cY5nlUYNO8+Px5m8v5yxQFPeVV1Wpr1cyKaPRLT4fQ+qeWEMbjJrsN3pNG9+lD9HWmUSYRCpmzbs49pGymXuskQBRUEAQWqS09N9XgxGljpMMF+D81cCMs5pEBTYUk28ukKnrU8XR0zCWGVNVpcvC/Wa45jMQP31BfcpfI+JasXcipWnja1crG1jYHciXILYZ+NHDuXfCV5k4DqH4PsapWIQZKgV+Gp033dxIiBuGsuTzmNamK8QX5dCT5XmkcpducFoE0SB1AsHv7wtmE= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5093.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(6486002)(316002)(508600001)(2906002)(4326008)(66476007)(54906003)(86362001)(66556008)(6666004)(8676002)(82960400001)(31696002)(38100700002)(186003)(5660300002)(6512007)(31686004)(53546011)(66946007)(8936002)(2616005)(83380400001)(36756003)(6506007)(26005)(45980500001)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?R0JrcHJYMmQwQTMyVjVUalJYSTE5enlTK2QrYjkrNktqUnEvRVMwaTdZcHJy?= =?utf-8?B?N3hzNWpyUWVHYURkdWhOVlpzUHRkU0RSYWl4aWpqeGRpaG5ZdGNRS3RXSExJ?= =?utf-8?B?cHN3TDBVb0JCNWRza2NVYUdCOGVwZkU2NkY5Wi9hY2QxTHl3aUNpVVJmOEFK?= =?utf-8?B?YitvMjlJUGpIS1NrWjFFbHJ4S05pbWlMNHZJNDR4VUppWFRFczNBcjNmcllW?= =?utf-8?B?VEZkUytGQm1WWVFZcFN2QVpHVDQ1QTRmY1ZxV3pNUzJTd1NBY2JaM21rb3BF?= =?utf-8?B?V3hVNGlscmFiOUZrT1JPeVFXVDJPZW5VUEJMNzRQdFZGRzA1R2JmMHRlZnJy?= =?utf-8?B?TXI5eWFzYWdHdkVyVUJxRzJsb25Hb1lNbzVldjA5UGw0SjdCMlNJdXd1dnA5?= =?utf-8?B?b25SQVdUVWl2VmorMThQ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?U25lZ1lUeUp6akw0UXA5dm1Jb2FZOUt3anF4djNJTU9ON0ZIRDNyMUZtU0lN?= =?utf-8?B?dGkwaUJrN1FZZHlZSGZsaXhqeG5QaktWU3BhcnBFQk53RWpqaVRmdzRlcUx5?= =?utf-8?Q?Hj2xnFpVTBqXdyjU=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: fadfcc33-3346-4bb0-d904-08da38ad9e27 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5093.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2022 09:05:56.4173 (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: ExFjl210EGCkhzlFDhnuLmkZ19Cz3s8euN6Y93go3Q+sBLzKmxxjdriIxz0Sxl3AdBfi9tp0uv9zq7FGOERToX05l644iENR9KL/9cT2C8U= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1727 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 19-Apr-22 12:25 PM, Kevin Laatz wrote: > Add new get/set API to allow the user or application to set the minimum > and maximum frequencies to use when scaling. > Previously, the frequency range was determined by the HW capabilities of > the CPU. With this new API, the user or application can constrain this > if required. > > Signed-off-by: Kevin Laatz > --- > > +int > +rte_power_pmd_mgmt_set_scaling_freq_min(unsigned int lcore, unsigned int min) > +{ > + if (lcore >= RTE_MAX_LCORE) { > + RTE_LOG(ERR, POWER, "Invalid lcore ID: %u\n", lcore); > + rte_errno = EINVAL; > + return -1; > + } > + scale_freq_min[lcore] = min; Are there any constraints on the value ranges, or are we just going to accept any and all values? If the idea was to allow valid values plus some special "default" value, you can still restrict the range, but allow 0 as a special case? > + > + return 0; > +} > + > +int > +rte_power_pmd_mgmt_set_scaling_freq_max(unsigned int lcore, unsigned int max) > +{ > + if (lcore >= RTE_MAX_LCORE) { > + RTE_LOG(ERR, POWER, "Invalid lcore ID: %u\n", lcore); > + rte_errno = EINVAL; > + return -1; > + } > + scale_freq_max[lcore] = max; Same as above. Also, do we want UINT32_MAX be the "special" value for the "max" case? What do you think of having "0" as "not set", but maybe set it internally to UINT32_MAX if you still want to keep using the RTE_MIN/MAX macros? > + > + return 0; > +} > + > +int > +rte_power_pmd_mgmt_get_scaling_freq_min(unsigned int lcore) > +{ > diff --git a/lib/power/rte_power_pmd_mgmt.h b/lib/power/rte_power_pmd_mgmt.h > index 18a9c3abb5..74e3fa710b 100644 > --- a/lib/power/rte_power_pmd_mgmt.h > +++ b/lib/power/rte_power_pmd_mgmt.h > @@ -148,6 +148,86 @@ __rte_experimental > unsigned int > rte_power_pmd_mgmt_get_pause_duration(void); > > +/** > + * @warning > + * @b EXPERIMENTAL: this API may change, or be removed, without prior notice. > + * > + * Set the min frequency to be used for frequency scaling. > + * > + * @note Supported by: Pstate mode. > + * > + * @param lcore > + * The ID of the lcore to set the min frequency for. > + * @param min > + * The value, in Hertz, to set the minimum frequency to. Is it really in Hertz? As far as I can tell, it's in steps of 100MHz (BUS_FREQ). -- Thanks, Anatoly