MCPcopy Create free account
hub / github.com/F-Stack/f-stack / rte_power_init

Function rte_power_init

dpdk/lib/power/rte_power.c:175–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

173}
174
175int
176rte_power_init(unsigned int lcore_id)
177{
178 int ret = -1;
179
180 switch (global_default_env) {
181 case PM_ENV_ACPI_CPUFREQ:
182 return power_acpi_cpufreq_init(lcore_id);
183 case PM_ENV_KVM_VM:
184 return power_kvm_vm_init(lcore_id);
185 case PM_ENV_PSTATE_CPUFREQ:
186 return power_pstate_cpufreq_init(lcore_id);
187 case PM_ENV_CPPC_CPUFREQ:
188 return power_cppc_cpufreq_init(lcore_id);
189 case PM_ENV_AMD_PSTATE_CPUFREQ:
190 return power_amd_pstate_cpufreq_init(lcore_id);
191 default:
192 RTE_LOG(INFO, POWER, "Env isn't set yet!\n");
193 }
194
195 /* Auto detect Environment */
196 RTE_LOG(INFO, POWER, "Attempting to initialise ACPI cpufreq power management...\n");
197 ret = power_acpi_cpufreq_init(lcore_id);
198 if (ret == 0) {
199 rte_power_set_env(PM_ENV_ACPI_CPUFREQ);
200 goto out;
201 }
202
203 RTE_LOG(INFO, POWER, "Attempting to initialise PSTAT power management...\n");
204 ret = power_pstate_cpufreq_init(lcore_id);
205 if (ret == 0) {
206 rte_power_set_env(PM_ENV_PSTATE_CPUFREQ);
207 goto out;
208 }
209
210 RTE_LOG(INFO, POWER, "Attempting to initialise AMD PSTATE power management...\n");
211 ret = power_amd_pstate_cpufreq_init(lcore_id);
212 if (ret == 0) {
213 rte_power_set_env(PM_ENV_AMD_PSTATE_CPUFREQ);
214 goto out;
215 }
216
217 RTE_LOG(INFO, POWER, "Attempting to initialise CPPC power management...\n");
218 ret = power_cppc_cpufreq_init(lcore_id);
219 if (ret == 0) {
220 rte_power_set_env(PM_ENV_CPPC_CPUFREQ);
221 goto out;
222 }
223
224 RTE_LOG(INFO, POWER, "Attempting to initialise VM power management...\n");
225 ret = power_kvm_vm_init(lcore_id);
226 if (ret == 0) {
227 rte_power_set_env(PM_ENV_KVM_VM);
228 goto out;
229 }
230 RTE_LOG(ERR, POWER, "Unable to set Power Management Environment for lcore "
231 "%u\n", lcore_id);
232out:

Callers 8

check_scaleFunction · 0.85
test_power_cpufreqFunction · 0.85
test_power_capsFunction · 0.85
test_power_kvm_vmFunction · 0.85
init_power_libraryFunction · 0.85
init_power_libraryFunction · 0.85
power_manager_initFunction · 0.85
mainFunction · 0.85

Calls 6

power_acpi_cpufreq_initFunction · 0.85
power_kvm_vm_initFunction · 0.85
power_cppc_cpufreq_initFunction · 0.85
rte_power_set_envFunction · 0.85

Tested by 3

test_power_cpufreqFunction · 0.68
test_power_capsFunction · 0.68
test_power_kvm_vmFunction · 0.68