From patchwork Mon Aug 26 13:06:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Tummala, Sivaprasad" X-Patchwork-Id: 1264 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 70F204586C; Mon, 26 Aug 2024 15:07:32 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1A9414060C; Mon, 26 Aug 2024 15:07:26 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2065.outbound.protection.outlook.com [40.107.93.65]) by mails.dpdk.org (Postfix) with ESMTP id 7EE63402A7 for ; Mon, 26 Aug 2024 15:07:23 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=aFZBBtP9fJjCCAYLBaO3UMXmw4hdjVw4Rccz1y6hSUAGvwdCAdpwGz6BEPVWU1hmDe+U9LdxEFDoY649MULKHSaAeVCwTsN7WahnBHRZMjkzzScn1N3HkA5aHwkEWLdFJzBh0La1DnQYZQXS+uwI9+QXRlIDGW1y4U9bVPrD+25Mph5nv/LnX3nHKPinoHbiL4Li9EJnaKa2xtmsdpTJhq/LY1nOg3HlrW46qOlH+NtT94S5bD4CiRUu2ZeNohicSyNMS/PW+JIdhYUS+VTv1vMm2bm8QGAyY54LHKyvTdr4le9hNP43g3KmqbU/hYWRIRoe/33Z2eUXYkYjl5dwVQ== 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=OsuvbLnZ5b3Xs9AP4r+nsliiprJ3IQQkVQKl9i6SesA=; b=Aud5pGQGyXS5Cy6t3PJgEoEogjKs0jiJmf+G8F8elr1vhck81iG1B5KUw29vBQ4Bu3dlFRc5PLOQGuE8uOyXAvWfsIP8PsW/PrRi0747EYMgxStadjvCMbJ49mTQg3gt4r+oXIxvi0SXwJNizFuM21moXddsc3Ek5pThaYMnRdP1E3nvZBEjlnXz4Kp8kmbrFICyjr/1cOHs5i7LqOM38BRl5DtjVMhraKLTPrhCwzOVE8dqu6p5SJYa9M0ob2HwBKNcw9ndKGNb731huRivX99fkj8aULCjCqrbgi0sh2vfW5jSS+G+l/hg0NOBPNH43RwGlcpuAZge0VPqHHXXJQ== 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=OsuvbLnZ5b3Xs9AP4r+nsliiprJ3IQQkVQKl9i6SesA=; b=ZBAJcLR9yAPcfj3CEBZnyfjGyFWHz/GNIBha1SL1bZXs5E+22+urmwwFFIwT/5VH4QADdXiHhh/gt+mWoTR07FJNIn+UT0HZLgPZbOzjZktJooNtMTgN1pXNaFsRFzV4OYEGne+rjse4eZ78lWPK6SzjXTSmywp95KULoGzkFJk= Received: from BN9PR03CA0431.namprd03.prod.outlook.com (2603:10b6:408:113::16) by PH7PR12MB7161.namprd12.prod.outlook.com (2603:10b6:510:200::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25; Mon, 26 Aug 2024 13:07:15 +0000 Received: from BL6PEPF0001AB74.namprd02.prod.outlook.com (2603:10b6:408:113:cafe::f0) by BN9PR03CA0431.outlook.office365.com (2603:10b6:408:113::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25 via Frontend Transport; Mon, 26 Aug 2024 13:07:15 +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 BL6PEPF0001AB74.mail.protection.outlook.com (10.167.242.167) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7918.13 via Frontend Transport; Mon, 26 Aug 2024 13:07:14 +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; Mon, 26 Aug 2024 08:07:11 -0500 From: Sivaprasad Tummala To: , , , , , , , CC: Subject: [PATCH v2 0/4] power: refactor power management library Date: Mon, 26 Aug 2024 13:06:45 +0000 Message-ID: <20240826130650.320130-1-sivaprasad.tummala@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240720165030.246294-1-sivaprasad.tummala@amd.com> References: <20240720165030.246294-1-sivaprasad.tummala@amd.com> MIME-Version: 1.0 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: BL6PEPF0001AB74:EE_|PH7PR12MB7161:EE_ X-MS-Office365-Filtering-Correlation-Id: 61b92643-ddee-40eb-034d-08dcc5d0018d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|36860700013|376014|1800799024; X-Microsoft-Antispam-Message-Info: +ib3AOwwV9lP1UZxG7Vsg4Jw5FvzvOYxK1P681pHz8EelVgcRXCzvJaHxgaV1lAFobfcbFbni0U6JFL1+NByGdscIWaPRi7HdI03/ouXAPRWi9Vz99NXf7/KsKy/7s5C9Scwl/LLmsnHm8Jsj3tm9b20kymPNnRN2uzNz6RINdd/OtloYcPqGqSCRxWc+MXB0Ay97VDSOi7UbvOYcjbnkQnRNns9xJGCIx7rzZOpC8ZZfeAa0r4Ecvcc8XhFx2ExCkJHnBY/GH+HuqN0LgVGs/41ycmQAuNbOLzbTEGMcNb2Q8gGf/3tLi9XMj0DTSwzEqRx+A55kApEDukxtajqgb1j8qYwNYUSy+9D/HQUByUslc9FiJtuUVC5B369SdmFh5FL8krSRm2OuMtYBi87MAsB89Lf6gZlYrSl04J78hg4B6W2OchhZpNk3dUAQwL24FavuIG6YglGmkwLJ5o2DIoOwMtkzLb9ZqUTCqAS8zHyKpfOS1qSBJJpwdJkxum2G8/lJQiBdmxzO6TMqlnZI05xAtFwcjO7W/bn0UxSaK3IIg21zQ+YZb2jSIr0ADNpZ5pv94qaT6gFf2ZIxY4HLZsanyc0vVdl7Ux3hU7mxHIfnVpKQM4OyHHRyUu/t+MkBDeS2HFutVrCDeiSGIAoxU5RX54PGegbIZgB+VYMbYDSwwu/Lqmnk6BsZA8pRKf/3fjNfAX3u2+XU8+vFEfETK3pCFJJhUiwEK7Rxo+dGaBKZ0IfeeEhGrlNb5S4p0O+7HMH0y2pocma5vHDIYZHVA6qdMxw9k4KTGq8Eqgm+xVReWqn1hiwatuCnGI8+5/h39B5WV9i+arI9JhR2wj72QMJun6ZYU61TYUh0i5eKPOlrgRj/ZAsGuWPkF0w+36MSmXTOvrzXIg8lqKdPpIqI1yQ9XIFCnBL4z+XEsw0tnv+99VcFdETPSM2gFiiOPLTs33e02Ouz/3l0f5YX3fthXjckAqmDfzp7yAfbKO7Eytiv7nJeZraxm0eOtEmNU37kyFhPHU1HvNWQ4FbwVwgKK8SsRYBhFlWZMFdZ37B6oXrDIrNhfZanlmgr+qUjLN55kORSzRY4wtCkzm4wI3enXNvZSKf7bwEtk41d7qjyFnxUSN8wJmTD+lcfIgzwhE6Arki3gHV4PWUPEeW2IcV2uutj8RN13zi1uP51SW36ckWtFapBats34emyJV5i25lY+efGLN2/FKYs/uzxrbiJPgJJ0ce8gzR7Qw2NwV7f0cBc8q8DRtgBwFLYbE4v/7TeuWgddCGUOcugPxR1kRt15ttCb5LduyE3zqIaqGOkd4BSBayt5PB2qSRhCLUvu8gEr1fGIUIDKry08UjfxovnTNt4QmORPYpMXYm2Nbf8Iibb42sC5/WdzJgG3ESU7bp5l7TV0AbNxR1ArWe/QhIoe9xHEXZk0oEK7SEaxJ1nz84cXA6P2W5Fwr0gtGZONv0 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)(36860700013)(376014)(1800799024); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2024 13:07:14.8874 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 61b92643-ddee-40eb-034d-08dcc5d0018d 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: BL6PEPF0001AB74.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7161 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 (4): power: refactor core power management library power: refactor uncore power management library test/power: removed function pointer validations power/amd_uncore: uncore power management support for AMD EPYC processors app/test/test_power.c | 95 ----- app/test/test_power_cpufreq.c | 52 --- app/test/test_power_kvm_vm.c | 36 -- 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 | 8 +- drivers/power/amd_pstate/meson.build | 10 + drivers/power/amd_uncore/amd_uncore.c | 328 ++++++++++++++++++ drivers/power/amd_uncore/amd_uncore.h | 226 ++++++++++++ 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 | 8 +- drivers/power/intel_uncore/meson.build | 6 + .../power/kvm_vm}/guest_channel.c | 0 .../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 | 16 + drivers/power/meson.build | 14 + drivers/power/pstate/meson.build | 10 + .../power/pstate/pstate_cpufreq.c | 22 +- .../power/pstate/pstate_cpufreq.h | 6 +- examples/l3fwd-power/main.c | 12 +- lib/power/meson.build | 9 +- lib/power/power_common.c | 2 +- lib/power/power_common.h | 16 +- lib/power/rte_power.c | 291 ++++++---------- lib/power/rte_power.h | 139 +++++--- lib/power/rte_power_core_ops.h | 208 +++++++++++ lib/power/rte_power_uncore.c | 205 +++++------ lib/power/rte_power_uncore.h | 87 +++-- lib/power/rte_power_uncore_ops.h | 239 +++++++++++++ lib/power/version.map | 15 + 39 files changed, 1604 insertions(+), 625 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 (97%) 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 (100%) 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/rte_power_core_ops.h create mode 100644 lib/power/rte_power_uncore_ops.h