4 * Copyright(c) 2010-2012 Intel Corporation. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
17 * * Neither the name of Intel Corporation nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
49 #include <sys/queue.h>
51 #include <rte_common.h>
52 #include <rte_debug.h>
53 #include <rte_memory.h>
54 #include <rte_memzone.h>
55 #include <rte_launch.h>
56 #include <rte_tailq.h>
58 #include <rte_eal_memconfig.h>
59 #include <rte_per_lcore.h>
60 #include <rte_lcore.h>
62 #include <rte_random.h>
63 #include <rte_cycles.h>
64 #include <rte_string_fns.h>
65 #include <rte_cpuflags.h>
66 #include <rte_interrupts.h>
68 #include <rte_common.h>
69 #include <rte_version.h>
70 #include <rte_atomic.h>
72 #include "eal_private.h"
73 #include "eal_thread.h"
74 #include "eal_internal_cfg.h"
75 #include "eal_filesystem.h"
76 #include "eal_hugepages.h"
78 #define OPT_HUGE_DIR "huge-dir"
79 #define OPT_PROC_TYPE "proc-type"
80 #define OPT_NO_SHCONF "no-shconf"
81 #define OPT_NO_HPET "no-hpet"
82 #define OPT_NO_PCI "no-pci"
83 #define OPT_NO_HUGE "no-huge"
84 #define OPT_FILE_PREFIX "file-prefix"
85 #define OPT_SOCKET_MEM "socket-mem"
87 #define RTE_EAL_BLACKLIST_SIZE 0x100
89 #define MEMSIZE_IF_NO_HUGE_PAGE (64ULL * 1024ULL * 1024ULL)
91 #define SOCKET_MEM_STRLEN (RTE_MAX_NUMA_NODES * 10)
93 #define GET_BLACKLIST_FIELD(in, fd, lim, dlm) \
98 val = strtoul((in), &end, 16); \
99 if (errno != 0 || end[0] != (dlm) || val > (lim)) \
101 (fd) = (typeof (fd))val; \
105 /* early configuration structure, when memory config is not mmapped */
106 static struct rte_mem_config early_mem_config;
108 /* define fd variable here, because file needs to be kept open for the
109 * duration of the program, as we hold a write lock on it in the primary proc */
110 static int mem_cfg_fd = -1;
112 static struct flock wr_lock = {
114 .l_whence = SEEK_SET,
115 .l_start = offsetof(struct rte_mem_config, memseg),
116 .l_len = sizeof(early_mem_config.memseg),
119 /* Address of global and public configuration */
120 static struct rte_config rte_config = {
121 .mem_config = &early_mem_config,
124 static struct rte_pci_addr eal_dev_blacklist[RTE_EAL_BLACKLIST_SIZE];
126 /* internal configuration (per-core) */
127 struct lcore_config lcore_config[RTE_MAX_LCORE];
129 /* internal configuration */
130 struct internal_config internal_config;
132 /* Return a pointer to the configuration structure */
134 rte_eal_get_configuration(void)
139 /* parse a sysfs (or other) file containing one integer value */
141 eal_parse_sysfs_value(const char *filename, unsigned long *val)
147 if ((f = fopen(filename, "r")) == NULL) {
148 RTE_LOG(ERR, EAL, "%s(): cannot open sysfs value %s\n",
153 if (fgets(buf, sizeof(buf), f) == NULL) {
154 RTE_LOG(ERR, EAL, "%s(): cannot read sysfs value %s\n",
159 *val = strtoul(buf, &end, 0);
160 if ((buf[0] == '\0') || (end == NULL) || (*end != '\n')) {
161 RTE_LOG(ERR, EAL, "%s(): cannot parse sysfs value %s\n",
171 /* create memory configuration in shared/mmap memory. Take out
172 * a write lock on the memsegs, so we can auto-detect primary/secondary.
173 * This means we never close the file while running (auto-close on exit).
174 * We also don't lock the whole file, so that in future we can use read-locks
175 * on other parts, e.g. memzones, to detect if there are running secondary
178 rte_eal_config_create(void)
180 void *rte_mem_cfg_addr;
183 const char *pathname = eal_runtime_config_path();
185 if (internal_config.no_shconf)
189 mem_cfg_fd = open(pathname, O_RDWR | O_CREAT, 0660);
191 rte_panic("Cannot open '%s' for rte_mem_config\n", pathname);
194 retval = ftruncate(mem_cfg_fd, sizeof(*rte_config.mem_config));
197 rte_panic("Cannot resize '%s' for rte_mem_config\n", pathname);
200 retval = fcntl(mem_cfg_fd, F_SETLK, &wr_lock);
203 rte_exit(EXIT_FAILURE, "Cannot create lock on '%s'. Is another primary "
204 "process running?\n", pathname);
207 rte_mem_cfg_addr = mmap(NULL, sizeof(*rte_config.mem_config),
208 PROT_READ | PROT_WRITE, MAP_SHARED, mem_cfg_fd, 0);
210 if (rte_mem_cfg_addr == MAP_FAILED){
211 rte_panic("Cannot mmap memory for rte_config\n");
213 memcpy(rte_mem_cfg_addr, &early_mem_config, sizeof(early_mem_config));
214 rte_config.mem_config = (struct rte_mem_config *) rte_mem_cfg_addr;
217 /* attach to an existing shared memory config */
219 rte_eal_config_attach(void)
221 void *rte_mem_cfg_addr;
222 const char *pathname = eal_runtime_config_path();
224 if (internal_config.no_shconf)
228 mem_cfg_fd = open(pathname, O_RDWR);
230 rte_panic("Cannot open '%s' for rte_mem_config\n", pathname);
233 rte_mem_cfg_addr = mmap(NULL, sizeof(*rte_config.mem_config),
234 PROT_READ | PROT_WRITE, MAP_SHARED, mem_cfg_fd, 0);
236 if (rte_mem_cfg_addr == MAP_FAILED)
237 rte_panic("Cannot mmap memory for rte_config\n");
239 rte_config.mem_config = (struct rte_mem_config *) rte_mem_cfg_addr;
242 /* Detect if we are a primary or a secondary process */
243 static enum rte_proc_type_t
244 eal_proc_type_detect(void)
246 enum rte_proc_type_t ptype = RTE_PROC_PRIMARY;
247 const char *pathname = eal_runtime_config_path();
249 /* if we can open the file but not get a write-lock we are a secondary
250 * process. NOTE: if we get a file handle back, we keep that open
251 * and don't close it to prevent a race condition between multiple opens */
252 if (((mem_cfg_fd = open(pathname, O_RDWR)) >= 0) &&
253 (fcntl(mem_cfg_fd, F_SETLK, &wr_lock) < 0))
254 ptype = RTE_PROC_SECONDARY;
256 RTE_LOG(INFO, EAL, "Auto-detected process type: %s\n",
257 ptype == RTE_PROC_PRIMARY ? "PRIMARY" : "SECONDARY");
262 /* Sets up rte_config structure with the pointer to shared memory config.*/
264 rte_config_init(void)
266 /* set the magic in configuration structure */
267 rte_config.magic = RTE_MAGIC;
268 rte_config.process_type = (internal_config.process_type == RTE_PROC_AUTO) ?
269 eal_proc_type_detect() : /* for auto, detect the type */
270 internal_config.process_type; /* otherwise use what's already set */
272 switch (rte_config.process_type){
273 case RTE_PROC_PRIMARY:
274 rte_eal_config_create();
276 case RTE_PROC_SECONDARY:
277 rte_eal_config_attach();
278 rte_eal_mcfg_wait_complete(rte_config.mem_config);
281 case RTE_PROC_INVALID:
282 rte_panic("Invalid process type\n");
286 /* Unlocks hugepage directories that were locked by eal_hugepage_info_init */
288 eal_hugedirs_unlock(void)
292 for (i = 0; i < MAX_HUGEPAGE_SIZES; i++)
294 /* skip uninitialized */
295 if (internal_config.hugepage_info[i].lock_descriptor == 0)
297 /* unlock hugepage file */
298 flock(internal_config.hugepage_info[i].lock_descriptor, LOCK_UN);
299 close(internal_config.hugepage_info[i].lock_descriptor);
300 /* reset the field */
301 internal_config.hugepage_info[i].lock_descriptor = 0;
307 eal_usage(const char *prgname)
309 printf("\nUsage: %s -c COREMASK -n NUM [-m NB] [-r NUM] [-b <domain:bus:devid.func>]"
310 "[--proc-type primary|secondary|auto] \n\n"
312 " -c COREMASK : A hexadecimal bitmask of cores to run on\n"
313 " -n NUM : Number of memory channels\n"
314 " -v : Display version information on startup\n"
315 " -b <domain:bus:devid.func>: to prevent EAL from using specified "
317 " (multiple -b options are allowed)\n"
318 " -m MB : memory to allocate (see also --"OPT_SOCKET_MEM")\n"
319 " -r NUM : force number of memory ranks (don't detect)\n"
320 " --"OPT_SOCKET_MEM" : memory to allocate on specific \n"
321 " sockets (use comma separated values)\n"
322 " --"OPT_HUGE_DIR" : directory where hugetlbfs is mounted\n"
323 " --"OPT_PROC_TYPE" : type of this process\n"
324 " --"OPT_FILE_PREFIX": prefix for hugepage filenames\n"
325 "\nEAL options for DEBUG use only:\n"
326 " --"OPT_NO_HUGE" : use malloc instead of hugetlbfs\n"
327 " --"OPT_NO_PCI" : disable pci\n"
328 " --"OPT_NO_HPET" : disable hpet\n"
329 " --"OPT_NO_SHCONF": no shared config (mmap'd files)\n\n",
334 * Parse the coremask given as argument (hexadecimal string) and fill
335 * the global configuration (core role and core count) with the parsed
339 eal_parse_coremask(const char *coremask)
341 struct rte_config *cfg = rte_eal_get_configuration();
344 unsigned long long cm;
347 /* parse hexadecimal string */
348 cm = strtoull(coremask, &end, 16);
349 if ((coremask[0] == '\0') || (end == NULL) || (*end != '\0') || (cm == 0))
352 RTE_LOG(DEBUG, EAL, "coremask set to %llx\n", cm);
353 /* set core role and core count */
354 for (i = 0; i < RTE_MAX_LCORE; i++) {
355 if ((1ULL << i) & cm) {
357 cfg->master_lcore = i;
358 cfg->lcore_role[i] = ROLE_RTE;
362 cfg->lcore_role[i] = ROLE_OFF;
369 eal_parse_socket_mem(char *socket_mem)
371 char * arg[RTE_MAX_NUMA_NODES];
374 uint64_t total_mem = 0;
376 len = strnlen(socket_mem, SOCKET_MEM_STRLEN);
377 if (len == SOCKET_MEM_STRLEN) {
378 RTE_LOG(ERR, EAL, "--socket-mem is too long\n");
382 /* all other error cases will be caught later */
383 if (!isdigit(socket_mem[len-1]))
386 /* split the optarg into separate socket values */
387 arg_num = rte_strsplit(socket_mem, len,
388 arg, RTE_MAX_NUMA_NODES, ',');
390 /* if split failed, or 0 arguments */
394 internal_config.force_sockets = 1;
396 /* parse each defined socket option */
398 for (i = 0; i < arg_num; i++) {
400 internal_config.socket_mem[i] = strtoull(arg[i], &end, 10);
402 /* check for invalid input */
404 (arg[i][0] == '\0') || (end == NULL) || (*end != '\0'))
406 internal_config.socket_mem[i] *= 1024ULL;
407 internal_config.socket_mem[i] *= 1024ULL;
408 total_mem += internal_config.socket_mem[i];
411 /* check if we have a positive amount of total memory */
418 static inline uint64_t
419 eal_get_hugepage_mem_size(void)
424 for (i = 0; i < internal_config.num_hugepage_sizes; i++) {
425 struct hugepage_info *hpi = &internal_config.hugepage_info[i];
426 if (hpi->hugedir != NULL) {
427 for (j = 0; j < RTE_MAX_NUMA_NODES; j++) {
428 size += hpi->hugepage_sz * hpi->num_pages[j];
436 static enum rte_proc_type_t
437 eal_parse_proc_type(const char *arg)
439 if (strncasecmp(arg, "primary", sizeof("primary")) == 0)
440 return RTE_PROC_PRIMARY;
441 if (strncasecmp(arg, "secondary", sizeof("secondary")) == 0)
442 return RTE_PROC_SECONDARY;
443 if (strncasecmp(arg, "auto", sizeof("auto")) == 0)
444 return RTE_PROC_AUTO;
446 return RTE_PROC_INVALID;
450 eal_parse_blacklist(const char *input, struct rte_pci_addr *dev2bl)
452 GET_BLACKLIST_FIELD(input, dev2bl->domain, UINT16_MAX, ':');
453 GET_BLACKLIST_FIELD(input, dev2bl->bus, UINT8_MAX, ':');
454 GET_BLACKLIST_FIELD(input, dev2bl->devid, UINT8_MAX, '.');
455 GET_BLACKLIST_FIELD(input, dev2bl->function, UINT8_MAX, 0);
460 eal_parse_blacklist_opt(const char *optarg, size_t idx)
462 if (idx >= sizeof (eal_dev_blacklist) / sizeof (eal_dev_blacklist[0])) {
464 "%s - too many devices to blacklist...\n",
467 } else if (eal_parse_blacklist(optarg, eal_dev_blacklist + idx) != 0) {
469 "%s - invalid device to blacklist...\n",
479 /* Parse the argument given in the command line of the application */
481 eal_parse_args(int argc, char **argv)
487 ssize_t blacklist_index = 0;;
488 char *prgname = argv[0];
489 static struct option lgopts[] = {
490 {OPT_NO_HUGE, 0, 0, 0},
491 {OPT_NO_PCI, 0, 0, 0},
492 {OPT_NO_HPET, 0, 0, 0},
493 {OPT_HUGE_DIR, 1, 0, 0},
494 {OPT_NO_SHCONF, 0, 0, 0},
495 {OPT_PROC_TYPE, 1, 0, 0},
496 {OPT_FILE_PREFIX, 1, 0, 0},
497 {OPT_SOCKET_MEM, 1, 0, 0},
503 internal_config.memory = 0;
504 internal_config.force_nrank = 0;
505 internal_config.force_nchannel = 0;
506 internal_config.hugefile_prefix = HUGEFILE_PREFIX_DEFAULT;
507 internal_config.hugepage_dir = NULL;
508 internal_config.force_sockets = 0;
509 #ifdef RTE_LIBEAL_USE_HPET
510 internal_config.no_hpet = 0;
512 internal_config.no_hpet = 1;
514 /* zero out the NUMA config */
515 for (i = 0; i < RTE_MAX_NUMA_NODES; i++)
516 internal_config.socket_mem[i] = 0;
518 /* zero out hugedir descriptors */
519 for (i = 0; i < MAX_HUGEPAGE_SIZES; i++)
520 internal_config.hugepage_info[i].lock_descriptor = 0;
522 while ((opt = getopt_long(argc, argvopt, "b:c:m:n:r:v",
523 lgopts, &option_index)) != EOF) {
528 if ((blacklist_index = eal_parse_blacklist_opt(optarg,
529 blacklist_index)) < 0) {
536 if (eal_parse_coremask(optarg) < 0) {
537 RTE_LOG(ERR, EAL, "invalid coremask\n");
545 internal_config.memory = atoi(optarg);
546 internal_config.memory *= 1024ULL;
547 internal_config.memory *= 1024ULL;
549 /* force number of channels */
551 internal_config.force_nchannel = atoi(optarg);
552 if (internal_config.force_nchannel == 0 ||
553 internal_config.force_nchannel > 4) {
554 RTE_LOG(ERR, EAL, "invalid channel number\n");
559 /* force number of ranks */
561 internal_config.force_nrank = atoi(optarg);
562 if (internal_config.force_nrank == 0 ||
563 internal_config.force_nrank > 16) {
564 RTE_LOG(ERR, EAL, "invalid rank number\n");
570 /* since message is explicitly requested by user, we
571 * write message at highest log level so it can always be seen
572 * even if info or warning messages are disabled */
573 RTE_LOG(CRIT, EAL, "RTE Version: '%s'\n", rte_version());
578 if (!strcmp(lgopts[option_index].name, OPT_NO_HUGE)) {
579 internal_config.no_hugetlbfs = 1;
581 else if (!strcmp(lgopts[option_index].name, OPT_NO_PCI)) {
582 internal_config.no_pci = 1;
584 else if (!strcmp(lgopts[option_index].name, OPT_NO_HPET)) {
585 internal_config.no_hpet = 1;
587 else if (!strcmp(lgopts[option_index].name, OPT_NO_SHCONF)) {
588 internal_config.no_shconf = 1;
590 else if (!strcmp(lgopts[option_index].name, OPT_HUGE_DIR)) {
591 internal_config.hugepage_dir = optarg;
593 else if (!strcmp(lgopts[option_index].name, OPT_PROC_TYPE)) {
594 internal_config.process_type = eal_parse_proc_type(optarg);
596 else if (!strcmp(lgopts[option_index].name, OPT_FILE_PREFIX)) {
597 internal_config.hugefile_prefix = optarg;
599 else if (!strcmp(lgopts[option_index].name, OPT_SOCKET_MEM)) {
600 if (eal_parse_socket_mem(optarg) < 0) {
601 RTE_LOG(ERR, EAL, "invalid parameters for --"
602 OPT_SOCKET_MEM "\n");
617 RTE_LOG(ERR, EAL, "coremask not specified\n");
621 if (internal_config.process_type == RTE_PROC_AUTO){
622 internal_config.process_type = eal_proc_type_detect();
624 if (internal_config.process_type == RTE_PROC_INVALID){
625 RTE_LOG(ERR, EAL, "Invalid process type specified\n");
629 if (internal_config.process_type == RTE_PROC_PRIMARY &&
630 internal_config.force_nchannel == 0) {
631 RTE_LOG(ERR, EAL, "Number of memory channels (-n) not specified\n");
635 if (index(internal_config.hugefile_prefix,'%') != NULL){
636 RTE_LOG(ERR, EAL, "Invalid char, '%%', in '"OPT_FILE_PREFIX"' option\n");
640 if (internal_config.memory > 0 && internal_config.force_sockets == 1) {
641 RTE_LOG(ERR, EAL, "Options -m and --socket-mem cannot be specified "
642 "at the same time\n");
646 /* --no-huge doesn't make sense with either -m or --socket-mem */
647 if (internal_config.no_hugetlbfs &&
648 (internal_config.memory > 0 ||
649 internal_config.force_sockets == 1)) {
650 RTE_LOG(ERR, EAL, "Options -m or --socket-mem cannot be specified "
651 "together with --no-huge!\n");
656 if (blacklist_index > 0)
657 rte_eal_pci_set_blacklist(eal_dev_blacklist, blacklist_index);
660 argv[optind-1] = prgname;
662 /* if no memory amounts were requested, this will result in 0 and
663 * will be overriden later, right after eal_hugepage_info_init() */
664 for (i = 0; i < RTE_MAX_NUMA_NODES; i++)
665 internal_config.memory += internal_config.socket_mem[i];
668 optind = 0; /* reset getopt lib */
673 eal_check_mem_on_local_socket(void)
675 const struct rte_memseg *ms;
678 socket_id = rte_lcore_to_socket_id(rte_config.master_lcore);
680 ms = rte_eal_get_physmem_layout();
682 for (i = 0; i < RTE_MAX_MEMSEG; i++)
683 if (ms[i].socket_id == socket_id &&
687 RTE_LOG(WARNING, EAL, "WARNING: Master core has no "
688 "memory on local socket!\n");
692 sync_func(__attribute__((unused)) void *arg)
698 rte_eal_mcfg_complete(void)
700 /* ALL shared mem_config related INIT DONE */
701 if (rte_config.process_type == RTE_PROC_PRIMARY)
702 rte_config.mem_config->magic = RTE_MAGIC;
705 /* Launch threads, called at application init(). */
707 rte_eal_init(int argc, char **argv)
711 static rte_atomic32_t run_once = RTE_ATOMIC32_INIT(0);
713 if (!rte_atomic32_test_and_set(&run_once))
716 thread_id = pthread_self();
718 if (rte_eal_log_early_init() < 0)
719 rte_panic("Cannot init early logs\n");
721 fctret = eal_parse_args(argc, argv);
725 if (internal_config.no_hugetlbfs == 0 &&
726 internal_config.process_type != RTE_PROC_SECONDARY &&
727 eal_hugepage_info_init() < 0)
728 rte_panic("Cannot get hugepage information\n");
730 if (internal_config.memory == 0 && internal_config.force_sockets == 0) {
731 if (internal_config.no_hugetlbfs)
732 internal_config.memory = MEMSIZE_IF_NO_HUGE_PAGE;
734 internal_config.memory = eal_get_hugepage_mem_size();
737 rte_srand(rte_rdtsc());
741 if (rte_eal_cpu_init() < 0)
742 rte_panic("Cannot detect lcores\n");
744 if (rte_eal_memory_init() < 0)
745 rte_panic("Cannot init memory\n");
747 /* the directories are locked during eal_hugepage_info_init */
748 eal_hugedirs_unlock();
750 if (rte_eal_memzone_init() < 0)
751 rte_panic("Cannot init memzone\n");
753 if (rte_eal_tailqs_init() < 0)
754 rte_panic("Cannot init tail queues for objects\n");
756 if (rte_eal_log_init() < 0)
757 rte_panic("Cannot init logs\n");
759 if (rte_eal_alarm_init() < 0)
760 rte_panic("Cannot init interrupt-handling thread\n");
762 if (rte_eal_intr_init() < 0)
763 rte_panic("Cannot init interrupt-handling thread\n");
765 if (rte_eal_hpet_init() < 0)
766 rte_panic("Cannot init HPET\n");
768 if (rte_eal_pci_init() < 0)
769 rte_panic("Cannot init PCI\n");
771 RTE_LOG(DEBUG, EAL, "Master core %u is ready (tid=%x)\n",
772 rte_config.master_lcore, (int)thread_id);
774 eal_check_mem_on_local_socket();
776 rte_eal_mcfg_complete();
778 RTE_LCORE_FOREACH_SLAVE(i) {
781 * create communication pipes between master thread
784 if (pipe(lcore_config[i].pipe_master2slave) < 0)
785 rte_panic("Cannot create pipe\n");
786 if (pipe(lcore_config[i].pipe_slave2master) < 0)
787 rte_panic("Cannot create pipe\n");
789 lcore_config[i].state = WAIT;
791 /* create a thread for each lcore */
792 ret = pthread_create(&lcore_config[i].thread_id, NULL,
793 eal_thread_loop, NULL);
795 rte_panic("Cannot create thread\n");
798 eal_thread_init_master(rte_config.master_lcore);
801 * Launch a dummy function on all slave lcores, so that master lcore
802 * knows they are all ready when this function returns.
804 rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MASTER);
805 rte_eal_mp_wait_lcore();
811 enum rte_lcore_role_t
812 rte_eal_lcore_role(unsigned lcore_id)
814 return (rte_config.lcore_role[lcore_id]);
818 rte_eal_process_type(void)
820 return (rte_config.process_type);