New upstream version 17.08
[deb_dpdk.git] / lib / librte_eal / linuxapp / eal / eal_thread.c
index 9f88530..6481eee 100644 (file)
@@ -49,7 +49,6 @@
 #include <rte_memzone.h>
 #include <rte_per_lcore.h>
 #include <rte_eal.h>
-#include <rte_per_lcore.h>
 #include <rte_lcore.h>
 
 #include "eal_private.h"
@@ -184,7 +183,14 @@ eal_thread_loop(__attribute__((unused)) void *arg)
                ret = lcore_config[lcore_id].f(fct_arg);
                lcore_config[lcore_id].ret = ret;
                rte_wmb();
-               lcore_config[lcore_id].state = FINISHED;
+
+               /* when a service core returns, it should go directly to WAIT
+                * state, because the application will not lcore_wait() for it.
+                */
+               if (lcore_config[lcore_id].core_role == ROLE_SERVICE)
+                       lcore_config[lcore_id].state = WAIT;
+               else
+                       lcore_config[lcore_id].state = FINISHED;
        }
 
        /* never reached */