DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jie Hai <haijie1@huawei.com>
To: <david.hunt@intel.com>
Cc: <liudongdong3@huawei.com>, <haijie1@huawei.com>, <dev@dpdk.org>
Subject: [PATCH] examples/l3fwd-power: support CPPC cpufreq
Date: Tue, 31 Jan 2023 10:58:52 +0800	[thread overview]
Message-ID: <20230131025852.11240-1-haijie1@huawei.com> (raw)

Currently the l3fwd-power only supports ACPI cpufreq and Pstate
cpufreq, This patch adds CPPC cpufreq.

Signed-off-by: Jie Hai <haijie1@huawei.com>
---
 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


             reply	other threads:[~2023-01-31  3:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-31  2:58 Jie Hai [this message]
2023-02-22  2:13 ` Jie Hai
2023-02-22  9:46   ` Hunt, David
2023-03-06  6:35     ` Jie Hai
2023-03-12 14:39     ` Thomas Monjalon
2023-03-09  7:23 ` Dongdong Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230131025852.11240-1-haijie1@huawei.com \
    --to=haijie1@huawei.com \
    --cc=david.hunt@intel.com \
    --cc=dev@dpdk.org \
    --cc=liudongdong3@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).