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

Function init_power_library

dpdk/examples/l3fwd-power/main.c:2236–2264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2234}
2235
2236static int
2237init_power_library(void)
2238{
2239 enum power_management_env env;
2240 unsigned int lcore_id;
2241 int ret = 0;
2242
2243 RTE_LCORE_FOREACH(lcore_id) {
2244 /* init power management library */
2245 ret = rte_power_init(lcore_id);
2246 if (ret) {
2247 RTE_LOG(ERR, POWER,
2248 "Library initialization failed on core %u\n",
2249 lcore_id);
2250 return ret;
2251 }
2252 /* we're not supporting the VM channel mode */
2253 env = rte_power_get_env();
2254 if (env != PM_ENV_ACPI_CPUFREQ &&
2255 env != PM_ENV_PSTATE_CPUFREQ &&
2256 env != PM_ENV_AMD_PSTATE_CPUFREQ &&
2257 env != PM_ENV_CPPC_CPUFREQ) {
2258 RTE_LOG(ERR, POWER,
2259 "Only ACPI, PSTATE and CPPC mode are supported\n");
2260 return -1;
2261 }
2262 }
2263 return ret;
2264}
2265
2266static int
2267deinit_power_library(void)

Callers 1

mainFunction · 0.70

Calls 2

rte_power_initFunction · 0.85
rte_power_get_envFunction · 0.85

Tested by

no test coverage detected