Skip to contentSkip to conversation

examples/l3fwd-power: support CPPC cpufreq

PATCH Applied Jie Hai 4 participants 6 messages Jan 31, 2023 – Mar 12, 2023

lore
Share & tools
lore

Jie Hai

author
#0 lore raw

PATCH 1/1 examples/l3fwd-power: support CPPC cpufreq

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

---
 examples/l3fwd-power/main.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
examples/l3fwd-power/main.c +6 -3
index fd3ade330f82..5090d5598172 100644
@@ -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");
 
Signature · 1 line
2.30.0
author
#1 lore raw

Hi, David Hunt,

Kindly ping. Could you please take a look at this patch?

Thanks,
Jie Hai

Quoted 41 lines · Jie Hai

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

---
  examples/l3fwd-power/main.c | 9 ++++++---
  1 file changed, 6 insertions(+), 3 deletions(-)
examples/l3fwd-power/main.c +6 -3
index fd3ade330f82..5090d5598172 100644
@@ -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");
 
Acked-by
#2 lore raw
Quoted 13 lines · Jie Hai

Hi, David Hunt,

Kindly ping. Could you please take a look at this patch?

Thanks,
Jie Hai

Quoted 5 lines · Jie Hai

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

Hi, Jie Hai,

Apologies, this patch never got to my inbox.

Looks good to me.

author
#3 lore raw

Hi, Thomas,

A gentle ping~
Since this patch has been acked by David Hunt,
is there anything more I can do to push the process forward?

Thanks,
Jie Hai

Quoted 26 lines · David
Quoted 13 lines · Jie Hai

Hi, David Hunt,

Kindly ping. Could you please take a look at this patch?

Thanks,
Jie Hai

Quoted 5 lines · Jie Hai

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

Hi, Jie Hai,

Apologies, this patch never got to my inbox.

Looks good to me.

.

#4 lore raw
In reply to Hunt, David

22/02/2023 10:46, Hunt, David:

Quoted 16 lines · Jie Hai
Quoted 13 lines

Hi, David Hunt,

Kindly ping. Could you please take a look at this patch?

Thanks,
Jie Hai

Quoted 5 lines · Jie Hai

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

Quoted 7 lines

Hi, Jie Hai,

Apologies, this patch never got to my inbox.

Looks good to me.

Applied, thanks.

Acked-by on v1 1/1
#5 lore raw
In reply to Jie Hai

Hi Jie

Quoted 4 lines · Jie Hai

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

Looks good, so

Thanks,
Dongdong

Quoted 38 lines
---
 examples/l3fwd-power/main.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
examples/l3fwd-power/main.c +6 -3
index fd3ade330f82..5090d5598172 100644
@@ -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");