From: Anatoly Burakov Date: Thu, 8 Jul 2021 15:38:22 +0000 (+0100) Subject: power: fix namespace for internal struct X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=02a6d683113428f87e2375ba249b9c40ae46ff79;p=dpdk.git power: fix namespace for internal struct Currently, ACPI code uses rte_power_info as the struct name, which gives the appearance that this is an externally visible API. Fix to use internal namespace. Signed-off-by: Anatoly Burakov Acked-by: David Hunt --- diff --git a/lib/power/power_acpi_cpufreq.c b/lib/power/power_acpi_cpufreq.c index d028a9947f..1b8c69cc8b 100644 --- a/lib/power/power_acpi_cpufreq.c +++ b/lib/power/power_acpi_cpufreq.c @@ -78,7 +78,7 @@ enum power_state { /** * Power info per lcore. */ -struct rte_power_info { +struct acpi_power_info { unsigned int lcore_id; /**< Logical core id */ uint32_t freqs[RTE_MAX_LCORE_FREQS]; /**< Frequency array */ uint32_t nb_freqs; /**< number of available freqs */ @@ -90,14 +90,14 @@ struct rte_power_info { uint16_t turbo_enable; /**< Turbo Boost enable/disable */ } __rte_cache_aligned; -static struct rte_power_info lcore_power_info[RTE_MAX_LCORE]; +static struct acpi_power_info lcore_power_info[RTE_MAX_LCORE]; /** * It is to set specific freq for specific logical core, according to the index * of supported frequencies. */ static int -set_freq_internal(struct rte_power_info *pi, uint32_t idx) +set_freq_internal(struct acpi_power_info *pi, uint32_t idx) { if (idx >= RTE_MAX_LCORE_FREQS || idx >= pi->nb_freqs) { RTE_LOG(ERR, POWER, "Invalid frequency index %u, which " @@ -133,7 +133,7 @@ set_freq_internal(struct rte_power_info *pi, uint32_t idx) * governor will be saved for rolling back. */ static int -power_set_governor_userspace(struct rte_power_info *pi) +power_set_governor_userspace(struct acpi_power_info *pi) { FILE *f; int ret = -1; @@ -189,7 +189,7 @@ out: * sys file. */ static int -power_get_available_freqs(struct rte_power_info *pi) +power_get_available_freqs(struct acpi_power_info *pi) { FILE *f; int ret = -1, i, count; @@ -259,7 +259,7 @@ out: * It is to fopen the sys file for the future setting the lcore frequency. */ static int -power_init_for_setting_freq(struct rte_power_info *pi) +power_init_for_setting_freq(struct acpi_power_info *pi) { FILE *f; char fullpath[PATH_MAX]; @@ -299,7 +299,7 @@ power_acpi_cpufreq_check_supported(void) int power_acpi_cpufreq_init(unsigned int lcore_id) { - struct rte_power_info *pi; + struct acpi_power_info *pi; uint32_t exp_state; if (lcore_id >= RTE_MAX_LCORE) { @@ -374,7 +374,7 @@ fail: * needed by writing the sys file. */ static int -power_set_governor_original(struct rte_power_info *pi) +power_set_governor_original(struct acpi_power_info *pi) { FILE *f; int ret = -1; @@ -420,7 +420,7 @@ out: int power_acpi_cpufreq_exit(unsigned int lcore_id) { - struct rte_power_info *pi; + struct acpi_power_info *pi; uint32_t exp_state; if (lcore_id >= RTE_MAX_LCORE) { @@ -475,7 +475,7 @@ fail: uint32_t power_acpi_cpufreq_freqs(unsigned int lcore_id, uint32_t *freqs, uint32_t num) { - struct rte_power_info *pi; + struct acpi_power_info *pi; if (lcore_id >= RTE_MAX_LCORE) { RTE_LOG(ERR, POWER, "Invalid lcore ID\n"); @@ -522,7 +522,7 @@ power_acpi_cpufreq_set_freq(unsigned int lcore_id, uint32_t index) int power_acpi_cpufreq_freq_down(unsigned int lcore_id) { - struct rte_power_info *pi; + struct acpi_power_info *pi; if (lcore_id >= RTE_MAX_LCORE) { RTE_LOG(ERR, POWER, "Invalid lcore ID\n"); @@ -540,7 +540,7 @@ power_acpi_cpufreq_freq_down(unsigned int lcore_id) int power_acpi_cpufreq_freq_up(unsigned int lcore_id) { - struct rte_power_info *pi; + struct acpi_power_info *pi; if (lcore_id >= RTE_MAX_LCORE) { RTE_LOG(ERR, POWER, "Invalid lcore ID\n"); @@ -581,7 +581,7 @@ power_acpi_cpufreq_freq_max(unsigned int lcore_id) int power_acpi_cpufreq_freq_min(unsigned int lcore_id) { - struct rte_power_info *pi; + struct acpi_power_info *pi; if (lcore_id >= RTE_MAX_LCORE) { RTE_LOG(ERR, POWER, "Invalid lcore ID\n"); @@ -598,7 +598,7 @@ power_acpi_cpufreq_freq_min(unsigned int lcore_id) int power_acpi_turbo_status(unsigned int lcore_id) { - struct rte_power_info *pi; + struct acpi_power_info *pi; if (lcore_id >= RTE_MAX_LCORE) { RTE_LOG(ERR, POWER, "Invalid lcore ID\n"); @@ -614,7 +614,7 @@ power_acpi_turbo_status(unsigned int lcore_id) int power_acpi_enable_turbo(unsigned int lcore_id) { - struct rte_power_info *pi; + struct acpi_power_info *pi; if (lcore_id >= RTE_MAX_LCORE) { RTE_LOG(ERR, POWER, "Invalid lcore ID\n"); @@ -647,7 +647,7 @@ power_acpi_enable_turbo(unsigned int lcore_id) int power_acpi_disable_turbo(unsigned int lcore_id) { - struct rte_power_info *pi; + struct acpi_power_info *pi; if (lcore_id >= RTE_MAX_LCORE) { RTE_LOG(ERR, POWER, "Invalid lcore ID\n"); @@ -674,7 +674,7 @@ power_acpi_disable_turbo(unsigned int lcore_id) int power_acpi_get_capabilities(unsigned int lcore_id, struct rte_power_core_capabilities *caps) { - struct rte_power_info *pi; + struct acpi_power_info *pi; if (lcore_id >= RTE_MAX_LCORE) { RTE_LOG(ERR, POWER, "Invalid lcore ID\n");