[v4,4/4] examples/l3fwd-power: add power monitor wake up API
Checks
Commit Message
For ARM aarch, power monitor uses WFE instruction to enable, which can
not exit automatically within the time limit. This means
'rte_power_monitor_wakeup' API needs to be called to wake up sleep cores
if there is no store operation to monitored address.
For other aarch, 'rte_power_monitor_wakeup' API can also make sure all
lcores wake up from sleeping state.
Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: David Hunt <david.hunt@intel.com>
---
examples/l3fwd-power/main.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
@@ -3113,6 +3113,19 @@ main(int argc, char **argv)
if (app_mode == APP_MODE_EMPTY_POLL || app_mode == APP_MODE_TELEMETRY)
launch_timer(rte_lcore_id());
+ /* wake up all worker cores from sleeping state */
+ if (pmgmt_type == RTE_POWER_MGMT_TYPE_MONITOR) {
+ for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {
+ if (rte_lcore_is_enabled(lcore_id) == 0)
+ continue;
+
+ if (lcore_id == rte_get_main_lcore())
+ continue;
+
+ rte_power_monitor_wakeup(lcore_id);
+ }
+ }
+
RTE_LCORE_FOREACH_WORKER(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0)
return -1;