#define FOPEN_OR_ERR_RET(f, retval) do { \
if ((f) == NULL) { \
- RTE_LOG(ERR, POWER, "File not openned\n"); \
+ RTE_LOG(ERR, POWER, "File not opened\n"); \
return retval; \
} \
} while (0)
"/sys/devices/system/cpu/cpu%u/cpufreq/cpuinfo_min_freq"
#define POWER_SYSFILE_BASE_FREQ \
"/sys/devices/system/cpu/cpu%u/cpufreq/base_frequency"
+#define POWER_PSTATE_DRIVER "intel_pstate"
#define POWER_MSR_PATH "/dev/cpu/%u/msr"
/*
return -1;
}
- POWER_DEBUG_TRACE("Freqency '%u' to be set for lcore %u\n",
+ POWER_DEBUG_TRACE("Frequency '%u' to be set for lcore %u\n",
target_freq, pi->lcore_id);
fflush(pi->f_cur_min);
return -1;
}
- POWER_DEBUG_TRACE("Freqency '%u' to be set for lcore %u\n",
+ POWER_DEBUG_TRACE("Frequency '%u' to be set for lcore %u\n",
target_freq, pi->lcore_id);
fflush(pi->f_cur_max);
return ret;
}
+int
+power_pstate_cpufreq_check_supported(void)
+{
+ return cpufreq_check_scaling_driver(POWER_PSTATE_DRIVER);
+}
+
int
power_pstate_cpufreq_init(unsigned int lcore_id)
{
}
pi = &lcore_power_info[lcore_id];
- if (pi->curr_idx == 0)
+ if (pi->curr_idx == 0 ||
+ (pi->curr_idx == 1 && pi->turbo_available && !pi->turbo_enable))
return 0;
/* Frequencies in the array are from high to low. */