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"
24 * Check if KVM power management is supported.
29 * - -1 if error, with rte_errno indicating reason for error.
31 int power_kvm_vm_check_supported(void);
34 * Initialize power management for a specific lcore.
41 * - Negative on error.
43 int power_kvm_vm_init(unsigned int lcore_id);
46 * Exit power management on a specific lcore.
53 * - Negative on error.
55 int power_kvm_vm_exit(unsigned int lcore_id);
58 * Get the available frequencies of a specific lcore.
59 * It is not currently supported for VM Power Management.
64 * The buffer array to save the frequencies.
66 * The number of frequencies to get.
71 uint32_t power_kvm_vm_freqs(unsigned int lcore_id, uint32_t *freqs,
75 * Return the current index of available frequencies of a specific lcore.
76 * It is not currently supported for VM Power Management.
84 uint32_t power_kvm_vm_get_freq(unsigned int lcore_id);
87 * Set the new frequency for a specific lcore by indicating the index of
88 * available frequencies.
89 * It is not currently supported for VM Power Management.
94 * The index of available frequencies.
99 int power_kvm_vm_set_freq(unsigned int lcore_id, uint32_t index);
102 * Scale up the frequency of a specific lcore. This request is forwarded to the
104 * It should be protected outside of this function for threadsafe.
111 * - Negative on error.
113 int power_kvm_vm_freq_up(unsigned int lcore_id);
116 * Scale down the frequency of a specific lcore according to the available
118 * It should be protected outside of this function for threadsafe.
125 * - Negative on error.
127 int power_kvm_vm_freq_down(unsigned int lcore_id);
130 * Scale up the frequency of a specific lcore to the highest according to the
131 * available frequencies.
132 * It should be protected outside of this function for threadsafe.
139 * - Negative on error.
141 int power_kvm_vm_freq_max(unsigned int lcore_id);
144 * Scale down the frequency of a specific lcore to the lowest according to the
145 * available frequencies.
146 * It should be protected outside of this function for threadsafe.
153 * - Negative on error.
155 int power_kvm_vm_freq_min(unsigned int lcore_id);
158 * It should be protected outside of this function for threadsafe.
166 int power_kvm_vm_turbo_status(unsigned int lcore_id);
169 * It should be protected outside of this function for threadsafe.
176 * - Negative on error.
178 int power_kvm_vm_enable_turbo(unsigned int lcore_id);
181 * It should be protected outside of this function for threadsafe.
188 * - Negative on error.
190 int power_kvm_vm_disable_turbo(unsigned int lcore_id);
193 * Returns power capabilities for a specific lcore.
198 * pointer to rte_power_core_capabilities object.
202 * - Negative on error.
204 int power_kvm_vm_get_capabilities(unsigned int lcore_id,
205 struct rte_power_core_capabilities *caps);