| 2234 | } |
| 2235 | |
| 2236 | static int |
| 2237 | init_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 | |
| 2266 | static int |
| 2267 | deinit_power_library(void) |
no test coverage detected