| 415 | } |
| 416 | |
| 417 | static int |
| 418 | check_scale(unsigned int lcore) |
| 419 | { |
| 420 | enum power_management_env env; |
| 421 | |
| 422 | /* only PSTATE, AMD-PSTATE, ACPI and CPPC modes are supported */ |
| 423 | if (!rte_power_check_env_supported(PM_ENV_ACPI_CPUFREQ) && |
| 424 | !rte_power_check_env_supported(PM_ENV_PSTATE_CPUFREQ) && |
| 425 | !rte_power_check_env_supported(PM_ENV_AMD_PSTATE_CPUFREQ) && |
| 426 | !rte_power_check_env_supported(PM_ENV_CPPC_CPUFREQ)) { |
| 427 | RTE_LOG(DEBUG, POWER, "Only ACPI, PSTATE, AMD-PSTATE, or CPPC modes are supported\n"); |
| 428 | return -ENOTSUP; |
| 429 | } |
| 430 | /* ensure we could initialize the power library */ |
| 431 | if (rte_power_init(lcore)) |
| 432 | return -EINVAL; |
| 433 | |
| 434 | /* ensure we initialized the correct env */ |
| 435 | env = rte_power_get_env(); |
| 436 | if (env != PM_ENV_ACPI_CPUFREQ && env != PM_ENV_PSTATE_CPUFREQ && |
| 437 | env != PM_ENV_AMD_PSTATE_CPUFREQ && env != PM_ENV_CPPC_CPUFREQ) { |
| 438 | RTE_LOG(DEBUG, POWER, "Unable to initialize ACPI, PSTATE, AMD-PSTATE, or CPPC modes\n"); |
| 439 | return -ENOTSUP; |
| 440 | } |
| 441 | |
| 442 | /* we're done */ |
| 443 | return 0; |
| 444 | } |
| 445 | |
| 446 | static int |
| 447 | check_monitor(struct pmd_core_cfg *cfg, const union queue *qdata) |
no test coverage detected