1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2014 Intel Corporation
5 #ifndef _POWER_KVM_VM_H
6 #define _POWER_KVM_VM_H
10 * RTE Power Management KVM VM
13 #include <rte_common.h>
14 #include <rte_byteorder.h>
16 #include <rte_string_fns.h>
17 #include "rte_power.h"
20 * Check if KVM power management is supported.
25 * - -1 if error, with rte_errno indicating reason for error.
27 int power_kvm_vm_check_supported(void);
30 * Initialize power management for a specific lcore.
37 * - Negative on error.
39 int power_kvm_vm_init(unsigned int lcore_id);
42 * Exit power management on a specific lcore.
49 * - Negative on error.
51 int power_kvm_vm_exit(unsigned int lcore_id);
54 * Get the available frequencies of a specific lcore.
55 * It is not currently supported for VM Power Management.
60 * The buffer array to save the frequencies.
62 * The number of frequencies to get.
67 uint32_t power_kvm_vm_freqs(unsigned int lcore_id, uint32_t *freqs,
71 * Return the current index of available frequencies of a specific lcore.
72 * It is not currently supported for VM Power Management.
80 uint32_t power_kvm_vm_get_freq(unsigned int lcore_id);
83 * Set the new frequency for a specific lcore by indicating the index of
84 * available frequencies.
85 * It is not currently supported for VM Power Management.
90 * The index of available frequencies.
95 int power_kvm_vm_set_freq(unsigned int lcore_id, uint32_t index);
98 * Scale up the frequency of a specific lcore. This request is forwarded to the
100 * It should be protected outside of this function for threadsafe.
107 * - Negative on error.
109 int power_kvm_vm_freq_up(unsigned int lcore_id);
112 * Scale down the frequency of a specific lcore according to the available
114 * It should be protected outside of this function for threadsafe.
121 * - Negative on error.
123 int power_kvm_vm_freq_down(unsigned int lcore_id);
126 * Scale up the frequency of a specific lcore to the highest according to the
127 * available frequencies.
128 * It should be protected outside of this function for threadsafe.
135 * - Negative on error.
137 int power_kvm_vm_freq_max(unsigned int lcore_id);
140 * Scale down the frequency of a specific lcore to the lowest according to the
141 * available frequencies.
142 * It should be protected outside of this function for threadsafe.
149 * - Negative on error.
151 int power_kvm_vm_freq_min(unsigned int lcore_id);
154 * It should be protected outside of this function for threadsafe.
162 int power_kvm_vm_turbo_status(unsigned int lcore_id);
165 * It should be protected outside of this function for threadsafe.
172 * - Negative on error.
174 int power_kvm_vm_enable_turbo(unsigned int lcore_id);
177 * It should be protected outside of this function for threadsafe.
184 * - Negative on error.
186 int power_kvm_vm_disable_turbo(unsigned int lcore_id);
189 * Returns power capabilities for a specific lcore.
194 * pointer to rte_power_core_capabilities object.
198 * - Negative on error.
200 int power_kvm_vm_get_capabilities(unsigned int lcore_id,
201 struct rte_power_core_capabilities *caps);