eal: pause while busy-waiting for lcore slave
authorAshwin Sekhar T K <ashwin.sekhar@caviumnetworks.com>
Fri, 12 May 2017 05:45:42 +0000 (22:45 -0700)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 3 Jul 2017 20:27:40 +0000 (22:27 +0200)
Instead of simply busy-waiting for slave in rte_eal_wait_lcore()
do rte_pause(). This will give power savings.

This also fixes warning -Wempty-body seen with armv8a clang
compilation.

Suggested-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Ashwin Sekhar T K <ashwin.sekhar@caviumnetworks.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
lib/librte_eal/common/eal_common_launch.c

index 229c3a0..1848466 100644 (file)
@@ -54,7 +54,8 @@ rte_eal_wait_lcore(unsigned slave_id)
                return 0;
 
        while (lcore_config[slave_id].state != WAIT &&
-              lcore_config[slave_id].state != FINISHED);
+              lcore_config[slave_id].state != FINISHED)
+               rte_pause();
 
        rte_rmb();