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 7A8E741B88; Tue, 31 Jan 2023 04:00:17 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 585C0410E6; Tue, 31 Jan 2023 04:00:17 +0100 (CET) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id D384040EF0 for ; Tue, 31 Jan 2023 04:00:15 +0100 (CET) Received: from kwepemi500020.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4P5V9n3h3rzJs84 for ; Tue, 31 Jan 2023 10:58:37 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by kwepemi500020.china.huawei.com (7.221.188.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 31 Jan 2023 11:00:11 +0800 From: Jie Hai To: CC: , , Subject: [PATCH] examples/l3fwd-power: support CPPC cpufreq Date: Tue, 31 Jan 2023 10:58:52 +0800 Message-ID: <20230131025852.11240-1-haijie1@huawei.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemi500020.china.huawei.com (7.221.188.8) X-CFilter-Loop: Reflected 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 Currently the l3fwd-power only supports ACPI cpufreq and Pstate cpufreq, This patch adds CPPC cpufreq. Signed-off-by: Jie Hai --- examples/l3fwd-power/main.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c index fd3ade330f82..5090d5598172 100644 --- a/examples/l3fwd-power/main.c +++ b/examples/l3fwd-power/main.c @@ -2453,9 +2453,10 @@ init_power_library(void) /* we're not supporting the VM channel mode */ env = rte_power_get_env(); if (env != PM_ENV_ACPI_CPUFREQ && - env != PM_ENV_PSTATE_CPUFREQ) { + env != PM_ENV_PSTATE_CPUFREQ && + env != PM_ENV_CPPC_CPUFREQ) { RTE_LOG(ERR, POWER, - "Only ACPI and PSTATE mode are supported\n"); + "Only ACPI, PSTATE and CPPC mode are supported\n"); return -1; } } @@ -2639,12 +2640,14 @@ autodetect_mode(void) /* * Empty poll and telemetry modes have to be specifically requested to * be enabled, but we can auto-detect between interrupt mode with or - * without frequency scaling. Both ACPI and pstate can be used. + * without frequency scaling. Any of ACPI, pstate and CPPC can be used. */ if (rte_power_check_env_supported(PM_ENV_ACPI_CPUFREQ)) return APP_MODE_LEGACY; if (rte_power_check_env_supported(PM_ENV_PSTATE_CPUFREQ)) return APP_MODE_LEGACY; + if (rte_power_check_env_supported(PM_ENV_CPPC_CPUFREQ)) + return APP_MODE_LEGACY; RTE_LOG(NOTICE, L3FWD_POWER, "Frequency scaling not supported, selecting interrupt-only mode\n"); -- 2.30.0