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 17077A0501; Tue, 24 May 2022 12:01:10 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0735D40140; Tue, 24 May 2022 12:01:10 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 183FA400D6 for ; Tue, 24 May 2022 12:01:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653386468; x=1684922468; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=qoyguaFiwuyGQ+eXHqFG/UgVu4gjGKFsm35F6NeXLtU=; b=Qg7jNJlHqsf69HixV5ztQur6/HRHEA5FgNkaChb/7k21jAZCdnektn/+ qmDJrIosq8ahDnaXqTlYdrOkvp4GrVcBjzP6LqFxeUivZnu9Z1jK19BDW NlWaTtI9DTpagtMP0/SgINqY1DHU50iv8N0YwQnEShmxjhfpoKPRafsXX Ru3kVYiWdF3hhbpbDGxzdl4UncP0IRn/tRPwHGDkJNVafOPVVD+YBUOpF 4NbeDNLxxmGSZYSjNFecTckewofQfF4gmyLNsJgRMpAQvsNN1848f5h7v 5y7SEi7g7iA4Sdlgs4Z06Icr2sBKJt7xIlahO6LMLKIL5BMljdCjEexl5 Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10356"; a="298804237" X-IronPort-AV: E=Sophos;i="5.91,248,1647327600"; d="scan'208";a="298804237" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 May 2022 03:01:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,248,1647327600"; d="scan'208";a="601149903" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga008.jf.intel.com with ESMTP; 24 May 2022 03:01:06 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Tue, 24 May 2022 03:01:05 -0700 Received: from fmsmsx605.amr.corp.intel.com (10.18.126.85) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Tue, 24 May 2022 03:01:05 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Tue, 24 May 2022 03:01:05 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.169) 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.2308.27; Tue, 24 May 2022 03:01:05 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cd4z4h6aPC/ik7VBIDodiMJQmk1LTXr2L/C63/X1t8FV1rx+xEHh82aYtgvNctxD05ll9imWoq8GYSoI8mY1SiDfeL76txcH2McRxmWBDvA2z5vF5Rb2M/0JwcZgBGsNLOORb+212GtPu5vUQwAmi8dQZdkp6Y5pTzXRl4AvNJhg3G7IDP88OKQRERZAziiUvmg8ov+ObULyJgM37+X+B+mxzDS7IjiDL8/Bvn8h52w1otoUo3ox66eDxehcE3PSgIeN4y2PqXvlgIuXPZYMQXCc5oY2IeSuGGbRKSEwdmhcqVkkiHIlIGW40hPPNkDwxvSvkbTcYeyT1fbEcRPtFQ== 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=NOajr9VYRfbqX7GpUaGEtNKnVaM4Aw6nYcJo+mGkUjU=; b=SFw4KSccyVOiAmg8eic4hsYAfFaKm/jKdqrM352v/dzCJ3jf9Utkx+iWcyjUJOlSKftxcDk8Fc7Tp2NuzaUazpb5nngoaDshh5B5ZFU49m9Lhb4ME9Lppax2V8S61fb3GlQSwexC3LqMjixbhbhRCi9zCWdKPUomE1W5Jr2FWexNdo6a64b7C9IyZhWo9gmTNUzLMwRDJ2ujWuUS9uNUrwHEn8nBAyN0P87gv42Jjqj9W9cyeZp9mSkEnPYzPJpP4egxxxIgysN0MkOwDo852vtGmu8763GkZCsKR0OXxR/TXr7Rd+RvgZmavvLrM3b88QdcYHg/htXzTm40ZjUWaQ== 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 BN6PR11MB1251.namprd11.prod.outlook.com (2603:10b6:404:48::10) by BYAPR11MB2679.namprd11.prod.outlook.com (2603:10b6:a02:c7::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.13; Tue, 24 May 2022 10:00:58 +0000 Received: from BN6PR11MB1251.namprd11.prod.outlook.com ([fe80::5877:3176:59f4:11]) by BN6PR11MB1251.namprd11.prod.outlook.com ([fe80::5877:3176:59f4:11%11]) with mapi id 15.20.5273.023; Tue, 24 May 2022 10:00:58 +0000 Message-ID: <0a86735b-ade8-57b2-5bc5-a1f8060033ae@intel.com> Date: Tue, 24 May 2022 11:00:53 +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 v3 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: Ray Kinsella , David Hunt References: <20220419112501.1835458-1-kevin.laatz@intel.com> <20220523202124.293865-1-kevin.laatz@intel.com> <20220523202124.293865-4-kevin.laatz@intel.com> From: "Burakov, Anatoly" In-Reply-To: <20220523202124.293865-4-kevin.laatz@intel.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0447.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a9::20) To BN6PR11MB1251.namprd11.prod.outlook.com (2603:10b6:404:48::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c8ad3a44-7ba1-4d25-3784-08da3d6c4cd7 X-MS-TrafficTypeDiagnostic: BYAPR11MB2679: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: FnhLsz5buYSyzEOcR65H9yeOa2djDmtpE1VxRyu9HiTj8FqhU5rW9FzGl8BEDJp27ApuGeiuKwt/D/1u/rjgwignP4DeQbltfLkgFFAHO0gIDd4Q3tCd2MKvXu3QYxxjviCz3ZkCcKRmlTAelLD1ncMeP4eGgN/u2jDhMd9fXJSLrVyIBWBA+PhyHmXBu9Er/34RJZzHybAztdPnGpu8gH3NkPOJVzgB09ujZepvpCJKlOsLQv2WaOuWB5acmTsppb2Tg66lHwUyJregbnLu8LMHVD2XjJ5vAIQCUu63Gn9t1R/5RoIeLQmgSyvfcYnm2ZWWaEGv8uVQuO5kp5CVeYPnsnQ/zN2/fVgO+OFfZLcZQn+jUgo9/wiuqe1NcPCldi+W+5lwMhwXCfchJlpF/CmC8Aon+FJp8Wv8f5Ipamvg4r4CdLnzjYQbYewc9Pbt0yva0IKSP5hCR7DNPq90cUbLUdFTYNhq5CxGv7ybswS7lcLrOf/QI6A3jsY/p20U3bFhqEkft1yPcnpdZFz5DVa1YdBJ2WeXcFz7PKxS24jhsYZpdDGtIGSzNqyQjD+YaoZS2uIGDQoR2GMpcgqXWdrKE+k6AN5UuWmfn4aNFSg3VYIWOIKOg59DYQIL3+BxE94+DiTdB7vFbv8iKmaVvt2peXA0Zz6Xu69UFcGELdmVXV7dpQ4N8FNGMmIIf4zRNOy+LcwKy2LHlSd1i5GkSTWZ3+9NqH9XMBe43rT89Uw= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN6PR11MB1251.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(38100700002)(316002)(54906003)(2616005)(31686004)(4326008)(8676002)(36756003)(66946007)(66556008)(66476007)(82960400001)(6666004)(107886003)(86362001)(83380400001)(2906002)(53546011)(6506007)(186003)(8936002)(5660300002)(6512007)(508600001)(26005)(31696002)(6486002)(43740500002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?RXV3SDRnMnFoVWE5Y01ZSFNZN2hxRk9Lb2FwZEdISFBXbHdaV21RaUxzT1BL?= =?utf-8?B?MUhOMkl5a1JxbE5KZVdmOENaenZQS1dEcWp0S1ByaGlVZTZrUnFkV2tTTkI1?= =?utf-8?B?a0FHZlE2M0FVaTZmUmRsdTZBdmFRSytwb3YvY0RBSFpsQ0FFQlBva1RMUE03?= =?utf-8?B?bW1kcmd6MW91WXV2TGh6VzJzZXUrcndIV0t4NTJFUWh1aEI4ZTdUam9zNlVO?= =?utf-8?B?ZFdtUFZhMDRFOTlPcERuelVs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vaDVsVm9kYUkrK2ZK?= =?utf-8?B?akJ6VnlzVWhvNENKSUdOV2VTVkE5SUtDaUJ5cldPUk1wc0NxSnpmTzF2djEy?= =?utf-8?B?OU1VWWovWW0rb040eXVlQUF6THhJRkhUMHEvQ0hkUzJ2K0VVczZNVXNnakJT?= =?utf-8?B?aGcyZHRMWlgxTDA5NlpkV0ZEMWFGNkpsSTVpUVg1Y2FmU0UxY3BGOFlmL2gv?= =?utf-8?B?RDl3R1dqYUpRMklXL0tBSWk0NGxuUTFST21TOFl0SUV0TWpnK2ZmWU50Q1pH?= =?utf-8?B?bnNsTkNsRzFpRDMvZEp1cU15V3B4OVNsdDhyUEZudDd1bCtDeWNrTUFybmp0?= =?utf-8?Q?nMWd7e7DWfMd0Fjo=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: c8ad3a44-7ba1-4d25-3784-08da3d6c4cd7 X-MS-Exchange-CrossTenant-AuthSource: BN6PR11MB1251.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 May 2022 10:00:58.4250 (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: to7wGZO+U3bVmReC7X9yAP57IyRwyLzUFbdexawXsuPU1JY1zJhYQ5qor78CaYsGhnv4lLBF9Yl4w6xnCNXg4pM8MLRVU21XzfLwZF21InQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2679 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 23-May-22 9:21 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 > Acked-by: Ray Kinsella > > --- > +int > +rte_power_pmd_mgmt_get_scaling_freq_max(unsigned int lcore) > +{ > + if (lcore >= RTE_MAX_LCORE) { > + RTE_LOG(ERR, POWER, "Invalid lcore ID: %u\n", lcore); > + return -EINVAL; > + } > + > + if (scale_freq_max[lcore] == UINT32_MAX) > + RTE_LOG(DEBUG, POWER, "Scaling freq max config not set. Using sysfs max freq.\n"); > + > + return scale_freq_max[lcore]; If you're using 0 as "not set" you should return 0 when it's not set :) > +/** > + * @warning > + * @b EXPERIMENTAL: this API may change, or be removed, without prior notice. > + * > + * Set the min frequency to be used for frequency scaling. ...or zero to use defaults? > + * > + * @note Supported by: Pstate mode. > + * > + * @param lcore > + * The ID of the lcore to set the min frequency for. > + * @param min > + * The value, in KiloHertz, to set the minimum frequency to. > + * @return > + * 0 on success > + * <0 on error > + */ > +__rte_experimental > +int > +rte_power_pmd_mgmt_set_scaling_freq_min(unsigned int lcore, unsigned int min); > + > +/** > + * @warning > + * @b EXPERIMENTAL: this API may change, or be removed, without prior notice. > + * > + * Set the max frequency to be used for frequency scaling. ...or zero to use defaults? > + * > + * @note Supported by: Pstate mode. > + * > + * @param lcore > + * The ID of the lcore to set the max frequency for. > + * @param max > + * The value, in KiloHertz, to set the maximum frequency to. > + * If 'max' is 0, it is considered 'not set'. > + * @return > + * 0 on success > + * <0 on error > + */ > +__rte_experimental > +int > +rte_power_pmd_mgmt_set_scaling_freq_max(unsigned int lcore, unsigned int max); > + > +/** > + * @warning > + * @b EXPERIMENTAL: this API may change, or be removed, without prior notice. > + * > + * Get the current configured min frequency used for frequency scaling. > + * > + * @note Supported by: Pstate mode. > + * > + * @param lcore > + * The ID of the lcore to get the min frequency for. > + * @return > + * 0 if no value has been configured via the 'set' API. > + * >0 if a minimum frequency has been configured. Value is the minimum frequency > + * , in KiloHertz, used for frequency scaling. > + * <0 on error > + */ > +__rte_experimental > +int > +rte_power_pmd_mgmt_get_scaling_freq_min(unsigned int lcore); > + > +/** > + * @warning > + * @b EXPERIMENTAL: this API may change, or be removed, without prior notice. > + * > + * Get the current configured max frequency used for frequency scaling. > + * > + * @note Supported by: Pstate mode. > + * > + * @param lcore > + * The ID of the lcore to get the max frequency for. > + * @return > + * UINT32_MAX if no value has been configured via the 'set' API. The comment now mismatches the code. Once the above is fixed, Acked-by: Anatoly Burakov -- Thanks, Anatoly