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 3070245692; Tue, 23 Jul 2024 12:36:39 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B9C6240EDD; Tue, 23 Jul 2024 12:36:38 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) by mails.dpdk.org (Postfix) with ESMTP id 98EDC40EDD for ; Tue, 23 Jul 2024 12:33: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=1721730792; x=1753266792; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=60wdv/DfXYTYd84g7njuluPQSAXFl5B5FdYOzfjFuH4=; b=B5Y5H+nwWpP8Kf7T5scTMFu/s4oav/V6zQqIC3crYvtV/ZC4tUoAfiY1 MrrrLkuJ5zUoaCa5RjdliaBcS41N9JvpOGk5ljh0iGTRKeQp0Y0/oKI++ XXTLTEmtc+aEI1TDUVCcnfchojVBy1O6QakjsTSpQmoanXR04X05MrhlL 8GT/XaQs2oJiIAIZ/Ih26W6ehWLTTVmcfEt1VqeZdVZOj4BIc/Mci1MPg h4k6mKJsVgZzSA4+INuHVTmaFkJCozAC3DFyL527en+DN69wzszmmpsRq 27UrrYwdvCb0Y+soMwGAj/pmEfcxSbj5AOkZH+n5xwUyZo33Qu4CWTNDF A==; X-CSE-ConnectionGUID: g9I968lGQcuPIBRi5aFbrA== X-CSE-MsgGUID: 3sIq9oTxQqCsYQzvF6HN1Q== X-IronPort-AV: E=McAfee;i="6700,10204,11141"; a="30008207" X-IronPort-AV: E=Sophos;i="6.09,230,1716274800"; d="scan'208";a="30008207" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jul 2024 03:33:11 -0700 X-CSE-ConnectionGUID: ldBqYe/ZRZatb5Soh8cPIw== X-CSE-MsgGUID: 55cuOFHOSSCZRXOdO7Fb9Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,230,1716274800"; d="scan'208";a="52424998" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orviesa006.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 23 Jul 2024 03:33:11 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) 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.2507.39; Tue, 23 Jul 2024 03:33:10 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 23 Jul 2024 03:33:09 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Tue, 23 Jul 2024 03:33:09 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.49) 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.39; Tue, 23 Jul 2024 03:33:09 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=EWXuQSFDS5lzIFmjm4TI0mBh1YSX/+MXlKPGsVuX7Hl7f7Yn4nCH70QXRNFJyE6soUBHJKYw8Kz3zdqCLTugQiF9x2EqPXhM8Q9oXnKLe9c3wlfT8kv5J56sEIYGMb4F0/UVivcsZUGUcGQ+x9JaQ3kvsS4P6xrceKAXMedZEiwpz89iWJVmDhCSw2oQnb9rTYpF8vXrRf+/tFM1bCFZBMMcAxUM4r21KX+WBbRNilmOOFUCoH9JMVIQRuLPwB/MF4XPFx9vY43aaDjzH+AEfpd9D7VdrJ3iya1ESvqKQC5xJxKkHFMQfwBf2oFeSsrZDr5l1gxDVKPe7s663OXpDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=lkc4AEFPE1QZhNAh37d3QIZ8bQ9/o/HnqpL/UvyYfjA=; b=OXX28SqzZLYTa3sc4pBLL69Lmo1NZZwITCkswAm1lCdw7hltQkzUi8mZHf/IMp7Rj9A5UKYsOxG/A2qJwUCv6k10cel5Kqtc0iZidWgelhfyzPs9WeOAmmacx/Y4/vEI7qzzX3H80KfDziKGnqRrMzhmDhnJ8bTsZwcDTRJNU9WtRC/YSCyF1QEbKs5Iv0+YWf0NxYBAv79Sct91YbQujj1pajLzOC1D5d72ABBfE/mdyJGLK3hGQJFhWLzJZOyB69oFF4QuzPNepQ5f2fORPFcz/ecqtJ5B8lSLM++OZax3CvYe495O5QQcYzYyphdteX1qHzLsf6Qiau3v3FJ8Tw== 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 LV3PR11MB8579.namprd11.prod.outlook.com (2603:10b6:408:1b6::7) by BY1PR11MB8032.namprd11.prod.outlook.com (2603:10b6:a03:524::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.28; Tue, 23 Jul 2024 10:33:06 +0000 Received: from LV3PR11MB8579.namprd11.prod.outlook.com ([fe80::ec3c:7b9a:2442:1ce4]) by LV3PR11MB8579.namprd11.prod.outlook.com ([fe80::ec3c:7b9a:2442:1ce4%4]) with mapi id 15.20.7784.016; Tue, 23 Jul 2024 10:33:06 +0000 Message-ID: <319a72e5-b1ef-4ee2-a9f4-6318c38e32b5@intel.com> Date: Tue, 23 Jul 2024 11:33:00 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 4/4] power/amd_uncore: uncore power management support for AMD EPYC processors To: Sivaprasad Tummala , , , , , , CC: References: <20240220153326.6236-1-sivaprasad.tummala@amd.com> <20240720165030.246294-1-sivaprasad.tummala@amd.com> <20240720165030.246294-5-sivaprasad.tummala@amd.com> Content-Language: en-US From: "Hunt, David" In-Reply-To: <20240720165030.246294-5-sivaprasad.tummala@amd.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DU7PR01CA0035.eurprd01.prod.exchangelabs.com (2603:10a6:10:50e::16) To LV3PR11MB8579.namprd11.prod.outlook.com (2603:10b6:408:1b6::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LV3PR11MB8579:EE_|BY1PR11MB8032:EE_ X-MS-Office365-Filtering-Correlation-Id: be22209e-09b2-4031-d0a6-08dcab02d6a7 X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?WUpkWXhZaUtjMDBGUEpMd3RMVFJQVEtkQTlzSTAyNG9DdUhuc3QzV0h1V3Z3?= =?utf-8?B?TWZvSU9aYWVxd01UamRsOVk4cWx0QmNVSFMreGV6eEN3Y0hiNDB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B8579.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?b280TjJxd3hxaFk0Um5USUw4U3JVV3A4WWZFQ2M0NUtYY2R1Z3RKU0dTVzkx?= =?utf-8?B?ditKTEJmdHU0WDIwNi85YktBT3NzKzU5eHorTlpsRHRyMjF6b0RUMWpzM0Ir?= =?utf-8?B?aVNTaG9KT0V6enB4Qy83N09KeCtIakV5cjFqWk1kWFZYQTRuUXd3aGNqd0JZ?= =?utf-8?B?Nmw5MFJPcys4UEdHaWRVSnlvNGhBZnJuOFJhVmpGT2NQUnBnbS9QRGRQeG1C?= =?utf-8?B?bVpjVUFlelFuZWozTlA2Y3NOSmh0Y0REY2FtZjFCQkM3a1ZMTXRWTjRROTVI?= =?utf-8?B?TWpzT2w3RHN3Si80QmNjYVlrWmFQakJ0VEdIZlBIMi9MMzlEekdaaGVNeHhQ?= =?utf-8?B?U0JNSkltdzZ6b2hQUnFFNHV4bU14VTBXWm1rZnllVTEyYkJTMWEvNmVWU05p?= =?utf-8?B?MTEwLythaFZhN0VnYjJ1VVdLYnBwbWw5OENQZGNUWmFNZ3haSlVjRWF5bHR1?= =?utf-8?B?SktuTVFXQW1LV3kzdytQMy9aeWZIRnVaQnFtV2xMSzYrRjk2TVJoQjd5WkhS?= =?utf-8?B?V3JmNnJTM2RMaUVwcit5cFQxOUU3amxFdTZOVkxuR2p2WEJmSjIrNUVIQ2ZE?= =?utf-8?B?WFZ4WnhBKy9vbCt5Z3BYMjNyWFphNi9yYVhuSkp0eUtza0lMUitsRmlRbUFw?= =?utf-8?B?Um9adEFyU2djSmdwV1hKc01pY1FZTzA0N01oSnBlSWF4clVZVnhqVlNVQVZv?= =?utf-8?B?T3Y4WEU3SFFES0Y3VWp6WFBoeDRlRmpIbVQxd05mVGh0ajBZdjY0MU14aWJJ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LTG1OM0Zwd2EyemIz?= =?utf-8?B?WTY4V3ZMNFNLYTBwSG5pdFprOFZlNFVPc1BDSmp3cFhMMFBnYW9oeVJrRWtz?= =?utf-8?B?NHNaTFhZSXRzblp0Z0pmaVpxdXdjRmZBMk5Qc3U3N1htZFNjczhKQ1Flckhx?= =?utf-8?B?alhvZHVUdkNiMmJZdFE3WWZXYVVQbUp0Y1N3YXVoQjV1bUx4RlhFRlRXLy9a?= =?utf-8?B?QXdiRmtLb3E0K3pOYkltY2NLanVzQ0h6bWhLbDFtUkwvU3EwbEpXS2dUNmdU?= =?utf-8?B?NVk5V21XT0NWZ2NBdFNZeXdMOXNQT1paYjJHR211OWRaRFkwalBKdDIxL1B2?= =?utf-8?B?RTU4dDBHWXdIZXIrN0ZudW40RHRuL01sUFA2UVdOU1NETmFuN3BjL0EzbUxs?= =?utf-8?B?NjlIcklyUnVwaW5DL3VRVVk1S1BOSGJ0UFRlck02ZVlxaGU3TjlCSUp4NWE5?= =?utf-8?Q?qWJKTzDaWgt8RLAlRhoTGXFIM?= X-MS-Exchange-CrossTenant-Network-Message-Id: be22209e-09b2-4031-d0a6-08dcab02d6a7 X-MS-Exchange-CrossTenant-AuthSource: LV3PR11MB8579.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2024 10:33:06.1016 (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: wBju5S2Xktb/our9oaJh5VcjDl4BXDzkzJztOB+xjyxy+Q5gDkFWsAQyEH9sIlScB2giUBXq1wiQWuhP5PnEpg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR11MB8032 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 20/07/2024 17:50, Sivaprasad Tummala wrote: > This patch introduces driver support for power management of uncore > components in AMD EPYC processors. > > Signed-off-by: Sivaprasad Tummala > --- > drivers/power/amd_uncore/amd_uncore.c | 321 ++++++++++++++++++++++++++ > drivers/power/amd_uncore/amd_uncore.h | 226 ++++++++++++++++++ > drivers/power/amd_uncore/meson.build | 20 ++ > drivers/power/meson.build | 1 + > 4 files changed, 568 insertions(+) > create mode 100644 drivers/power/amd_uncore/amd_uncore.c > create mode 100644 drivers/power/amd_uncore/amd_uncore.h > create mode 100644 drivers/power/amd_uncore/meson.build > > diff --git a/drivers/power/amd_uncore/amd_uncore.c b/drivers/power/amd_uncore/amd_uncore.c > new file mode 100644 > index 0000000000..f15eaaa307 > --- /dev/null > +++ b/drivers/power/amd_uncore/amd_uncore.c > @@ -0,0 +1,321 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright(c) 2024 Advanced Micro Devices, Inc. > + */ > + > +#include > +#include > +#include > + > +#include > + > +#include "amd_uncore.h" > +#include "power_common.h" > +#include "e_smi/e_smi.h" > + > +#define MAX_UNCORE_FREQS 8 > +#define MAX_NUMA_DIE 8 > + > +#define BUS_FREQ 1000 > + > +struct __rte_cache_aligned uncore_power_info { > + unsigned int die; /* Core die id */ > + unsigned int pkg; /* Package id */ > + uint32_t freqs[MAX_UNCORE_FREQS]; /* Frequency array */ > + uint32_t nb_freqs; /* Number of available freqs */ > + uint32_t curr_idx; /* Freq index in freqs array */ > + uint32_t max_freq; /* System max uncore freq */ > + uint32_t min_freq; /* System min uncore freq */ > +}; > + > +static struct uncore_power_info uncore_info[RTE_MAX_NUMA_NODES][MAX_NUMA_DIE]; > +static int esmi_initialized; > + > +static int > +set_uncore_freq_internal(struct uncore_power_info *ui, uint32_t idx) > +{ > + int ret; > + > + if (idx >= MAX_UNCORE_FREQS || idx >= ui->nb_freqs) { > + POWER_LOG(DEBUG, "Invalid uncore frequency index %u, which " > + "should be less than %u", idx, ui->nb_freqs); > + return -1; > + } > + > + ret = esmi_apb_disable(ui->pkg, idx); > + if (ret != ESMI_SUCCESS) { > + POWER_LOG(ERR, "DF P-state '%u' set failed for pkg %02u", > + idx, ui->pkg); > + return -1; > + } > + > + POWER_DEBUG_LOG("DF P-state '%u' to be set for pkg %02u die %02u", > + idx, ui->pkg, ui->die); > + > + /* write the minimum value first if the target freq is less than current max */ > + ui->curr_idx = idx; > + > + return 0; > +} > + > +/* > + * Fopen the sys file for the future setting of the uncore die frequency. > + */ Comment may need updating, as function is not reading any sysfs files (for the moment, at least). > +static int > +power_init_for_setting_uncore_freq(struct uncore_power_info *ui) > +{ > + /* open and read all uncore sys files */ Comment may need updating, as function is not reading any sysfs files (for the moment, at least). > + /* Base max */ > + ui->max_freq = 1800000; > + ui->min_freq = 1200000; > + > + return 0; > +} > + > +/* > + * Get the available uncore frequencies of the specific die by reading the > + * sys file. > + */ Comment may need updating, as function is not reading any sysfs files. 3 uncore frequencies hard-coded for the moment, may get via esmi or sysfs in the future. > +static int > +power_get_available_uncore_freqs(struct uncore_power_info *ui) > +{ > + int ret = -1; > + uint32_t i, num_uncore_freqs = 3; > + uint32_t fabric_freqs[] = { > + /* to be extended for probing support in future */ > + 1800, > + 1444, > + 1200 > + }; > + > + if (num_uncore_freqs >= MAX_UNCORE_FREQS) { > + POWER_LOG(ERR, "Too many available uncore frequencies: %d", > + num_uncore_freqs); > + goto out; > + } > + > + /* Generate the uncore freq bucket array. */ > + for (i = 0; i < num_uncore_freqs; i++) > + ui->freqs[i] = fabric_freqs[i] * BUS_FREQ; > + > + ui->nb_freqs = num_uncore_freqs; > + > + ret = 0; > + > + POWER_DEBUG_LOG("%d frequency(s) of pkg %02u die %02u are available", > + num_uncore_freqs, ui->pkg, ui->die); > + > +out: > + return ret; > +} > + --snip-- >