4 * Copyright(c) 2010-2013 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>
71 #include <malloc_heap.h>
73 #include "eal_private.h"
74 #include "eal_thread.h"
75 #include "eal_internal_cfg.h"
76 #include "eal_filesystem.h"
77 #include "eal_hugepages.h"
79 #define OPT_HUGE_DIR "huge-dir"
80 #define OPT_PROC_TYPE "proc-type"
81 #define OPT_NO_SHCONF "no-shconf"
82 #define OPT_NO_HPET "no-hpet"
83 #define OPT_NO_PCI "no-pci"
84 #define OPT_NO_HUGE "no-huge"
85 #define OPT_FILE_PREFIX "file-prefix"
86 #define OPT_SOCKET_MEM "socket-mem"
88 #define RTE_EAL_BLACKLIST_SIZE 0x100
90 #define MEMSIZE_IF_NO_HUGE_PAGE (64ULL * 1024ULL * 1024ULL)
92 #define SOCKET_MEM_STRLEN (RTE_MAX_NUMA_NODES * 10)
94 #define GET_BLACKLIST_FIELD(in, fd, lim, dlm) \
99 val = strtoul((in), &end, 16); \
100 if (errno != 0 || end[0] != (dlm) || val > (lim)) \
102 (fd) = (typeof (fd))val; \
106 /* early configuration structure, when memory config is not mmapped */
107 static struct rte_mem_config early_mem_config;
109 /* define fd variable here, because file needs to be kept open for the
110 * duration of the program, as we hold a write lock on it in the primary proc */
111 static int mem_cfg_fd = -1;
113 static struct flock wr_lock = {
115 .l_whence = SEEK_SET,
116 .l_start = offsetof(struct rte_mem_config, memseg),
117 .l_len = sizeof(early_mem_config.memseg),
120 /* Address of global and public configuration */
121 static struct rte_config rte_config = {
122 .mem_config = &early_mem_config,
125 static struct rte_pci_addr eal_dev_blacklist[RTE_EAL_BLACKLIST_SIZE];
127 /* internal configuration (per-core) */
128 struct lcore_config lcore_config[RTE_MAX_LCORE];
130 /* internal configuration */
131 struct internal_config internal_config;
133 /* Return a pointer to the configuration structure */
135 rte_eal_get_configuration(void)
140 /* parse a sysfs (or other) file containing one integer value */
142 eal_parse_sysfs_value(const char *filename, unsigned long *val)
148 if ((f = fopen(filename, "r")) == NULL) {
149 RTE_LOG(ERR, EAL, "%s(): cannot open sysfs value %s\n",
154 if (fgets(buf, sizeof(buf), f) == NULL) {
155 RTE_LOG(ERR, EAL, "%s(): cannot read sysfs value %s\n",
160 *val = strtoul(buf, &end, 0);
161 if ((buf[0] == '\0') || (end == NULL) || (*end != '\n')) {
162 RTE_LOG(ERR, EAL, "%s(): cannot parse sysfs value %s\n",
172 /* create memory configuration in shared/mmap memory. Take out
173 * a write lock on the memsegs, so we can auto-detect primary/secondary.
174 * This means we never close the file while running (auto-close on exit).
175 * We also don't lock the whole file, so that in future we can use read-locks
176 * on other parts, e.g. memzones, to detect if there are running secondary
179 rte_eal_config_create(void)
181 void *rte_mem_cfg_addr;
184 const char *pathname = eal_runtime_config_path();
186 if (internal_config.no_shconf)
190 mem_cfg_fd = open(pathname, O_RDWR | O_CREAT, 0660);
192 rte_panic("Cannot open '%s' for rte_mem_config\n", pathname);
195 retval = ftruncate(mem_cfg_fd, sizeof(*rte_config.mem_config));
198 rte_panic("Cannot resize '%s' for rte_mem_config\n", pathname);
201 retval = fcntl(mem_cfg_fd, F_SETLK, &wr_lock);
204 rte_exit(EXIT_FAILURE, "Cannot create lock on '%s'. Is another primary "
205 "process running?\n", pathname);
208 rte_mem_cfg_addr = mmap(NULL, sizeof(*rte_config.mem_config),
209 PROT_READ | PROT_WRITE, MAP_SHARED, mem_cfg_fd, 0);
211 if (rte_mem_cfg_addr == MAP_FAILED){
212 rte_panic("Cannot mmap memory for rte_config\n");
214 memcpy(rte_mem_cfg_addr, &early_mem_config, sizeof(early_mem_config));
215 rte_config.mem_config = (struct rte_mem_config *) rte_mem_cfg_addr;
218 /* attach to an existing shared memory config */
220 rte_eal_config_attach(void)
222 void *rte_mem_cfg_addr;
223 const char *pathname = eal_runtime_config_path();
225 if (internal_config.no_shconf)
229 mem_cfg_fd = open(pathname, O_RDWR);
231 rte_panic("Cannot open '%s' for rte_mem_config\n", pathname);
234 rte_mem_cfg_addr = mmap(NULL, sizeof(*rte_config.mem_config),
235 PROT_READ | PROT_WRITE, MAP_SHARED, mem_cfg_fd, 0);
237 if (rte_mem_cfg_addr == MAP_FAILED)
238 rte_panic("Cannot mmap memory for rte_config\n");
240 rte_config.mem_config = (struct rte_mem_config *) rte_mem_cfg_addr;
243 /* Detect if we are a primary or a secondary process */
244 static enum rte_proc_type_t
245 eal_proc_type_detect(void)
247 enum rte_proc_type_t ptype = RTE_PROC_PRIMARY;
248 const char *pathname = eal_runtime_config_path();
250 /* if we can open the file but not get a write-lock we are a secondary
251 * process. NOTE: if we get a file handle back, we keep that open
252 * and don't close it to prevent a race condition between multiple opens */
253 if (((mem_cfg_fd = open(pathname, O_RDWR)) >= 0) &&
254 (fcntl(mem_cfg_fd, F_SETLK, &wr_lock) < 0))
255 ptype = RTE_PROC_SECONDARY;
257 RTE_LOG(INFO, EAL, "Auto-detected process type: %s\n",
258 ptype == RTE_PROC_PRIMARY ? "PRIMARY" : "SECONDARY");
263 /* Sets up rte_config structure with the pointer to shared memory config.*/
265 rte_config_init(void)
267 /* set the magic in configuration structure */
268 rte_config.magic = RTE_MAGIC;
269 rte_config.process_type = (internal_config.process_type == RTE_PROC_AUTO) ?
270 eal_proc_type_detect() : /* for auto, detect the type */
271 internal_config.process_type; /* otherwise use what's already set */
273 switch (rte_config.process_type){
274 case RTE_PROC_PRIMARY:
275 rte_eal_config_create();
277 case RTE_PROC_SECONDARY:
278 rte_eal_config_attach();
279 rte_eal_mcfg_wait_complete(rte_config.mem_config);
282 case RTE_PROC_INVALID:
283 rte_panic("Invalid process type\n");
287 /* Unlocks hugepage directories that were locked by eal_hugepage_info_init */
289 eal_hugedirs_unlock(void)
293 for (i = 0; i < MAX_HUGEPAGE_SIZES; i++)
295 /* skip uninitialized */
296 if (internal_config.hugepage_info[i].lock_descriptor == 0)
298 /* unlock hugepage file */
299 flock(internal_config.hugepage_info[i].lock_descriptor, LOCK_UN);
300 close(internal_config.hugepage_info[i].lock_descriptor);
301 /* reset the field */
302 internal_config.hugepage_info[i].lock_descriptor = 0;
308 eal_usage(const char *prgname)
310 printf("\nUsage: %s -c COREMASK -n NUM [-m NB] [-r NUM] [-b <domain:bus:devid.func>]"
311 "[--proc-type primary|secondary|auto] \n\n"
313 " -c COREMASK : A hexadecimal bitmask of cores to run on\n"
314 " -n NUM : Number of memory channels\n"
315 " -v : Display version information on startup\n"
316 " -b <domain:bus:devid.func>: to prevent EAL from using specified "
318 " (multiple -b options are allowed)\n"
319 " -m MB : memory to allocate (see also --"OPT_SOCKET_MEM")\n"
320 " -r NUM : force number of memory ranks (don't detect)\n"
321 " --"OPT_SOCKET_MEM" : memory to allocate on specific \n"
322 " sockets (use comma separated values)\n"
323 " --"OPT_HUGE_DIR" : directory where hugetlbfs is mounted\n"
324 " --"OPT_PROC_TYPE" : type of this process\n"
325 " --"OPT_FILE_PREFIX": prefix for hugepage filenames\n"
326 "\nEAL options for DEBUG use only:\n"
327 " --"OPT_NO_HUGE" : use malloc instead of hugetlbfs\n"
328 " --"OPT_NO_PCI" : disable pci\n"
329 " --"OPT_NO_HPET" : disable hpet\n"
330 " --"OPT_NO_SHCONF": no shared config (mmap'd files)\n\n",
335 * Parse the coremask given as argument (hexadecimal string) and fill
336 * the global configuration (core role and core count) with the parsed
340 eal_parse_coremask(const char *coremask)
342 struct rte_config *cfg = rte_eal_get_configuration();
345 unsigned long long cm;
348 /* parse hexadecimal string */
349 cm = strtoull(coremask, &end, 16);
350 if ((coremask[0] == '\0') || (end == NULL) || (*end != '\0') || (cm == 0))
353 RTE_LOG(DEBUG, EAL, "coremask set to %llx\n", cm);
354 /* set core role and core count */
355 for (i = 0; i < RTE_MAX_LCORE; i++) {
356 if ((1ULL << i) & cm) {
358 cfg->master_lcore = i;
359 cfg->lcore_role[i] = ROLE_RTE;
363 cfg->lcore_role[i] = ROLE_OFF;
370 eal_parse_socket_mem(char *socket_mem)
372 char * arg[RTE_MAX_NUMA_NODES];
375 uint64_t total_mem = 0;
377 len = strnlen(socket_mem, SOCKET_MEM_STRLEN);
378 if (len == SOCKET_MEM_STRLEN) {
379 RTE_LOG(ERR, EAL, "--socket-mem is too long\n");
383 /* all other error cases will be caught later */
384 if (!isdigit(socket_mem[len-1]))
387 /* split the optarg into separate socket values */
388 arg_num = rte_strsplit(socket_mem, len,
389 arg, RTE_MAX_NUMA_NODES, ',');
391 /* if split failed, or 0 arguments */
395 internal_config.force_sockets = 1;
397 /* parse each defined socket option */
399 for (i = 0; i < arg_num; i++) {
401 internal_config.socket_mem[i] = strtoull(arg[i], &end, 10);
403 /* check for invalid input */
405 (arg[i][0] == '\0') || (end == NULL) || (*end != '\0'))
407 internal_config.socket_mem[i] *= 1024ULL;
408 internal_config.socket_mem[i] *= 1024ULL;
409 total_mem += internal_config.socket_mem[i];
412 /* check if we have a positive amount of total memory */
420 eal_get_hugepage_mem_size(void)
425 for (i = 0; i < internal_config.num_hugepage_sizes; i++) {
426 struct hugepage_info *hpi = &internal_config.hugepage_info[i];
427 if (hpi->hugedir != NULL) {
428 for (j = 0; j < RTE_MAX_NUMA_NODES; j++) {
429 size += hpi->hugepage_sz * hpi->num_pages[j];
434 return (size < SIZE_MAX) ? (size_t)(size) : SIZE_MAX;
437 static enum rte_proc_type_t
438 eal_parse_proc_type(const char *arg)
440 if (strncasecmp(arg, "primary", sizeof("primary")) == 0)
441 return RTE_PROC_PRIMARY;
442 if (strncasecmp(arg, "secondary", sizeof("secondary")) == 0)
443 return RTE_PROC_SECONDARY;
444 if (strncasecmp(arg, "auto", sizeof("auto")) == 0)
445 return RTE_PROC_AUTO;
447 return RTE_PROC_INVALID;
451 eal_parse_blacklist(const char *input, struct rte_pci_addr *dev2bl)
453 GET_BLACKLIST_FIELD(input, dev2bl->domain, UINT16_MAX, ':');
454 GET_BLACKLIST_FIELD(input, dev2bl->bus, UINT8_MAX, ':');
455 GET_BLACKLIST_FIELD(input, dev2bl->devid, UINT8_MAX, '.');
456 GET_BLACKLIST_FIELD(input, dev2bl->function, UINT8_MAX, 0);
461 eal_parse_blacklist_opt(const char *optarg, size_t idx)
463 if (idx >= sizeof (eal_dev_blacklist) / sizeof (eal_dev_blacklist[0])) {
465 "%s - too many devices to blacklist...\n",
468 } else if (eal_parse_blacklist(optarg, eal_dev_blacklist + idx) != 0) {
470 "%s - invalid device to blacklist...\n",
480 /* Parse the argument given in the command line of the application */
482 eal_parse_args(int argc, char **argv)
488 ssize_t blacklist_index = 0;;
489 char *prgname = argv[0];
490 static struct option lgopts[] = {
491 {OPT_NO_HUGE, 0, 0, 0},
492 {OPT_NO_PCI, 0, 0, 0},
493 {OPT_NO_HPET, 0, 0, 0},
494 {OPT_HUGE_DIR, 1, 0, 0},
495 {OPT_NO_SHCONF, 0, 0, 0},
496 {OPT_PROC_TYPE, 1, 0, 0},
497 {OPT_FILE_PREFIX, 1, 0, 0},
498 {OPT_SOCKET_MEM, 1, 0, 0},
504 internal_config.memory = 0;
505 internal_config.force_nrank = 0;
506 internal_config.force_nchannel = 0;
507 internal_config.hugefile_prefix = HUGEFILE_PREFIX_DEFAULT;
508 internal_config.hugepage_dir = NULL;
509 internal_config.force_sockets = 0;
510 #ifdef RTE_LIBEAL_USE_HPET
511 internal_config.no_hpet = 0;
513 internal_config.no_hpet = 1;
515 /* zero out the NUMA config */
516 for (i = 0; i < RTE_MAX_NUMA_NODES; i++)
517 internal_config.socket_mem[i] = 0;
519 /* zero out hugedir descriptors */
520 for (i = 0; i < MAX_HUGEPAGE_SIZES; i++)
521 internal_config.hugepage_info[i].lock_descriptor = 0;
523 while ((opt = getopt_long(argc, argvopt, "b:c:m:n:r:v",
524 lgopts, &option_index)) != EOF) {
529 if ((blacklist_index = eal_parse_blacklist_opt(optarg,
530 blacklist_index)) < 0) {
537 if (eal_parse_coremask(optarg) < 0) {
538 RTE_LOG(ERR, EAL, "invalid coremask\n");
546 internal_config.memory = atoi(optarg);
547 internal_config.memory *= 1024ULL;
548 internal_config.memory *= 1024ULL;
550 /* force number of channels */
552 internal_config.force_nchannel = atoi(optarg);
553 if (internal_config.force_nchannel == 0 ||
554 internal_config.force_nchannel > 4) {
555 RTE_LOG(ERR, EAL, "invalid channel number\n");
560 /* force number of ranks */
562 internal_config.force_nrank = atoi(optarg);
563 if (internal_config.force_nrank == 0 ||
564 internal_config.force_nrank > 16) {
565 RTE_LOG(ERR, EAL, "invalid rank number\n");
571 /* since message is explicitly requested by user, we
572 * write message at highest log level so it can always be seen
573 * even if info or warning messages are disabled */
574 RTE_LOG(CRIT, EAL, "RTE Version: '%s'\n", rte_version());
579 if (!strcmp(lgopts[option_index].name, OPT_NO_HUGE)) {
580 internal_config.no_hugetlbfs = 1;
582 else if (!strcmp(lgopts[option_index].name, OPT_NO_PCI)) {
583 internal_config.no_pci = 1;
585 else if (!strcmp(lgopts[option_index].name, OPT_NO_HPET)) {
586 internal_config.no_hpet = 1;
588 else if (!strcmp(lgopts[option_index].name, OPT_NO_SHCONF)) {
589 internal_config.no_shconf = 1;
591 else if (!strcmp(lgopts[option_index].name, OPT_HUGE_DIR)) {
592 internal_config.hugepage_dir = optarg;
594 else if (!strcmp(lgopts[option_index].name, OPT_PROC_TYPE)) {
595 internal_config.process_type = eal_parse_proc_type(optarg);
597 else if (!strcmp(lgopts[option_index].name, OPT_FILE_PREFIX)) {
598 internal_config.hugefile_prefix = optarg;
600 else if (!strcmp(lgopts[option_index].name, OPT_SOCKET_MEM)) {
601 if (eal_parse_socket_mem(optarg) < 0) {
602 RTE_LOG(ERR, EAL, "invalid parameters for --"
603 OPT_SOCKET_MEM "\n");
618 RTE_LOG(ERR, EAL, "coremask not specified\n");
622 if (internal_config.process_type == RTE_PROC_AUTO){
623 internal_config.process_type = eal_proc_type_detect();
625 if (internal_config.process_type == RTE_PROC_INVALID){
626 RTE_LOG(ERR, EAL, "Invalid process type specified\n");
630 if (internal_config.process_type == RTE_PROC_PRIMARY &&
631 internal_config.force_nchannel == 0) {
632 RTE_LOG(ERR, EAL, "Number of memory channels (-n) not specified\n");
636 if (index(internal_config.hugefile_prefix,'%') != NULL){
637 RTE_LOG(ERR, EAL, "Invalid char, '%%', in '"OPT_FILE_PREFIX"' option\n");
641 if (internal_config.memory > 0 && internal_config.force_sockets == 1) {
642 RTE_LOG(ERR, EAL, "Options -m and --socket-mem cannot be specified "
643 "at the same time\n");
647 /* --no-huge doesn't make sense with either -m or --socket-mem */
648 if (internal_config.no_hugetlbfs &&
649 (internal_config.memory > 0 ||
650 internal_config.force_sockets == 1)) {
651 RTE_LOG(ERR, EAL, "Options -m or --socket-mem cannot be specified "
652 "together with --no-huge!\n");
657 if (blacklist_index > 0)
658 rte_eal_pci_set_blacklist(eal_dev_blacklist, blacklist_index);
661 argv[optind-1] = prgname;
663 /* if no memory amounts were requested, this will result in 0 and
664 * will be overriden later, right after eal_hugepage_info_init() */
665 for (i = 0; i < RTE_MAX_NUMA_NODES; i++)
666 internal_config.memory += internal_config.socket_mem[i];
669 optind = 0; /* reset getopt lib */
674 eal_check_mem_on_local_socket(void)
676 const struct rte_memseg *ms;
679 socket_id = rte_lcore_to_socket_id(rte_config.master_lcore);
681 ms = rte_eal_get_physmem_layout();
683 for (i = 0; i < RTE_MAX_MEMSEG; i++)
684 if (ms[i].socket_id == socket_id &&
688 RTE_LOG(WARNING, EAL, "WARNING: Master core has no "
689 "memory on local socket!\n");
693 sync_func(__attribute__((unused)) void *arg)
699 rte_eal_mcfg_complete(void)
701 /* ALL shared mem_config related INIT DONE */
702 if (rte_config.process_type == RTE_PROC_PRIMARY)
703 rte_config.mem_config->magic = RTE_MAGIC;
706 /* Launch threads, called at application init(). */
708 rte_eal_init(int argc, char **argv)
712 static rte_atomic32_t run_once = RTE_ATOMIC32_INIT(0);
714 if (!rte_atomic32_test_and_set(&run_once))
717 thread_id = pthread_self();
719 if (rte_eal_log_early_init() < 0)
720 rte_panic("Cannot init early logs\n");
722 fctret = eal_parse_args(argc, argv);
726 if (internal_config.no_hugetlbfs == 0 &&
727 internal_config.process_type != RTE_PROC_SECONDARY &&
728 eal_hugepage_info_init() < 0)
729 rte_panic("Cannot get hugepage information\n");
731 if (internal_config.memory == 0 && internal_config.force_sockets == 0) {
732 if (internal_config.no_hugetlbfs)
733 internal_config.memory = MEMSIZE_IF_NO_HUGE_PAGE;
735 internal_config.memory = eal_get_hugepage_mem_size();
738 rte_srand(rte_rdtsc());
742 if (rte_eal_cpu_init() < 0)
743 rte_panic("Cannot detect lcores\n");
745 if (rte_eal_memory_init() < 0)
746 rte_panic("Cannot init memory\n");
748 /* the directories are locked during eal_hugepage_info_init */
749 eal_hugedirs_unlock();
751 if (rte_eal_memzone_init() < 0)
752 rte_panic("Cannot init memzone\n");
754 if (rte_eal_tailqs_init() < 0)
755 rte_panic("Cannot init tail queues for objects\n");
757 if (rte_eal_log_init() < 0)
758 rte_panic("Cannot init logs\n");
760 if (rte_eal_alarm_init() < 0)
761 rte_panic("Cannot init interrupt-handling thread\n");
763 if (rte_eal_intr_init() < 0)
764 rte_panic("Cannot init interrupt-handling thread\n");
766 if (rte_eal_hpet_init() < 0)
767 rte_panic("Cannot init HPET\n");
769 if (rte_eal_pci_init() < 0)
770 rte_panic("Cannot init PCI\n");
772 RTE_LOG(DEBUG, EAL, "Master core %u is ready (tid=%x)\n",
773 rte_config.master_lcore, (int)thread_id);
775 eal_check_mem_on_local_socket();
777 rte_eal_mcfg_complete();
779 RTE_LCORE_FOREACH_SLAVE(i) {
782 * create communication pipes between master thread
785 if (pipe(lcore_config[i].pipe_master2slave) < 0)
786 rte_panic("Cannot create pipe\n");
787 if (pipe(lcore_config[i].pipe_slave2master) < 0)
788 rte_panic("Cannot create pipe\n");
790 lcore_config[i].state = WAIT;
792 /* create a thread for each lcore */
793 ret = pthread_create(&lcore_config[i].thread_id, NULL,
794 eal_thread_loop, NULL);
796 rte_panic("Cannot create thread\n");
799 eal_thread_init_master(rte_config.master_lcore);
802 * Launch a dummy function on all slave lcores, so that master lcore
803 * knows they are all ready when this function returns.
805 rte_eal_mp_remote_launch(sync_func, NULL, SKIP_MASTER);
806 rte_eal_mp_wait_lcore();
812 enum rte_lcore_role_t
813 rte_eal_lcore_role(unsigned lcore_id)
815 return (rte_config.lcore_role[lcore_id]);
819 rte_eal_process_type(void)
821 return (rte_config.process_type);