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 8C1F345BAA; Wed, 23 Oct 2024 07:12:56 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D900440DD0; Wed, 23 Oct 2024 07:12:33 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2058.outbound.protection.outlook.com [40.107.236.58]) by mails.dpdk.org (Postfix) with ESMTP id F0F0140A89 for ; Wed, 23 Oct 2024 07:12:24 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=DunUdcQIMqOjBgB3x/7ureUSHj6lfO0Q2Ln9GakxEVCV35ph2quSLiux5Nn+A949KXj0utnnBFFKg4R5I+OvDGqe83ngAdz+enf3MB2vby/5VziHH/LLfXfH24ApLa94oHuMpodX7BDN60l9tLDYSBOpvbKbBbiz15bT2vJOtwpphdfQhKPJmfjRu0a0pKWbg9ioyFjeAilaHch6Qe5VlIf13uo06gQo+jvwHwkr/k7IoUlqCJnsWydriuOPTSzQykngAIs5xkv/NSLfsmxTrSr+h8fsrozZPgEPE/s82XOt7yRmoX5LcCLqocNHEKr242gLdYDqpXmfN4IjK0LIUA== 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=sY9dUsix9FbjfcDYFs0r2kbhXipjOBLZ7rqVnHZv8q0=; b=PzWWUx3xgwFQZsj1CNEsDRit0snRHoVb4smV8kbcTNqXOJ/8MufcmbDdBeX96+PzZY+RBf76/ohqPSBWld6feRcKU3uQfGcvOr4s8qFWQ1x5BbP1BH3ozne6brfZhTfofBPaDfjPcBxc4l530K0DUY+GB4lg2VQUSf3zc/OeGojRKM6N7LR18XI13SkIlaQCi9jwSeNlt9CJ4TzvFJxMWUq5J5aMAHtonK7bYarnrRLjVCtbk+rdQwQj8/PyaXmgQ7F16pcOMntJd2k9hZa8Hr+tpVPYVfFXCS3QumeC21yhpy1adpIlPd+pCBq+zNeL32BjIzL+zDincNXAs3A6Ig== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sY9dUsix9FbjfcDYFs0r2kbhXipjOBLZ7rqVnHZv8q0=; b=Ki6WheI9MbzqSVdvPNyYYDTqR7KwRnoYS/c9OfmSjsZHnSHUyOUVh2PJkTZlnAQyfoTCgBr/LZUp0NNmrifMJvot4M3XFsMvSUq+m5tepsJZBJhhiX6sRPWAQSaPM/Y9fZwxF5vdjJZfTtNh+2hjgTUv2bZqV+gkXq7x++SD9lU= Received: from BN9PR03CA0419.namprd03.prod.outlook.com (2603:10b6:408:111::34) by MW4PR12MB7165.namprd12.prod.outlook.com (2603:10b6:303:21b::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.16; Wed, 23 Oct 2024 05:12:22 +0000 Received: from BL6PEPF00020E61.namprd04.prod.outlook.com (2603:10b6:408:111:cafe::71) by BN9PR03CA0419.outlook.office365.com (2603:10b6:408:111::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.29 via Frontend Transport; Wed, 23 Oct 2024 05:12:21 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BL6PEPF00020E61.mail.protection.outlook.com (10.167.249.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8093.14 via Frontend Transport; Wed, 23 Oct 2024 05:12:21 +0000 Received: from jfw9ny3-os.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 23 Oct 2024 00:12:17 -0500 From: Sivaprasad Tummala To: , , , , , , , , CC: Subject: [PATCH v9 0/6] power: refactor power management library Date: Wed, 23 Oct 2024 05:11:39 +0000 Message-ID: <20241023051139.1066426-8-sivaprasad.tummala@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241023051139.1066426-1-sivaprasad.tummala@amd.com> References: <20241022184133.700367-1-sivaprasad.tummala@amd.com> <20241023051139.1066426-1-sivaprasad.tummala@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF00020E61:EE_|MW4PR12MB7165:EE_ X-MS-Office365-Filtering-Correlation-Id: c650e245-5ddc-4218-622a-08dcf32145d3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|376014|36860700013|1800799024; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?wZmeGk1pRsCXRhBAcn5hYlRoVFF8OpHlz2STA601F6YsTo4ibGecOzdGAvZk?= =?us-ascii?Q?sDakQ9+sbUo+hvPO/r5og7Cn4UZ6qyCubPvn8a1KIyrmr/bqe3pienvwBQDk?= =?us-ascii?Q?8pZvCf13q+uOOMF+LSMxWw9PS9/wgBlYPD1SToCrjPV1bXQ6drsUNGtlFAZK?= =?us-ascii?Q?tAeWJUsSSZ7GxgnIjuH1MWftTfPPmwxTZTSPDvLokSiJY3a4uRUdJYF+VaAK?= =?us-ascii?Q?lfS1npA97NbJJwlYMwuo9WboV/LjkAoU3kQRKwd3pxggeNMoLaS6aTLk/esQ?= =?us-ascii?Q?Q9C4feX1RaKH+jPrJ1iAww3w324AxJcWJXoruzjaLWFgEWPypkOV10MLiPK+?= =?us-ascii?Q?c0+PGARMabUKBkakSdd9PYjYK/jt8RvSGX7+XYHVYbcmR/8EIr5tCXhlwLIz?= =?us-ascii?Q?d8ePl8FONJwnVbrdQUPJbpVsV4qVelDMtz+elqMuME67lJCjTh4dHyzM27xX?= =?us-ascii?Q?vxmG6avGakKgC2EeBBYWZ++X0Au3kxCVMeKJvy0sKIekc4jinwQwkloL1dFb?= =?us-ascii?Q?7Gy1tNEQI9jS0/HO82/XZIehltA3KE4hDfJYQYfF+2MeYOwaVYlqBRFkANzZ?= =?us-ascii?Q?RpYi7/bOda2qE/4kjM8A/0g13NJkp4fb687YoEwgnilSx8Eymhc4IUnk3x7K?= =?us-ascii?Q?YfkPKfM0HedJ51iI8C6iTjIENAQvewLJ4XZYTME5q9Z/SlvjtNkGaQcSdfVS?= =?us-ascii?Q?9QrWtsDh/Xj5HR4WqeYuTkbnNh+y3Ty2EMT1JUAMPeeAIynfw6Tl5EKy80pm?= =?us-ascii?Q?Fft5HA7trF48GLhvhfr2tlGj4Pq4/DFjwANao5py1f69QxvpGXGFlmzDbO12?= =?us-ascii?Q?SZNG9FOwbZp1biMaxFU3pQl4xHoNtUei7BJnjsKvVWiFVNuhy3r5BHHbm6u3?= =?us-ascii?Q?eOx6aokQQiMSkATpItpV786gjwxKRrI2VzFFgW+l9Tyw4vxTlG8O/2lUsiiV?= =?us-ascii?Q?zOotUsBSmQ3gLbpGdErtBvf/6j8CEXMJfzlZFPJQR3C4CTP+i0J5KZW4+o+y?= =?us-ascii?Q?6ztXOOM/d1fXpaietkq9wGapD4iu7i8pbXRlfQRmAn/DnXTSkxnO2d3sn+/e?= =?us-ascii?Q?OZJfH5xQHH8rQthpPt79k44PzqImUB7nOgGs+pS1nXMBBU+qYywHjxWzNkbb?= =?us-ascii?Q?RC4Kq8vCNO6LjTDRCYcQuXMJHcpYDJDNaSJI5B41WWejyp3BAcApt/zIa+iU?= =?us-ascii?Q?E5iWy+BJ7lDoDLPFJDts+/1SKTrOx4gzNM/Q3vbjKatFc2C9LJlddxt5ZbCM?= =?us-ascii?Q?DbU/VhklHG7nN+C4lF5OpbDjPobNrnGh3p4kfK9N/DPL1SnCnZvJjmpnM5Qg?= =?us-ascii?Q?CFCAWAQgNPgGnwv3q2pg7VPg08BPEwd+2DI+oHzeGVH/mZ3HHnSzHNiXtqXn?= =?us-ascii?Q?zXOUT+0iqPTqO90gv78TX121s4Ql0ehktTMBH8nbWKAq9MdL1Q=3D=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(82310400026)(376014)(36860700013)(1800799024); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2024 05:12:21.0094 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c650e245-5ddc-4218-622a-08dcf32145d3 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF00020E61.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB7165 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 This patchset refactors the power management library, addressing both core and uncore power management. The primary changes involve the creation of dedicated directories for each driver within 'drivers/power/core/*' and 'drivers/power/uncore/*'. This refactor significantly improves code organization, enhances clarity, and boosts maintainability. It lays the foundation for more focused development on individual drivers and facilitates seamless integration of future enhancements, particularly the AMD uncore driver. Furthermore, this effort aims to streamline code maintenance by consolidating common functions for cpufreq and cppc across various core drivers, thus reducing code duplication. Sivaprasad Tummala (6): power: refactor core power management library power: refactor uncore power management library test/power: removed function pointer validations drivers/power: uncore support for AMD EPYC processors maintainers: update for drivers/power power: rename library sources for cpu frequency management MAINTAINERS | 1 + app/test/test_power.c | 97 +----- app/test/test_power_cpufreq.c | 54 +-- app/test/test_power_kvm_vm.c | 38 +- doc/api/doxy-api-index.md | 2 +- doc/guides/prog_guide/power_man.rst | 24 +- drivers/meson.build | 1 + .../power/acpi/acpi_cpufreq.c | 22 +- .../power/acpi/acpi_cpufreq.h | 6 +- drivers/power/acpi/meson.build | 10 + .../power/amd_pstate/amd_pstate_cpufreq.c | 24 +- .../power/amd_pstate/amd_pstate_cpufreq.h | 10 +- drivers/power/amd_pstate/meson.build | 10 + drivers/power/amd_uncore/amd_uncore.c | 329 ++++++++++++++++++ drivers/power/amd_uncore/amd_uncore.h | 225 ++++++++++++ drivers/power/amd_uncore/meson.build | 20 ++ .../power/cppc/cppc_cpufreq.c | 22 +- .../power/cppc/cppc_cpufreq.h | 8 +- drivers/power/cppc/meson.build | 10 + .../power/intel_uncore/intel_uncore.c | 18 +- .../power/intel_uncore/intel_uncore.h | 9 +- drivers/power/intel_uncore/meson.build | 6 + .../power/kvm_vm}/guest_channel.c | 2 +- .../power/kvm_vm}/guest_channel.h | 0 .../power/kvm_vm/kvm_vm.c | 22 +- .../power/kvm_vm/kvm_vm.h | 6 +- drivers/power/kvm_vm/meson.build | 14 + drivers/power/meson.build | 14 + drivers/power/pstate/meson.build | 10 + .../power/pstate/pstate_cpufreq.c | 22 +- .../power/pstate/pstate_cpufreq.h | 6 +- examples/distributor/main.c | 2 +- examples/l3fwd-power/main.c | 14 +- examples/l3fwd-power/perf_core.c | 2 +- examples/vm_power_manager/channel_monitor.c | 2 +- examples/vm_power_manager/channel_monitor.h | 2 +- examples/vm_power_manager/guest_cli/main.c | 2 +- .../guest_cli/vm_power_cli_guest.c | 2 +- examples/vm_power_manager/power_manager.c | 2 +- lib/power/meson.build | 13 +- lib/power/power_common.c | 2 +- lib/power/power_common.h | 18 +- lib/power/power_cpufreq.h | 191 ++++++++++ lib/power/power_uncore_ops.h | 244 +++++++++++++ lib/power/rte_power.c | 257 -------------- lib/power/rte_power_cpufreq.c | 230 ++++++++++++ .../{rte_power.h => rte_power_cpufreq.h} | 120 ++++--- lib/power/rte_power_pmd_mgmt.h | 2 +- lib/power/rte_power_uncore.c | 256 +++++++------- lib/power/rte_power_uncore.h | 61 ++-- lib/power/version.map | 15 + 51 files changed, 1766 insertions(+), 713 deletions(-) rename lib/power/power_acpi_cpufreq.c => drivers/power/acpi/acpi_cpufreq.c (95%) rename lib/power/power_acpi_cpufreq.h => drivers/power/acpi/acpi_cpufreq.h (98%) create mode 100644 drivers/power/acpi/meson.build rename lib/power/power_amd_pstate_cpufreq.c => drivers/power/amd_pstate/amd_pstate_cpufreq.c (95%) rename lib/power/power_amd_pstate_cpufreq.h => drivers/power/amd_pstate/amd_pstate_cpufreq.h (96%) create mode 100644 drivers/power/amd_pstate/meson.build 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 rename lib/power/power_cppc_cpufreq.c => drivers/power/cppc/cppc_cpufreq.c (95%) rename lib/power/power_cppc_cpufreq.h => drivers/power/cppc/cppc_cpufreq.h (97%) create mode 100644 drivers/power/cppc/meson.build rename lib/power/power_intel_uncore.c => drivers/power/intel_uncore/intel_uncore.c (95%) rename lib/power/power_intel_uncore.h => drivers/power/intel_uncore/intel_uncore.h (97%) create mode 100644 drivers/power/intel_uncore/meson.build rename {lib/power => drivers/power/kvm_vm}/guest_channel.c (99%) rename {lib/power => drivers/power/kvm_vm}/guest_channel.h (100%) rename lib/power/power_kvm_vm.c => drivers/power/kvm_vm/kvm_vm.c (82%) rename lib/power/power_kvm_vm.h => drivers/power/kvm_vm/kvm_vm.h (98%) create mode 100644 drivers/power/kvm_vm/meson.build create mode 100644 drivers/power/meson.build create mode 100644 drivers/power/pstate/meson.build rename lib/power/power_pstate_cpufreq.c => drivers/power/pstate/pstate_cpufreq.c (96%) rename lib/power/power_pstate_cpufreq.h => drivers/power/pstate/pstate_cpufreq.h (98%) create mode 100644 lib/power/power_cpufreq.h create mode 100644 lib/power/power_uncore_ops.h delete mode 100644 lib/power/rte_power.c create mode 100644 lib/power/rte_power_cpufreq.c rename lib/power/{rte_power.h => rte_power_cpufreq.h} (73%) -- 2.34.1