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 C279741D34; Wed, 22 Feb 2023 03:13:15 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5BE6540697; Wed, 22 Feb 2023 03:13:15 +0100 (CET) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id CB60640693 for ; Wed, 22 Feb 2023 03:13:13 +0100 (CET) Received: from kwepemi500020.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4PM04K363HznWgg for ; Wed, 22 Feb 2023 10:10:41 +0800 (CST) Received: from [10.67.103.42] (10.67.103.42) 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.2507.17; Wed, 22 Feb 2023 10:13:11 +0800 Message-ID: <5726e864-bf7c-2c02-2aec-c9fa0e94dac3@huawei.com> Date: Wed, 22 Feb 2023 10:13:10 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH] examples/l3fwd-power: support CPPC cpufreq To: CC: , References: <20230131025852.11240-1-haijie1@huawei.com> From: Jie Hai In-Reply-To: <20230131025852.11240-1-haijie1@huawei.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.103.42] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) 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 Hi, David Hunt, Kindly ping. Could you please take a look at this patch? Thanks, Jie Hai On 2023/1/31 10:58, Jie Hai wrote: > 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"); >