| 2264 | } |
| 2265 | |
| 2266 | static int |
| 2267 | deinit_power_library(void) |
| 2268 | { |
| 2269 | unsigned int lcore_id, max_pkg, max_die, die, pkg; |
| 2270 | int ret = 0; |
| 2271 | |
| 2272 | RTE_LCORE_FOREACH(lcore_id) { |
| 2273 | /* deinit power management library */ |
| 2274 | ret = rte_power_exit(lcore_id); |
| 2275 | if (ret) { |
| 2276 | RTE_LOG(ERR, POWER, |
| 2277 | "Library deinitialization failed on core %u\n", |
| 2278 | lcore_id); |
| 2279 | return ret; |
| 2280 | } |
| 2281 | } |
| 2282 | |
| 2283 | /* if uncore option was set */ |
| 2284 | if (enabled_uncore == 0) { |
| 2285 | max_pkg = rte_power_uncore_get_num_pkgs(); |
| 2286 | if (max_pkg == 0) |
| 2287 | return -1; |
| 2288 | for (pkg = 0; pkg < max_pkg; pkg++) { |
| 2289 | max_die = rte_power_uncore_get_num_dies(pkg); |
| 2290 | if (max_die == 0) |
| 2291 | return -1; |
| 2292 | for (die = 0; die < max_die; die++) { |
| 2293 | ret = rte_power_uncore_exit(pkg, die); |
| 2294 | if (ret < 0) { |
| 2295 | RTE_LOG(ERR, L3FWD_POWER, "Failed to exit uncore deinit successfully for pkg %02u die %02u\n" |
| 2296 | , pkg, die); |
| 2297 | return -1; |
| 2298 | } |
| 2299 | } |
| 2300 | } |
| 2301 | } |
| 2302 | return ret; |
| 2303 | } |
| 2304 | |
| 2305 | static void |
| 2306 | get_current_stat_values(uint64_t *values) |
no test coverage detected