MCPcopy Create free account
hub / github.com/F-Stack/f-stack / deinit_power_library

Function deinit_power_library

dpdk/examples/l3fwd-power/main.c:2266–2303  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2264}
2265
2266static int
2267deinit_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
2305static void
2306get_current_stat_values(uint64_t *values)

Callers 1

mainFunction · 0.85

Calls 2

rte_power_exitFunction · 0.85
rte_power_uncore_exitFunction · 0.85

Tested by

no test coverage detected