Check rte_power_get_freq() */
| 183 | |
| 184 | /* Check rte_power_get_freq() */ |
| 185 | static int |
| 186 | check_power_get_freq(void) |
| 187 | { |
| 188 | int ret; |
| 189 | uint32_t count; |
| 190 | |
| 191 | /* test with an invalid lcore id */ |
| 192 | count = rte_power_get_freq(TEST_POWER_LCORE_INVALID); |
| 193 | if (count < TEST_POWER_FREQS_NUM_MAX) { |
| 194 | printf("Unexpectedly get freq index successfully on " |
| 195 | "lcore %u\n", TEST_POWER_LCORE_INVALID); |
| 196 | return -1; |
| 197 | } |
| 198 | |
| 199 | count = rte_power_get_freq(TEST_POWER_LCORE_ID); |
| 200 | if (count >= TEST_POWER_FREQS_NUM_MAX) { |
| 201 | printf("Fail to get the freq index on lcore %u\n", |
| 202 | TEST_POWER_LCORE_ID); |
| 203 | return -1; |
| 204 | } |
| 205 | |
| 206 | /* Check the current frequency */ |
| 207 | ret = check_cur_freq(TEST_POWER_LCORE_ID, count, false); |
| 208 | if (ret < 0) |
| 209 | return -1; |
| 210 | |
| 211 | return 0; |
| 212 | } |
| 213 | |
| 214 | /* Check rte_power_set_freq() */ |
| 215 | static int |
no test coverage detected