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.wa...@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.w...@arm.com>
Acked-by: David Hunt <david.h...@intel.com>
---
 examples/l3fwd-power/main.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index fd3ade330f..a47a91ce6f 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -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;
-- 
2.25.1

Reply via email to