1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2014 Intel Corporation
11 #include <rte_memory.h>
12 #include <rte_launch.h>
14 #include <rte_per_lcore.h>
15 #include <rte_lcore.h>
16 #include <rte_debug.h>
18 /* Launch a function on lcore. 8< */
20 lcore_hello(__rte_unused void *arg)
23 lcore_id = rte_lcore_id();
24 printf("hello from core %u\n", lcore_id);
27 /* >8 End of launching function on lcore. */
29 /* Initialization of Environment Abstraction Layer (EAL). 8< */
31 main(int argc, char **argv)
36 ret = rte_eal_init(argc, argv);
38 rte_panic("Cannot init EAL\n");
39 /* >8 End of initialization of Environment Abstraction Layer */
41 /* Launches the function on each lcore. 8< */
42 RTE_LCORE_FOREACH_WORKER(lcore_id) {
43 /* Simpler equivalent. 8< */
44 rte_eal_remote_launch(lcore_hello, NULL, lcore_id);
45 /* >8 End of simpler equivalent. */
48 /* call it on main lcore too */
50 /* >8 End of launching the function on each lcore. */
52 rte_eal_mp_wait_lcore();
54 /* clean up the EAL */