lib/librte_power: set new frequecy on turbo_disable
PATCH 1/1 lib/librte_power: set new frequecy on turbo_disable
This patch will ensure the correct max frequency of a core is set in the lcore_power_info struct when disabling turbo, while using the intel pstate driver.
--- lib/librte_power/power_pstate_cpufreq.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
lib/librte_power/power_pstate_cpufreq.c +9 -1
@@ -810,7 +810,15 @@ power_pstate_disable_turbo(unsigned int lcore_id) pi->turbo_enable =0 ; - +if ((pi->turbo_available) && (pi->curr_idx <=1 )) { +/* Try to set freq to max by default coming out of turbo */ +if (power_pstate_cpufreq_freq_max (lcore_id) <0 ) { +RTE_LOG (ERR ,POWER , +"Failed to set frequency of lcore %u to max\n" , + lcore_id); +return -1 ; + } + }return 0 ; }
Signature · 1 line
2.17.1
Quoted 24 lines · Lee Daly
This patch will ensure the correct max frequency of a core is set in the
lcore_power_infostruct when disabling turbo, while using the intel pstate driver.Fixes e6c6dc0f96c8 ("power: add p-state driver compatibility")Signed-off-by Lee Daly <[email protected]>--- lib/librte_power/power_pstate_cpufreq.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)lib/librte_power/power_pstate_cpufreq.c +2
-1@@ -810,7 +810,15 @@ power_pstate_disable_turbo(unsigned int lcore_id) pi->turbo_enable =0 ; - +if ((pi->turbo_available) && (pi->curr_idx <=1 )) { +/* Try to set freq to max by default coming out of turbo */
lib/librte_power/power_pstate_cpufreq.c power_pstate_disable_turbo(unsigned int lcore_id) · line 824
Quoted 10 lines
lib/librte_power/power_pstate_cpufreq.c +7
-0+if (power_pstate_cpufreq_freq_max (lcore_id) <0 ) { +RTE_LOG (ERR ,POWER , +"Failed to set frequency of lcore %u to max\n" , + lcore_id); +return -1 ; + } + }return 0 ; }
15/04/2019 11:21, Hunt, David:
Quoted 9 lines · Lee Daly
Quoted 8 lines
This patch will ensure the correct max frequency of a core is set in the
lcore_power_infostruct when disabling turbo, while using the intel pstate driver.Fixes e6c6dc0f96c8 ("power: add p-state driver compatibility")
Quoted 16 lines
Quoted 4 lines
Signed-off-by Lee Daly <[email protected]>---
lib/librte_power/power_pstate_cpufreq.c +1
-1- +if ((pi->turbo_available) && (pi->curr_idx <=1 )) {lib/librte_power/power_pstate_cpufreq.c power_pstate_disable_turbo(unsigned int lcore_id) · line 823
Quoted 10 lines
lib/librte_power/power_pstate_cpufreq.c +8
-0+/* Try to set freq to max by default coming out of turbo */ +if (power_pstate_cpufreq_freq_max (lcore_id) <0 ) { +RTE_LOG (ERR ,POWER , +"Failed to set frequency of lcore %u to max\n" , + lcore_id); +return -1 ; + } + }return 0 ; }Acked-by David Hunt <[email protected]>
Applied without extra parentheses and with blank line restored.
Quoted 37 lines · Lee Daly
This patch will ensure the correct max frequency of a core is set in the
lcore_power_infostruct when disabling turbo, while using the intel pstate driver.Fixes e6c6dc0f96c8 ("power: add p-state driver compatibility")Signed-off-by Lee Daly <[email protected]>--- lib/librte_power/power_pstate_cpufreq.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)lib/librte_power/power_pstate_cpufreq.c +9
-1@@ -810,7 +810,15 @@ power_pstate_disable_turbo(unsigned int lcore_id) pi->turbo_enable =0 ; - +if ((pi->turbo_available) && (pi->curr_idx <=1 )) { +/* Try to set freq to max by default coming out of turbo */ +if (power_pstate_cpufreq_freq_max (lcore_id) <0 ) { +RTE_LOG (ERR ,POWER , +"Failed to set frequency of lcore %u to max\n" , + lcore_id); +return -1 ; + } + }return 0 ; }Signature · 1 line
2.17.1
Quoted 4 lines · Ma
lib/librte_power/power_pstate_cpufreq.c power_pstate_disable_turbo(unsigned int lcore_id) · line 813
Quoted 4 lines
lib/librte_power/power_pstate_cpufreq.c +1
-1pi->turbo_enable =0 ; - +if ((pi->turbo_available) && (pi->curr_idx <=1 )) {
You (don't) need (so many) parenthesis.
Quoted 9 lines · Stephen Hemminger
Quoted 4 lines · Ma
lib/librte_power/power_pstate_cpufreq.c power_pstate_disable_turbo(unsigned int lcore_id) · line 813
Quoted 4 lines
lib/librte_power/power_pstate_cpufreq.c +1
-1pi->turbo_enable =0 ; - +if ((pi->turbo_available) && (pi->curr_idx <=1 )) {You (don't) need (so many) parenthesis.
True (but it doesn't hurt (either)) :-)