From a0d15e43e42b158e25b9ad13052368ba22ecf113 Mon Sep 17 00:00:00 2001 From: Lee Daly Date: Fri, 12 Apr 2019 16:57:27 +0100 Subject: [PATCH] power: fix max frequency after turbo disabling 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. Fixes: e6c6dc0f96c8 ("power: add p-state driver compatibility") Cc: stable@dpdk.org Signed-off-by: Lee Daly Acked-by: David Hunt Acked-by: Liang Ma --- lib/librte_power/power_pstate_cpufreq.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/librte_power/power_pstate_cpufreq.c b/lib/librte_power/power_pstate_cpufreq.c index 336c13869d..c2c4e8e144 100644 --- a/lib/librte_power/power_pstate_cpufreq.c +++ b/lib/librte_power/power_pstate_cpufreq.c @@ -810,6 +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; } -- 2.20.1