DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 1/2] eal: enable CPPC support in power library
@ 2024-09-06 21:06 Wathsala Vithanage
  2024-09-06 21:06 ` [PATCH 2/2] eal: detect supported driver Wathsala Vithanage
  2024-10-04 14:37 ` [PATCH 1/2] eal: enable CPPC support in power library David Marchand
  0 siblings, 2 replies; 3+ messages in thread
From: Wathsala Vithanage @ 2024-09-06 21:06 UTC (permalink / raw)
  To: Thomas Monjalon, Anatoly Burakov, David Hunt, Sivaprasad Tummala
  Cc: dev, Wathsala Vithanage, Dhruv Tripathi

Power library already supports Linux CPPC driver. Enable its use
and fix the name of the CPPC driver name.

Signed-off-by: Wathsala Vithanage <wathsala.vithanage@arm.com>
Reviewed-by: Dhruv Tripathi <dhruv.tripathi@arm.com>
---
 .mailmap                       |  1 +
 lib/power/power_cppc_cpufreq.c |  2 +-
 lib/power/rte_power_pmd_mgmt.c | 11 ++++++-----
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/.mailmap b/.mailmap
index 8aef1c59a4..a6e99234d1 100644
--- a/.mailmap
+++ b/.mailmap
@@ -343,6 +343,7 @@ Dexia Li <dexia.li@jaguarmicro.com>
 Dexuan Cui <decui@microsoft.com>
 Dharmik Thakkar <dharmikjayesh.thakkar@arm.com> <dharmik.thakkar@arm.com>
 Dheemanth Mallikarjun <dheemanthm@vmware.com>
+Dhruv Tripathi <dhruv.tripathi@arm.com>
 Diana Wang <na.wang@corigine.com>
 Didier Pallard <didier.pallard@6wind.com>
 Dilshod Urazov <dilshod.urazov@oktetlabs.ru>
diff --git a/lib/power/power_cppc_cpufreq.c b/lib/power/power_cppc_cpufreq.c
index 32aaacb948..e68b39b424 100644
--- a/lib/power/power_cppc_cpufreq.c
+++ b/lib/power/power_cppc_cpufreq.c
@@ -36,7 +36,7 @@
 #define POWER_SYSFILE_SYS_MAX \
 		"/sys/devices/system/cpu/cpu%u/cpufreq/cpuinfo_max_freq"
 
-#define POWER_CPPC_DRIVER "cppc-cpufreq"
+#define POWER_CPPC_DRIVER "cppc_cpufreq"
 #define BUS_FREQ     100000
 
 enum power_state {
diff --git a/lib/power/rte_power_pmd_mgmt.c b/lib/power/rte_power_pmd_mgmt.c
index b1c18a5f56..830a6c7a97 100644
--- a/lib/power/rte_power_pmd_mgmt.c
+++ b/lib/power/rte_power_pmd_mgmt.c
@@ -419,11 +419,12 @@ check_scale(unsigned int lcore)
 {
 	enum power_management_env env;
 
-	/* only PSTATE and ACPI modes are supported */
+	/* only PSTATE, AMD-PSTATE, ACPI and CPPC modes are supported */
 	if (!rte_power_check_env_supported(PM_ENV_ACPI_CPUFREQ) &&
 			!rte_power_check_env_supported(PM_ENV_PSTATE_CPUFREQ) &&
-			!rte_power_check_env_supported(PM_ENV_AMD_PSTATE_CPUFREQ)) {
-		POWER_LOG(DEBUG, "Neither ACPI nor PSTATE modes are supported");
+			!rte_power_check_env_supported(PM_ENV_AMD_PSTATE_CPUFREQ) &&
+			!rte_power_check_env_supported(PM_ENV_CPPC_CPUFREQ)) {
+		POWER_LOG(DEBUG, "Only ACPI, PSTATE, AMD-PSTATE, or CPPC modes are supported");
 		return -ENOTSUP;
 	}
 	/* ensure we could initialize the power library */
@@ -433,8 +434,8 @@ check_scale(unsigned int lcore)
 	/* ensure we initialized the correct env */
 	env = rte_power_get_env();
 	if (env != PM_ENV_ACPI_CPUFREQ && env != PM_ENV_PSTATE_CPUFREQ &&
-			env != PM_ENV_AMD_PSTATE_CPUFREQ) {
-		POWER_LOG(DEBUG, "Neither ACPI nor PSTATE modes were initialized");
+			env != PM_ENV_AMD_PSTATE_CPUFREQ && env != PM_ENV_CPPC_CPUFREQ) {
+		POWER_LOG(DEBUG, "Unable to initialize ACPI, PSTATE, AMD-PSTATE, or CPPC modes");
 		return -ENOTSUP;
 	}
 
-- 
2.34.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-10-04 14:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-06 21:06 [PATCH 1/2] eal: enable CPPC support in power library Wathsala Vithanage
2024-09-06 21:06 ` [PATCH 2/2] eal: detect supported driver Wathsala Vithanage
2024-10-04 14:37 ` [PATCH 1/2] eal: enable CPPC support in power library David Marchand

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).