]>
git.proxmox.com Git - ceph.git/blob - ceph/src/spdk/dpdk/test/test/test_power.c
1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2014 Intel Corporation
13 #ifndef RTE_LIBRTE_POWER
18 printf("Power management library not supported, skipping test\n");
24 #include <rte_power.h>
30 enum power_management_env env
;
32 /* Test setting an invalid environment */
33 ret
= rte_power_set_env(PM_ENV_NOT_SET
);
35 printf("Unexpectedly succeeded on setting an invalid environment\n");
39 /* Test that the environment has not been set */
40 env
= rte_power_get_env();
41 if (env
!= PM_ENV_NOT_SET
) {
42 printf("Unexpectedly got a valid environment configuration\n");
46 /* verify that function pointers are NULL */
47 if (rte_power_freqs
!= NULL
) {
48 printf("rte_power_freqs should be NULL, environment has not been "
52 if (rte_power_get_freq
!= NULL
) {
53 printf("rte_power_get_freq should be NULL, environment has not been "
57 if (rte_power_set_freq
!= NULL
) {
58 printf("rte_power_set_freq should be NULL, environment has not been "
62 if (rte_power_freq_up
!= NULL
) {
63 printf("rte_power_freq_up should be NULL, environment has not been "
67 if (rte_power_freq_down
!= NULL
) {
68 printf("rte_power_freq_down should be NULL, environment has not been "
72 if (rte_power_freq_max
!= NULL
) {
73 printf("rte_power_freq_max should be NULL, environment has not been "
77 if (rte_power_freq_min
!= NULL
) {
78 printf("rte_power_freq_min should be NULL, environment has not been "
82 rte_power_unset_env();
85 rte_power_unset_env();
90 REGISTER_TEST_COMMAND(power_autotest
, test_power
);