examples/l3fwd-power: support CPPC cpufreq

Message ID 20230131025852.11240-1-haijie1@huawei.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series examples/l3fwd-power: support CPPC cpufreq |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/github-robot: build success github build: passed
ci/iol-intel-Functional success Functional Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-intel-Performance success Performance Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS

Commit Message

Jie Hai Jan. 31, 2023, 2:58 a.m. UTC
  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(-)
  

Comments

Jie Hai Feb. 22, 2023, 2:13 a.m. UTC | #1
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 <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");
>
  
Hunt, David Feb. 22, 2023, 9:46 a.m. UTC | #2
On 22/02/2023 02:13, Jie Hai wrote:
> 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 <haijie1@huawei.com>
>>

Hi, Jie Hai,

Apologies, this patch never got to my inbox.

Looks good to me.

Acked-by: David Hunt <david.hunt@intel.com>
  
Jie Hai March 6, 2023, 6:35 a.m. UTC | #3
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

On 2023/2/22 17:46, Hunt, David wrote:
> 
> On 22/02/2023 02:13, Jie Hai wrote:
>> 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 <haijie1@huawei.com>
>>>
> 
> Hi, Jie Hai,
> 
> Apologies, this patch never got to my inbox.
> 
> Looks good to me.
> 
> Acked-by: David Hunt <david.hunt@intel.com>
> 
> 
> .
  
Dongdong Liu March 9, 2023, 7:23 a.m. UTC | #4
Hi Jie

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 <haijie1@huawei.com>

Looks good, so

Acked-by: Dongdong Liu <liudongdong3@huawei.com>

Thanks,
Dongdong
> ---
>  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");
>
>
  
Thomas Monjalon March 12, 2023, 2:39 p.m. UTC | #5
22/02/2023 10:46, Hunt, David:
> 
> On 22/02/2023 02:13, Jie Hai wrote:
> > 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 <haijie1@huawei.com>
> >>
> 
> Hi, Jie Hai,
> 
> Apologies, this patch never got to my inbox.
> 
> Looks good to me.
> 
> Acked-by: David Hunt <david.hunt@intel.com>

Applied, thanks.
  

Patch

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");