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

Function power_manager_exit

dpdk/examples/vm_power_manager/power_manager.c:155–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153}
154
155int
156power_manager_exit(void)
157{
158 unsigned int i;
159 int ret = 0;
160 struct core_info *ci;
161 unsigned int max_core_num;
162
163 ci = get_core_info();
164 if (!ci) {
165 RTE_LOG(ERR, POWER_MANAGER,
166 "Failed to get core info!\n");
167 return -1;
168 }
169
170 if (ci->core_count > RTE_MAX_LCORE)
171 max_core_num = RTE_MAX_LCORE;
172 else
173 max_core_num = ci->core_count;
174
175 for (i = 0; i < max_core_num; i++) {
176 if (rte_lcore_index(i) == -1)
177 continue;
178
179 if (ci->cd[i].global_enabled_cpus) {
180 if (rte_power_exit(i) < 0) {
181 RTE_LOG(ERR, POWER_MANAGER, "Unable to shutdown power manager "
182 "for core %u\n", i);
183 ret = -1;
184 }
185 ci->cd[i].global_enabled_cpus = 0;
186 }
187 remove_core_from_monitor(i);
188 }
189 return ret;
190}
191
192int
193power_manager_scale_core_up(unsigned core_num)

Callers 2

cmd_quit_parsedFunction · 0.85
sig_handlerFunction · 0.85

Calls 4

get_core_infoFunction · 0.85
rte_lcore_indexFunction · 0.85
rte_power_exitFunction · 0.85
remove_core_from_monitorFunction · 0.70

Tested by

no test coverage detected