1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2014 Intel Corporation.
3 * Copyright(c) 2014 6WIND S.A.
9 #ifndef RTE_EXEC_ENV_WINDOWS
16 #ifndef RTE_EXEC_ENV_WINDOWS
20 #include <sys/types.h>
22 #ifndef RTE_EXEC_ENV_WINDOWS
26 #include <rte_string_fns.h>
29 #include <rte_lcore.h>
30 #include <rte_memory.h>
31 #include <rte_tailq.h>
32 #include <rte_version.h>
33 #include <rte_devargs.h>
34 #include <rte_memcpy.h>
35 #ifndef RTE_EXEC_ENV_WINDOWS
36 #include <rte_telemetry.h>
39 #include "eal_internal_cfg.h"
40 #include "eal_options.h"
41 #include "eal_filesystem.h"
42 #include "eal_private.h"
43 #ifndef RTE_EXEC_ENV_WINDOWS
44 #include "eal_trace.h"
47 #define BITS_PER_HEX 4
48 #define LCORE_OPT_LST 1
49 #define LCORE_OPT_MSK 2
50 #define LCORE_OPT_MAP 3
54 "b:" /* pci-blacklist */
56 "s:" /* service coremask */
60 "S:" /* service corelist */
61 "m:" /* memory size */
62 "n:" /* memory channels */
63 "r:" /* memory ranks */
65 "w:" /* pci-whitelist */
69 eal_long_options[] = {
70 {OPT_BASE_VIRTADDR, 1, NULL, OPT_BASE_VIRTADDR_NUM },
71 {OPT_CREATE_UIO_DEV, 0, NULL, OPT_CREATE_UIO_DEV_NUM },
72 {OPT_FILE_PREFIX, 1, NULL, OPT_FILE_PREFIX_NUM },
73 {OPT_HELP, 0, NULL, OPT_HELP_NUM },
74 {OPT_HUGE_DIR, 1, NULL, OPT_HUGE_DIR_NUM },
75 {OPT_HUGE_UNLINK, 0, NULL, OPT_HUGE_UNLINK_NUM },
76 {OPT_IOVA_MODE, 1, NULL, OPT_IOVA_MODE_NUM },
77 {OPT_LCORES, 1, NULL, OPT_LCORES_NUM },
78 {OPT_LOG_LEVEL, 1, NULL, OPT_LOG_LEVEL_NUM },
79 {OPT_TRACE, 1, NULL, OPT_TRACE_NUM },
80 {OPT_TRACE_DIR, 1, NULL, OPT_TRACE_DIR_NUM },
81 {OPT_TRACE_BUF_SIZE, 1, NULL, OPT_TRACE_BUF_SIZE_NUM },
82 {OPT_TRACE_MODE, 1, NULL, OPT_TRACE_MODE_NUM },
83 {OPT_MASTER_LCORE, 1, NULL, OPT_MASTER_LCORE_NUM },
84 {OPT_MBUF_POOL_OPS_NAME, 1, NULL, OPT_MBUF_POOL_OPS_NAME_NUM},
85 {OPT_NO_HPET, 0, NULL, OPT_NO_HPET_NUM },
86 {OPT_NO_HUGE, 0, NULL, OPT_NO_HUGE_NUM },
87 {OPT_NO_PCI, 0, NULL, OPT_NO_PCI_NUM },
88 {OPT_NO_SHCONF, 0, NULL, OPT_NO_SHCONF_NUM },
89 {OPT_IN_MEMORY, 0, NULL, OPT_IN_MEMORY_NUM },
90 {OPT_PCI_BLACKLIST, 1, NULL, OPT_PCI_BLACKLIST_NUM },
91 {OPT_PCI_WHITELIST, 1, NULL, OPT_PCI_WHITELIST_NUM },
92 {OPT_PROC_TYPE, 1, NULL, OPT_PROC_TYPE_NUM },
93 {OPT_SOCKET_MEM, 1, NULL, OPT_SOCKET_MEM_NUM },
94 {OPT_SOCKET_LIMIT, 1, NULL, OPT_SOCKET_LIMIT_NUM },
95 {OPT_SYSLOG, 1, NULL, OPT_SYSLOG_NUM },
96 {OPT_VDEV, 1, NULL, OPT_VDEV_NUM },
97 {OPT_VFIO_INTR, 1, NULL, OPT_VFIO_INTR_NUM },
98 {OPT_VFIO_VF_TOKEN, 1, NULL, OPT_VFIO_VF_TOKEN_NUM },
99 {OPT_VMWARE_TSC_MAP, 0, NULL, OPT_VMWARE_TSC_MAP_NUM },
100 {OPT_LEGACY_MEM, 0, NULL, OPT_LEGACY_MEM_NUM },
101 {OPT_SINGLE_FILE_SEGMENTS, 0, NULL, OPT_SINGLE_FILE_SEGMENTS_NUM},
102 {OPT_MATCH_ALLOCATIONS, 0, NULL, OPT_MATCH_ALLOCATIONS_NUM},
103 {OPT_TELEMETRY, 0, NULL, OPT_TELEMETRY_NUM },
104 {OPT_NO_TELEMETRY, 0, NULL, OPT_NO_TELEMETRY_NUM },
108 TAILQ_HEAD(shared_driver_list, shared_driver);
110 /* Definition for shared object drivers. */
111 struct shared_driver {
112 TAILQ_ENTRY(shared_driver) next;
118 /* List of external loadable drivers */
119 static struct shared_driver_list solib_list =
120 TAILQ_HEAD_INITIALIZER(solib_list);
122 #ifndef RTE_EXEC_ENV_WINDOWS
123 /* Default path of external loadable drivers */
124 static const char *default_solib_dir = RTE_EAL_PMD_PATH;
128 * Stringified version of solib path used by dpdk-pmdinfo.py
129 * Note: PLEASE DO NOT ALTER THIS without making a corresponding
130 * change to usertools/dpdk-pmdinfo.py
132 static const char dpdk_solib_path[] __rte_used =
133 "DPDK_PLUGIN_PATH=" RTE_EAL_PMD_PATH;
135 TAILQ_HEAD(device_option_list, device_option);
137 struct device_option {
138 TAILQ_ENTRY(device_option) next;
140 enum rte_devtype type;
144 static struct device_option_list devopt_list =
145 TAILQ_HEAD_INITIALIZER(devopt_list);
147 static int master_lcore_parsed;
148 static int mem_parsed;
149 static int core_parsed;
151 /* Allow the application to print its usage message too if set */
152 static rte_usage_hook_t rte_application_usage_hook;
154 /* Returns rte_usage_hook_t */
156 eal_get_application_usage_hook(void)
158 return rte_application_usage_hook;
161 /* Set a per-application usage message */
163 rte_set_application_usage_hook(rte_usage_hook_t usage_func)
165 rte_usage_hook_t old_func;
167 /* Will be NULL on the first call to denote the last usage routine. */
168 old_func = rte_application_usage_hook;
169 rte_application_usage_hook = usage_func;
174 #ifndef RTE_EXEC_ENV_WINDOWS
175 static char **eal_args;
176 static char **eal_app_args;
178 #define EAL_PARAM_REQ "/eal/params"
179 #define EAL_APP_PARAM_REQ "/eal/app_params"
181 /* callback handler for telemetry library to report out EAL flags */
183 handle_eal_info_request(const char *cmd, const char *params __rte_unused,
184 struct rte_tel_data *d)
190 if (strcmp(cmd, EAL_PARAM_REQ) == 0)
195 rte_tel_data_start_array(d, RTE_TEL_STRING_VAL);
196 if (args == NULL || args[0] == NULL)
199 for ( ; args[i] != NULL; i++)
200 used = rte_tel_data_add_array_string(d, args[i]);
205 eal_save_args(int argc, char **argv)
209 rte_telemetry_register_cmd(EAL_PARAM_REQ, handle_eal_info_request,
210 "Returns EAL commandline parameters used. Takes no parameters");
211 rte_telemetry_register_cmd(EAL_APP_PARAM_REQ, handle_eal_info_request,
212 "Returns app commandline parameters used. Takes no parameters");
214 /* clone argv to report out later. We overprovision, but
215 * this does not waste huge amounts of memory
217 eal_args = calloc(argc + 1, sizeof(*eal_args));
218 if (eal_args == NULL)
221 for (i = 0; i < argc; i++) {
222 eal_args[i] = strdup(argv[i]);
223 if (strcmp(argv[i], "--") == 0)
226 eal_args[i++] = NULL; /* always finish with NULL */
228 /* allow reporting of any app args we know about too */
232 eal_app_args = calloc(argc - i + 1, sizeof(*eal_args));
233 if (eal_app_args == NULL)
236 for (j = 0; i < argc; j++, i++)
237 eal_app_args[j] = strdup(argv[i]);
238 eal_app_args[j] = NULL;
245 eal_option_device_add(enum rte_devtype type, const char *optarg)
247 struct device_option *devopt;
251 optlen = strlen(optarg) + 1;
252 devopt = calloc(1, sizeof(*devopt) + optlen);
253 if (devopt == NULL) {
254 RTE_LOG(ERR, EAL, "Unable to allocate device option\n");
259 ret = strlcpy(devopt->arg, optarg, optlen);
261 RTE_LOG(ERR, EAL, "Unable to copy device option\n");
265 TAILQ_INSERT_TAIL(&devopt_list, devopt, next);
270 eal_option_device_parse(void)
272 struct device_option *devopt;
276 TAILQ_FOREACH_SAFE(devopt, &devopt_list, next, tmp) {
278 ret = rte_devargs_add(devopt->type, devopt->arg);
280 RTE_LOG(ERR, EAL, "Unable to parse device '%s'\n",
283 TAILQ_REMOVE(&devopt_list, devopt, next);
290 eal_get_hugefile_prefix(void)
292 const struct internal_config *internal_conf =
293 eal_get_internal_configuration();
295 if (internal_conf->hugefile_prefix != NULL)
296 return internal_conf->hugefile_prefix;
297 return HUGEFILE_PREFIX_DEFAULT;
301 eal_reset_internal_config(struct internal_config *internal_cfg)
305 internal_cfg->memory = 0;
306 internal_cfg->force_nrank = 0;
307 internal_cfg->force_nchannel = 0;
308 internal_cfg->hugefile_prefix = NULL;
309 internal_cfg->hugepage_dir = NULL;
310 internal_cfg->force_sockets = 0;
311 /* zero out the NUMA config */
312 for (i = 0; i < RTE_MAX_NUMA_NODES; i++)
313 internal_cfg->socket_mem[i] = 0;
314 internal_cfg->force_socket_limits = 0;
315 /* zero out the NUMA limits config */
316 for (i = 0; i < RTE_MAX_NUMA_NODES; i++)
317 internal_cfg->socket_limit[i] = 0;
318 /* zero out hugedir descriptors */
319 for (i = 0; i < MAX_HUGEPAGE_SIZES; i++) {
320 memset(&internal_cfg->hugepage_info[i], 0,
321 sizeof(internal_cfg->hugepage_info[0]));
322 internal_cfg->hugepage_info[i].lock_descriptor = -1;
324 internal_cfg->base_virtaddr = 0;
327 internal_cfg->syslog_facility = LOG_DAEMON;
330 /* if set to NONE, interrupt mode is determined automatically */
331 internal_cfg->vfio_intr_mode = RTE_INTR_MODE_NONE;
332 memset(internal_cfg->vfio_vf_token, 0,
333 sizeof(internal_cfg->vfio_vf_token));
335 #ifdef RTE_LIBEAL_USE_HPET
336 internal_cfg->no_hpet = 0;
338 internal_cfg->no_hpet = 1;
340 internal_cfg->vmware_tsc_map = 0;
341 internal_cfg->create_uio_dev = 0;
342 internal_cfg->iova_mode = RTE_IOVA_DC;
343 internal_cfg->user_mbuf_pool_ops_name = NULL;
344 CPU_ZERO(&internal_cfg->ctrl_cpuset);
345 internal_cfg->init_complete = 0;
349 eal_plugin_add(const char *path)
351 struct shared_driver *solib;
353 solib = malloc(sizeof(*solib));
355 RTE_LOG(ERR, EAL, "malloc(solib) failed\n");
358 memset(solib, 0, sizeof(*solib));
359 strlcpy(solib->name, path, PATH_MAX);
360 TAILQ_INSERT_TAIL(&solib_list, solib, next);
365 #ifdef RTE_EXEC_ENV_WINDOWS
367 eal_plugins_init(void)
374 eal_plugindir_init(const char *path)
377 struct dirent *dent = NULL;
378 char sopath[PATH_MAX];
380 if (path == NULL || *path == '\0')
385 RTE_LOG(ERR, EAL, "failed to open directory %s: %s\n",
386 path, strerror(errno));
390 while ((dent = readdir(d)) != NULL) {
392 int nlen = strnlen(dent->d_name, sizeof(dent->d_name));
394 /* check if name ends in .so */
395 if (strcmp(&dent->d_name[nlen - 3], ".so") != 0)
398 snprintf(sopath, sizeof(sopath), "%s/%s", path, dent->d_name);
400 /* if a regular file, add to list to load */
401 if (!(stat(sopath, &sb) == 0 && S_ISREG(sb.st_mode)))
404 if (eal_plugin_add(sopath) == -1)
409 /* XXX this ignores failures from readdir() itself */
410 return (dent == NULL) ? 0 : -1;
414 verify_perms(const char *dirpath)
418 /* if not root, check down one level first */
419 if (strcmp(dirpath, "/") != 0) {
420 static __thread char last_dir_checked[PATH_MAX];
424 strlcpy(copy, dirpath, PATH_MAX);
426 if (strncmp(dir, last_dir_checked, PATH_MAX) != 0) {
427 if (verify_perms(dir) != 0)
429 strlcpy(last_dir_checked, dir, PATH_MAX);
433 /* call stat to check for permissions and ensure not world writable */
434 if (stat(dirpath, &st) != 0) {
435 RTE_LOG(ERR, EAL, "Error with stat on %s, %s\n",
436 dirpath, strerror(errno));
439 if (st.st_mode & S_IWOTH) {
441 "Error, directory path %s is world-writable and insecure\n",
450 eal_dlopen(const char *pathname)
453 char *realp = realpath(pathname, NULL);
455 if (realp == NULL && errno == ENOENT) {
456 /* not a full or relative path, try a load from system dirs */
457 retval = dlopen(pathname, RTLD_NOW);
459 RTE_LOG(ERR, EAL, "%s\n", dlerror());
463 RTE_LOG(ERR, EAL, "Error with realpath for %s, %s\n",
464 pathname, strerror(errno));
467 if (strnlen(realp, PATH_MAX) == PATH_MAX) {
468 RTE_LOG(ERR, EAL, "Error, driver path greater than PATH_MAX\n");
472 /* do permissions checks */
473 if (verify_perms(realp) != 0)
476 retval = dlopen(realp, RTLD_NOW);
478 RTE_LOG(ERR, EAL, "%s\n", dlerror());
485 eal_plugins_init(void)
487 struct shared_driver *solib = NULL;
490 /* If we are not statically linked, add default driver loading
491 * path if it exists as a directory.
492 * (Using dlopen with NOLOAD flag on EAL, will return NULL if the EAL
493 * shared library is not already loaded i.e. it's statically linked.)
495 if (dlopen("librte_eal.so", RTLD_LAZY | RTLD_NOLOAD) != NULL &&
496 *default_solib_dir != '\0' &&
497 stat(default_solib_dir, &sb) == 0 &&
499 eal_plugin_add(default_solib_dir);
501 TAILQ_FOREACH(solib, &solib_list, next) {
503 if (stat(solib->name, &sb) == 0 && S_ISDIR(sb.st_mode)) {
504 if (eal_plugindir_init(solib->name) == -1) {
506 "Cannot init plugin directory %s\n",
511 RTE_LOG(DEBUG, EAL, "open shared lib %s\n",
513 solib->lib_handle = eal_dlopen(solib->name);
514 if (solib->lib_handle == NULL)
524 * Parse the coremask given as argument (hexadecimal string) and fill
525 * the global configuration (core role and core count) with the parsed
528 static int xdigit2val(unsigned char c)
542 eal_parse_service_coremask(const char *coremask)
544 struct rte_config *cfg = rte_eal_get_configuration();
546 unsigned int count = 0;
549 uint32_t taken_lcore_count = 0;
551 if (coremask == NULL)
553 /* Remove all blank characters ahead and after .
554 * Remove 0x/0X if exists.
556 while (isblank(*coremask))
558 if (coremask[0] == '0' && ((coremask[1] == 'x')
559 || (coremask[1] == 'X')))
561 i = strlen(coremask);
562 while ((i > 0) && isblank(coremask[i - 1]))
568 for (i = i - 1; i >= 0 && idx < RTE_MAX_LCORE; i--) {
570 if (isxdigit(c) == 0) {
571 /* invalid characters */
575 for (j = 0; j < BITS_PER_HEX && idx < RTE_MAX_LCORE;
577 if ((1 << j) & val) {
578 /* handle master lcore already parsed */
579 uint32_t lcore = idx;
580 if (master_lcore_parsed &&
581 cfg->master_lcore == lcore) {
583 "lcore %u is master lcore, cannot use as service core\n",
588 if (eal_cpu_detected(idx) == 0) {
590 "lcore %u unavailable\n", idx);
594 if (cfg->lcore_role[idx] == ROLE_RTE)
597 lcore_config[idx].core_role = ROLE_SERVICE;
604 if (coremask[i] != '0')
607 for (; idx < RTE_MAX_LCORE; idx++)
608 lcore_config[idx].core_index = -1;
613 if (core_parsed && taken_lcore_count != count) {
614 RTE_LOG(WARNING, EAL,
615 "Not all service cores are in the coremask. "
616 "Please ensure -c or -l includes service cores\n");
619 cfg->service_lcore_count = count;
624 eal_service_cores_parsed(void)
627 for (idx = 0; idx < RTE_MAX_LCORE; idx++) {
628 if (lcore_config[idx].core_role == ROLE_SERVICE)
635 update_lcore_config(int *cores)
637 struct rte_config *cfg = rte_eal_get_configuration();
638 unsigned int count = 0;
642 for (i = 0; i < RTE_MAX_LCORE; i++) {
643 if (cores[i] != -1) {
644 if (eal_cpu_detected(i) == 0) {
645 RTE_LOG(ERR, EAL, "lcore %u unavailable\n", i);
649 cfg->lcore_role[i] = ROLE_RTE;
652 cfg->lcore_role[i] = ROLE_OFF;
654 lcore_config[i].core_index = cores[i];
657 cfg->lcore_count = count;
662 eal_parse_coremask(const char *coremask, int *cores)
669 for (idx = 0; idx < RTE_MAX_LCORE; idx++)
673 /* Remove all blank characters ahead and after .
674 * Remove 0x/0X if exists.
676 while (isblank(*coremask))
678 if (coremask[0] == '0' && ((coremask[1] == 'x')
679 || (coremask[1] == 'X')))
681 i = strlen(coremask);
682 while ((i > 0) && isblank(coremask[i - 1]))
687 for (i = i - 1; i >= 0 && idx < RTE_MAX_LCORE; i--) {
689 if (isxdigit(c) == 0) {
690 /* invalid characters */
694 for (j = 0; j < BITS_PER_HEX && idx < RTE_MAX_LCORE; j++, idx++)
696 if ((1 << j) & val) {
703 if (coremask[i] != '0')
711 eal_parse_service_corelist(const char *corelist)
713 struct rte_config *cfg = rte_eal_get_configuration();
718 uint32_t taken_lcore_count = 0;
720 if (corelist == NULL)
723 /* Remove all blank characters ahead and after */
724 while (isblank(*corelist))
726 i = strlen(corelist);
727 while ((i > 0) && isblank(corelist[i - 1]))
730 /* Get list of cores */
733 while (isblank(*corelist))
735 if (*corelist == '\0')
738 idx = strtoul(corelist, &end, 10);
739 if (errno || end == NULL)
741 while (isblank(*end))
745 } else if ((*end == ',') || (*end == '\0')) {
747 if (min == RTE_MAX_LCORE)
749 for (idx = min; idx <= max; idx++) {
750 if (cfg->lcore_role[idx] != ROLE_SERVICE) {
751 /* handle master lcore already parsed */
752 uint32_t lcore = idx;
753 if (cfg->master_lcore == lcore &&
754 master_lcore_parsed) {
756 "Error: lcore %u is master lcore, cannot use as service core\n",
760 if (cfg->lcore_role[idx] == ROLE_RTE)
763 lcore_config[idx].core_role =
772 } while (*end != '\0');
777 if (core_parsed && taken_lcore_count != count) {
778 RTE_LOG(WARNING, EAL,
779 "Not all service cores were in the coremask. "
780 "Please ensure -c or -l includes service cores\n");
787 eal_parse_corelist(const char *corelist, int *cores)
794 for (idx = 0; idx < RTE_MAX_LCORE; idx++)
797 /* Remove all blank characters ahead */
798 while (isblank(*corelist))
801 /* Get list of cores */
804 while (isblank(*corelist))
806 if (*corelist == '\0')
809 idx = strtol(corelist, &end, 10);
810 if (errno || end == NULL)
812 if (idx < 0 || idx >= RTE_MAX_LCORE)
814 while (isblank(*end))
818 } else if ((*end == ',') || (*end == '\0')) {
820 if (min == RTE_MAX_LCORE)
822 for (idx = min; idx <= max; idx++) {
823 if (cores[idx] == -1) {
832 } while (*end != '\0');
839 /* Changes the lcore id of the master thread */
841 eal_parse_master_lcore(const char *arg)
844 struct rte_config *cfg = rte_eal_get_configuration();
847 cfg->master_lcore = (uint32_t) strtol(arg, &parsing_end, 0);
848 if (errno || parsing_end[0] != 0)
850 if (cfg->master_lcore >= RTE_MAX_LCORE)
852 master_lcore_parsed = 1;
854 /* ensure master core is not used as service core */
855 if (lcore_config[cfg->master_lcore].core_role == ROLE_SERVICE) {
857 "Error: Master lcore is used as a service core\n");
865 * Parse elem, the elem could be single number/range or '(' ')' group
866 * 1) A single number elem, it's just a simple digit. e.g. 9
867 * 2) A single range elem, two digits with a '-' between. e.g. 2-6
868 * 3) A group elem, combines multiple 1) or 2) with '( )'. e.g (0,2-4,6)
869 * Within group elem, '-' used for a range separator;
870 * ',' used for a single number.
873 eal_parse_set(const char *input, rte_cpuset_t *set)
876 const char *str = input;
882 while (isblank(*str))
885 /* only digit or left bracket is qualify for start point */
886 if ((!isdigit(*str) && *str != '(') || *str == '\0')
889 /* process single number or single range of number */
892 idx = strtoul(str, &end, 10);
893 if (errno || end == NULL || idx >= CPU_SETSIZE)
896 while (isblank(*end))
902 /* process single <number>-<number> */
904 while (isblank(*end))
910 idx = strtoul(end, &end, 10);
911 if (errno || end == NULL || idx >= CPU_SETSIZE)
914 while (isblank(*end))
916 if (*end != ',' && *end != '\0')
920 if (*end != ',' && *end != '\0' &&
924 for (idx = RTE_MIN(min, max);
925 idx <= RTE_MAX(min, max); idx++)
932 /* process set within bracket */
934 while (isblank(*str))
942 /* go ahead to the first digit */
943 while (isblank(*str))
948 /* get the digit value */
950 idx = strtoul(str, &end, 10);
951 if (errno || end == NULL || idx >= CPU_SETSIZE)
954 /* go ahead to separator '-',',' and ')' */
955 while (isblank(*end))
958 if (min == RTE_MAX_LCORE)
960 else /* avoid continuous '-' */
962 } else if ((*end == ',') || (*end == ')')) {
964 if (min == RTE_MAX_LCORE)
966 for (idx = RTE_MIN(min, max);
967 idx <= RTE_MAX(min, max); idx++)
975 } while (*end != '\0' && *end != ')');
978 * to avoid failure that tail blank makes end character check fail
979 * in eal_parse_lcores( )
981 while (isblank(*str))
988 check_cpuset(rte_cpuset_t *set)
992 for (idx = 0; idx < CPU_SETSIZE; idx++) {
993 if (!CPU_ISSET(idx, set))
996 if (eal_cpu_detected(idx) == 0) {
997 RTE_LOG(ERR, EAL, "core %u "
998 "unavailable\n", idx);
1006 * The format pattern: --lcores='<lcores[@cpus]>[<,lcores[@cpus]>...]'
1007 * lcores, cpus could be a single digit/range or a group.
1008 * '(' and ')' are necessary if it's a group.
1009 * If not supply '@cpus', the value of cpus uses the same as lcores.
1010 * e.g. '1,2@(5-7),(3-5)@(0,2),(0,6),7-8' means start 9 EAL thread as below
1011 * lcore 0 runs on cpuset 0x41 (cpu 0,6)
1012 * lcore 1 runs on cpuset 0x2 (cpu 1)
1013 * lcore 2 runs on cpuset 0xe0 (cpu 5,6,7)
1014 * lcore 3,4,5 runs on cpuset 0x5 (cpu 0,2)
1015 * lcore 6 runs on cpuset 0x41 (cpu 0,6)
1016 * lcore 7 runs on cpuset 0x80 (cpu 7)
1017 * lcore 8 runs on cpuset 0x100 (cpu 8)
1020 eal_parse_lcores(const char *lcores)
1022 struct rte_config *cfg = rte_eal_get_configuration();
1023 rte_cpuset_t lcore_set;
1024 unsigned int set_count;
1027 const char *lcore_start = NULL;
1028 const char *end = NULL;
1030 rte_cpuset_t cpuset;
1037 /* Remove all blank characters ahead and after */
1038 while (isblank(*lcores))
1043 /* Reset lcore config */
1044 for (idx = 0; idx < RTE_MAX_LCORE; idx++) {
1045 cfg->lcore_role[idx] = ROLE_OFF;
1046 lcore_config[idx].core_index = -1;
1047 CPU_ZERO(&lcore_config[idx].cpuset);
1050 /* Get list of cores */
1052 while (isblank(*lcores))
1054 if (*lcores == '\0')
1059 /* record lcore_set start point */
1060 lcore_start = lcores;
1062 /* go across a complete bracket */
1063 if (*lcore_start == '(') {
1064 lcores += strcspn(lcores, ")");
1065 if (*lcores++ == '\0')
1069 /* scan the separator '@', ','(next) or '\0'(finish) */
1070 lcores += strcspn(lcores, "@,");
1072 if (*lcores == '@') {
1073 /* explicit assign cpuset and update the end cursor */
1074 offset = eal_parse_set(lcores + 1, &cpuset);
1077 end = lcores + 1 + offset;
1078 } else { /* ',' or '\0' */
1079 /* haven't given cpuset, current loop done */
1082 /* go back to check <number>-<number> */
1083 offset = strcspn(lcore_start, "(-");
1084 if (offset < (end - lcore_start) &&
1085 *(lcore_start + offset) != '(')
1089 if (*end != ',' && *end != '\0')
1092 /* parse lcore_set from start point */
1093 if (eal_parse_set(lcore_start, &lcore_set) < 0)
1096 /* without '@', by default using lcore_set as cpuset */
1098 rte_memcpy(&cpuset, &lcore_set, sizeof(cpuset));
1100 set_count = CPU_COUNT(&lcore_set);
1101 /* start to update lcore_set */
1102 for (idx = 0; idx < RTE_MAX_LCORE; idx++) {
1103 if (!CPU_ISSET(idx, &lcore_set))
1107 if (cfg->lcore_role[idx] != ROLE_RTE) {
1108 lcore_config[idx].core_index = count;
1109 cfg->lcore_role[idx] = ROLE_RTE;
1115 CPU_SET(idx, &cpuset);
1118 if (check_cpuset(&cpuset) < 0)
1120 rte_memcpy(&lcore_config[idx].cpuset, &cpuset,
1121 sizeof(rte_cpuset_t));
1124 /* some cores from the lcore_set can't be handled by EAL */
1129 } while (*end != '\0');
1134 cfg->lcore_count = count;
1142 #ifndef RTE_EXEC_ENV_WINDOWS
1144 eal_parse_syslog(const char *facility, struct internal_config *conf)
1147 static const struct {
1151 { "auth", LOG_AUTH },
1152 { "cron", LOG_CRON },
1153 { "daemon", LOG_DAEMON },
1155 { "kern", LOG_KERN },
1157 { "mail", LOG_MAIL },
1158 { "news", LOG_NEWS },
1159 { "syslog", LOG_SYSLOG },
1160 { "user", LOG_USER },
1161 { "uucp", LOG_UUCP },
1162 { "local0", LOG_LOCAL0 },
1163 { "local1", LOG_LOCAL1 },
1164 { "local2", LOG_LOCAL2 },
1165 { "local3", LOG_LOCAL3 },
1166 { "local4", LOG_LOCAL4 },
1167 { "local5", LOG_LOCAL5 },
1168 { "local6", LOG_LOCAL6 },
1169 { "local7", LOG_LOCAL7 },
1173 for (i = 0; map[i].name; i++) {
1174 if (!strcmp(facility, map[i].name)) {
1175 conf->syslog_facility = map[i].value;
1184 eal_parse_log_priority(const char *level)
1186 static const char * const levels[] = {
1187 [RTE_LOG_EMERG] = "emergency",
1188 [RTE_LOG_ALERT] = "alert",
1189 [RTE_LOG_CRIT] = "critical",
1190 [RTE_LOG_ERR] = "error",
1191 [RTE_LOG_WARNING] = "warning",
1192 [RTE_LOG_NOTICE] = "notice",
1193 [RTE_LOG_INFO] = "info",
1194 [RTE_LOG_DEBUG] = "debug",
1196 size_t len = strlen(level);
1204 /* look for named values, skip 0 which is not a valid level */
1205 for (i = 1; i < RTE_DIM(levels); i++) {
1206 if (strncmp(levels[i], level, len) == 0)
1210 /* not a string, maybe it is numeric */
1212 tmp = strtoul(level, &end, 0);
1214 /* check for errors */
1215 if (errno != 0 || end == NULL || *end != '\0' ||
1223 eal_parse_log_level(const char *arg)
1225 const char *pattern = NULL;
1226 const char *regex = NULL;
1234 if ((level = strchr(str, ','))) {
1237 } else if ((level = strchr(str, ':'))) {
1244 priority = eal_parse_log_priority(level);
1246 fprintf(stderr, "invalid log priority: %s\n", level);
1251 if (rte_log_set_level_regexp(regex, priority) < 0) {
1252 fprintf(stderr, "cannot set log level %s,%d\n",
1256 if (rte_log_save_regexp(regex, priority) < 0)
1258 } else if (pattern) {
1259 if (rte_log_set_level_pattern(pattern, priority) < 0) {
1260 fprintf(stderr, "cannot set log level %s:%d\n",
1264 if (rte_log_save_pattern(pattern, priority) < 0)
1267 rte_log_set_global_level(priority);
1278 static enum rte_proc_type_t
1279 eal_parse_proc_type(const char *arg)
1281 if (strncasecmp(arg, "primary", sizeof("primary")) == 0)
1282 return RTE_PROC_PRIMARY;
1283 if (strncasecmp(arg, "secondary", sizeof("secondary")) == 0)
1284 return RTE_PROC_SECONDARY;
1285 if (strncasecmp(arg, "auto", sizeof("auto")) == 0)
1286 return RTE_PROC_AUTO;
1288 return RTE_PROC_INVALID;
1292 eal_parse_iova_mode(const char *name)
1295 struct internal_config *internal_conf =
1296 eal_get_internal_configuration();
1301 if (!strcmp("pa", name))
1303 else if (!strcmp("va", name))
1308 internal_conf->iova_mode = mode;
1313 eal_parse_base_virtaddr(const char *arg)
1317 struct internal_config *internal_conf =
1318 eal_get_internal_configuration();
1321 addr = strtoull(arg, &end, 16);
1323 /* check for errors */
1324 if ((errno != 0) || (arg[0] == '\0') || end == NULL || (*end != '\0'))
1327 /* make sure we don't exceed 32-bit boundary on 32-bit target */
1329 if (addr >= UINTPTR_MAX)
1333 /* align the addr on 16M boundary, 16MB is the minimum huge page
1334 * size on IBM Power architecture. If the addr is aligned to 16MB,
1335 * it can align to 2MB for x86. So this alignment can also be used
1336 * on x86 and other architectures.
1338 internal_conf->base_virtaddr =
1339 RTE_PTR_ALIGN_CEIL((uintptr_t)addr, (size_t)RTE_PGSIZE_16M);
1344 /* caller is responsible for freeing the returned string */
1346 available_cores(void)
1354 /* find the first available cpu */
1355 for (idx = 0; idx < RTE_MAX_LCORE; idx++) {
1356 if (eal_cpu_detected(idx) == 0)
1360 if (idx >= RTE_MAX_LCORE)
1363 /* first sequence */
1364 if (asprintf(&str, "%d", idx) < 0)
1369 for (idx++ ; idx < RTE_MAX_LCORE; idx++) {
1370 if (eal_cpu_detected(idx) == 0)
1373 if (idx == previous + 1) {
1379 /* finish current sequence */
1381 if (asprintf(&tmp, "%s-%d", str, previous) < 0) {
1390 if (asprintf(&tmp, "%s,%d", str, idx) < 0) {
1400 /* finish last sequence */
1402 if (asprintf(&tmp, "%s-%d", str, previous) < 0) {
1414 eal_parse_common_option(int opt, const char *optarg,
1415 struct internal_config *conf)
1425 if (eal_option_device_add(RTE_DEVTYPE_BLACKLISTED_PCI,
1435 if (eal_option_device_add(RTE_DEVTYPE_WHITELISTED_PCI,
1443 int lcore_indexes[RTE_MAX_LCORE];
1445 if (eal_service_cores_parsed())
1446 RTE_LOG(WARNING, EAL,
1447 "Service cores parsed before dataplane cores. Please ensure -c is before -s or -S\n");
1448 if (eal_parse_coremask(optarg, lcore_indexes) < 0) {
1449 RTE_LOG(ERR, EAL, "invalid coremask syntax\n");
1452 if (update_lcore_config(lcore_indexes) < 0) {
1453 char *available = available_cores();
1456 "invalid coremask, please check specified cores are part of %s\n",
1463 RTE_LOG(ERR, EAL, "Option -c is ignored, because (%s) is set!\n",
1464 (core_parsed == LCORE_OPT_LST) ? "-l" :
1465 (core_parsed == LCORE_OPT_MAP) ? "--lcore" :
1470 core_parsed = LCORE_OPT_MSK;
1475 int lcore_indexes[RTE_MAX_LCORE];
1477 if (eal_service_cores_parsed())
1478 RTE_LOG(WARNING, EAL,
1479 "Service cores parsed before dataplane cores. Please ensure -l is before -s or -S\n");
1481 if (eal_parse_corelist(optarg, lcore_indexes) < 0) {
1482 RTE_LOG(ERR, EAL, "invalid core list syntax\n");
1485 if (update_lcore_config(lcore_indexes) < 0) {
1486 char *available = available_cores();
1489 "invalid core list, please check specified cores are part of %s\n",
1496 RTE_LOG(ERR, EAL, "Option -l is ignored, because (%s) is set!\n",
1497 (core_parsed == LCORE_OPT_MSK) ? "-c" :
1498 (core_parsed == LCORE_OPT_MAP) ? "--lcore" :
1503 core_parsed = LCORE_OPT_LST;
1506 /* service coremask */
1508 if (eal_parse_service_coremask(optarg) < 0) {
1509 RTE_LOG(ERR, EAL, "invalid service coremask\n");
1513 /* service corelist */
1515 if (eal_parse_service_corelist(optarg) < 0) {
1516 RTE_LOG(ERR, EAL, "invalid service core list\n");
1520 /* size of memory */
1522 conf->memory = atoi(optarg);
1523 conf->memory *= 1024ULL;
1524 conf->memory *= 1024ULL;
1527 /* force number of channels */
1529 conf->force_nchannel = atoi(optarg);
1530 if (conf->force_nchannel == 0) {
1531 RTE_LOG(ERR, EAL, "invalid channel number\n");
1535 /* force number of ranks */
1537 conf->force_nrank = atoi(optarg);
1538 if (conf->force_nrank == 0 ||
1539 conf->force_nrank > 16) {
1540 RTE_LOG(ERR, EAL, "invalid rank number\n");
1544 /* force loading of external driver */
1546 if (eal_plugin_add(optarg) == -1)
1550 /* since message is explicitly requested by user, we
1551 * write message at highest log level so it can always
1553 * even if info or warning messages are disabled */
1554 RTE_LOG(CRIT, EAL, "RTE Version: '%s'\n", rte_version());
1558 case OPT_HUGE_UNLINK_NUM:
1559 conf->hugepage_unlink = 1;
1562 case OPT_NO_HUGE_NUM:
1563 conf->no_hugetlbfs = 1;
1564 /* no-huge is legacy mem */
1565 conf->legacy_mem = 1;
1568 case OPT_NO_PCI_NUM:
1572 case OPT_NO_HPET_NUM:
1576 case OPT_VMWARE_TSC_MAP_NUM:
1577 conf->vmware_tsc_map = 1;
1580 case OPT_NO_SHCONF_NUM:
1581 conf->no_shconf = 1;
1584 case OPT_IN_MEMORY_NUM:
1585 conf->in_memory = 1;
1586 /* in-memory is a superset of noshconf and huge-unlink */
1587 conf->no_shconf = 1;
1588 conf->hugepage_unlink = 1;
1591 case OPT_PROC_TYPE_NUM:
1592 conf->process_type = eal_parse_proc_type(optarg);
1595 case OPT_MASTER_LCORE_NUM:
1596 if (eal_parse_master_lcore(optarg) < 0) {
1597 RTE_LOG(ERR, EAL, "invalid parameter for --"
1598 OPT_MASTER_LCORE "\n");
1604 if (eal_option_device_add(RTE_DEVTYPE_VIRTUAL,
1610 #ifndef RTE_EXEC_ENV_WINDOWS
1611 case OPT_SYSLOG_NUM:
1612 if (eal_parse_syslog(optarg, conf) < 0) {
1613 RTE_LOG(ERR, EAL, "invalid parameters for --"
1620 case OPT_LOG_LEVEL_NUM: {
1621 if (eal_parse_log_level(optarg) < 0) {
1623 "invalid parameters for --"
1624 OPT_LOG_LEVEL "\n");
1630 #ifndef RTE_EXEC_ENV_WINDOWS
1631 case OPT_TRACE_NUM: {
1632 if (eal_trace_args_save(optarg) < 0) {
1633 RTE_LOG(ERR, EAL, "invalid parameters for --"
1640 case OPT_TRACE_DIR_NUM: {
1641 if (eal_trace_dir_args_save(optarg) < 0) {
1642 RTE_LOG(ERR, EAL, "invalid parameters for --"
1643 OPT_TRACE_DIR "\n");
1649 case OPT_TRACE_BUF_SIZE_NUM: {
1650 if (eal_trace_bufsz_args_save(optarg) < 0) {
1651 RTE_LOG(ERR, EAL, "invalid parameters for --"
1652 OPT_TRACE_BUF_SIZE "\n");
1658 case OPT_TRACE_MODE_NUM: {
1659 if (eal_trace_mode_args_save(optarg) < 0) {
1660 RTE_LOG(ERR, EAL, "invalid parameters for --"
1661 OPT_TRACE_MODE "\n");
1666 #endif /* !RTE_EXEC_ENV_WINDOWS */
1668 case OPT_LCORES_NUM:
1669 if (eal_parse_lcores(optarg) < 0) {
1670 RTE_LOG(ERR, EAL, "invalid parameter for --"
1676 RTE_LOG(ERR, EAL, "Option --lcore is ignored, because (%s) is set!\n",
1677 (core_parsed == LCORE_OPT_LST) ? "-l" :
1678 (core_parsed == LCORE_OPT_MSK) ? "-c" :
1683 core_parsed = LCORE_OPT_MAP;
1685 case OPT_LEGACY_MEM_NUM:
1686 conf->legacy_mem = 1;
1688 case OPT_SINGLE_FILE_SEGMENTS_NUM:
1689 conf->single_file_segments = 1;
1691 case OPT_IOVA_MODE_NUM:
1692 if (eal_parse_iova_mode(optarg) < 0) {
1693 RTE_LOG(ERR, EAL, "invalid parameters for --"
1694 OPT_IOVA_MODE "\n");
1698 case OPT_BASE_VIRTADDR_NUM:
1699 if (eal_parse_base_virtaddr(optarg) < 0) {
1700 RTE_LOG(ERR, EAL, "invalid parameter for --"
1701 OPT_BASE_VIRTADDR "\n");
1705 case OPT_TELEMETRY_NUM:
1707 case OPT_NO_TELEMETRY_NUM:
1708 conf->no_telemetry = 1;
1711 /* don't know what to do, leave this to caller */
1719 RTE_LOG(ERR, EAL, "Options blacklist (-b) and whitelist (-w) "
1720 "cannot be used at the same time\n");
1725 eal_auto_detect_cores(struct rte_config *cfg)
1727 unsigned int lcore_id;
1728 unsigned int removed = 0;
1729 rte_cpuset_t affinity_set;
1731 if (pthread_getaffinity_np(pthread_self(), sizeof(rte_cpuset_t),
1733 CPU_ZERO(&affinity_set);
1735 for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {
1736 if (cfg->lcore_role[lcore_id] == ROLE_RTE &&
1737 !CPU_ISSET(lcore_id, &affinity_set)) {
1738 cfg->lcore_role[lcore_id] = ROLE_OFF;
1743 cfg->lcore_count -= removed;
1747 compute_ctrl_threads_cpuset(struct internal_config *internal_cfg)
1749 rte_cpuset_t *cpuset = &internal_cfg->ctrl_cpuset;
1750 rte_cpuset_t default_set;
1751 unsigned int lcore_id;
1753 for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {
1754 if (rte_lcore_has_role(lcore_id, ROLE_OFF))
1756 RTE_CPU_OR(cpuset, cpuset, &lcore_config[lcore_id].cpuset);
1758 RTE_CPU_NOT(cpuset, cpuset);
1760 if (pthread_getaffinity_np(pthread_self(), sizeof(rte_cpuset_t),
1762 CPU_ZERO(&default_set);
1764 RTE_CPU_AND(cpuset, cpuset, &default_set);
1766 /* if no remaining cpu, use master lcore cpu affinity */
1767 if (!CPU_COUNT(cpuset)) {
1768 memcpy(cpuset, &lcore_config[rte_get_master_lcore()].cpuset,
1774 eal_cleanup_config(struct internal_config *internal_cfg)
1776 if (internal_cfg->hugefile_prefix != NULL)
1777 free(internal_cfg->hugefile_prefix);
1778 if (internal_cfg->hugepage_dir != NULL)
1779 free(internal_cfg->hugepage_dir);
1780 if (internal_cfg->user_mbuf_pool_ops_name != NULL)
1781 free(internal_cfg->user_mbuf_pool_ops_name);
1787 eal_adjust_config(struct internal_config *internal_cfg)
1790 struct rte_config *cfg = rte_eal_get_configuration();
1791 struct internal_config *internal_conf =
1792 eal_get_internal_configuration();
1795 eal_auto_detect_cores(cfg);
1797 if (internal_conf->process_type == RTE_PROC_AUTO)
1798 internal_conf->process_type = eal_proc_type_detect();
1800 /* default master lcore is the first one */
1801 if (!master_lcore_parsed) {
1802 cfg->master_lcore = rte_get_next_lcore(-1, 0, 0);
1803 if (cfg->master_lcore >= RTE_MAX_LCORE)
1805 lcore_config[cfg->master_lcore].core_role = ROLE_RTE;
1808 compute_ctrl_threads_cpuset(internal_cfg);
1810 /* if no memory amounts were requested, this will result in 0 and
1811 * will be overridden later, right after eal_hugepage_info_init() */
1812 for (i = 0; i < RTE_MAX_NUMA_NODES; i++)
1813 internal_cfg->memory += internal_cfg->socket_mem[i];
1819 eal_check_common_options(struct internal_config *internal_cfg)
1821 struct rte_config *cfg = rte_eal_get_configuration();
1822 const struct internal_config *internal_conf =
1823 eal_get_internal_configuration();
1825 if (cfg->lcore_role[cfg->master_lcore] != ROLE_RTE) {
1826 RTE_LOG(ERR, EAL, "Master lcore is not enabled for DPDK\n");
1830 if (internal_cfg->process_type == RTE_PROC_INVALID) {
1831 RTE_LOG(ERR, EAL, "Invalid process type specified\n");
1834 if (internal_cfg->hugefile_prefix != NULL &&
1835 strlen(internal_cfg->hugefile_prefix) < 1) {
1836 RTE_LOG(ERR, EAL, "Invalid length of --" OPT_FILE_PREFIX " option\n");
1839 if (internal_cfg->hugepage_dir != NULL &&
1840 strlen(internal_cfg->hugepage_dir) < 1) {
1841 RTE_LOG(ERR, EAL, "Invalid length of --" OPT_HUGE_DIR" option\n");
1844 if (internal_cfg->user_mbuf_pool_ops_name != NULL &&
1845 strlen(internal_cfg->user_mbuf_pool_ops_name) < 1) {
1846 RTE_LOG(ERR, EAL, "Invalid length of --" OPT_MBUF_POOL_OPS_NAME" option\n");
1849 if (index(eal_get_hugefile_prefix(), '%') != NULL) {
1850 RTE_LOG(ERR, EAL, "Invalid char, '%%', in --"OPT_FILE_PREFIX" "
1854 if (mem_parsed && internal_cfg->force_sockets == 1) {
1855 RTE_LOG(ERR, EAL, "Options -m and --"OPT_SOCKET_MEM" cannot "
1856 "be specified at the same time\n");
1859 if (internal_cfg->no_hugetlbfs && internal_cfg->force_sockets == 1) {
1860 RTE_LOG(ERR, EAL, "Option --"OPT_SOCKET_MEM" cannot "
1861 "be specified together with --"OPT_NO_HUGE"\n");
1864 if (internal_cfg->no_hugetlbfs && internal_cfg->hugepage_unlink &&
1865 !internal_cfg->in_memory) {
1866 RTE_LOG(ERR, EAL, "Option --"OPT_HUGE_UNLINK" cannot "
1867 "be specified together with --"OPT_NO_HUGE"\n");
1870 if (internal_conf->force_socket_limits && internal_conf->legacy_mem) {
1871 RTE_LOG(ERR, EAL, "Option --"OPT_SOCKET_LIMIT
1872 " is only supported in non-legacy memory mode\n");
1874 if (internal_cfg->single_file_segments &&
1875 internal_cfg->hugepage_unlink &&
1876 !internal_cfg->in_memory) {
1877 RTE_LOG(ERR, EAL, "Option --"OPT_SINGLE_FILE_SEGMENTS" is "
1878 "not compatible with --"OPT_HUGE_UNLINK"\n");
1881 if (internal_cfg->legacy_mem &&
1882 internal_cfg->in_memory) {
1883 RTE_LOG(ERR, EAL, "Option --"OPT_LEGACY_MEM" is not compatible "
1884 "with --"OPT_IN_MEMORY"\n");
1887 if (internal_cfg->legacy_mem && internal_cfg->match_allocations) {
1888 RTE_LOG(ERR, EAL, "Option --"OPT_LEGACY_MEM" is not compatible "
1889 "with --"OPT_MATCH_ALLOCATIONS"\n");
1892 if (internal_cfg->no_hugetlbfs && internal_cfg->match_allocations) {
1893 RTE_LOG(ERR, EAL, "Option --"OPT_NO_HUGE" is not compatible "
1894 "with --"OPT_MATCH_ALLOCATIONS"\n");
1897 if (internal_cfg->legacy_mem && internal_cfg->memory == 0) {
1898 RTE_LOG(NOTICE, EAL, "Static memory layout is selected, "
1899 "amount of reserved memory can be adjusted with "
1900 "-m or --"OPT_SOCKET_MEM"\n");
1907 eal_common_usage(void)
1909 printf("[options]\n\n"
1910 "EAL common options:\n"
1911 " -c COREMASK Hexadecimal bitmask of cores to run on\n"
1912 " -l CORELIST List of cores to run on\n"
1913 " The argument format is <c1>[-c2][,c3[-c4],...]\n"
1914 " where c1, c2, etc are core indexes between 0 and %d\n"
1915 " --"OPT_LCORES" COREMAP Map lcore set to physical cpu set\n"
1916 " The argument format is\n"
1917 " '<lcores[@cpus]>[<,lcores[@cpus]>...]'\n"
1918 " lcores and cpus list are grouped by '(' and ')'\n"
1919 " Within the group, '-' is used for range separator,\n"
1920 " ',' is used for single number separator.\n"
1921 " '( )' can be omitted for single element group,\n"
1922 " '@' can be omitted if cpus and lcores have the same value\n"
1923 " -s SERVICE COREMASK Hexadecimal bitmask of cores to be used as service cores\n"
1924 " --"OPT_MASTER_LCORE" ID Core ID that is used as master\n"
1925 " --"OPT_MBUF_POOL_OPS_NAME" Pool ops name for mbuf to use\n"
1926 " -n CHANNELS Number of memory channels\n"
1927 " -m MB Memory to allocate (see also --"OPT_SOCKET_MEM")\n"
1928 " -r RANKS Force number of memory ranks (don't detect)\n"
1929 " -b, --"OPT_PCI_BLACKLIST" Add a PCI device in black list.\n"
1930 " Prevent EAL from using this PCI device. The argument\n"
1931 " format is <domain:bus:devid.func>.\n"
1932 " -w, --"OPT_PCI_WHITELIST" Add a PCI device in white list.\n"
1933 " Only use the specified PCI devices. The argument format\n"
1934 " is <[domain:]bus:devid.func>. This option can be present\n"
1935 " several times (once per device).\n"
1936 " [NOTE: PCI whitelist cannot be used with -b option]\n"
1937 " --"OPT_VDEV" Add a virtual device.\n"
1938 " The argument format is <driver><id>[,key=val,...]\n"
1939 " (ex: --vdev=net_pcap0,iface=eth2).\n"
1940 " --"OPT_IOVA_MODE" Set IOVA mode. 'pa' for IOVA_PA\n"
1941 " 'va' for IOVA_VA\n"
1942 " -d LIB.so|DIR Add a driver or driver directory\n"
1943 " (can be used multiple times)\n"
1944 " --"OPT_VMWARE_TSC_MAP" Use VMware TSC map instead of native RDTSC\n"
1945 " --"OPT_PROC_TYPE" Type of this process (primary|secondary|auto)\n"
1946 #ifndef RTE_EXEC_ENV_WINDOWS
1947 " --"OPT_SYSLOG" Set syslog facility\n"
1949 " --"OPT_LOG_LEVEL"=<int> Set global log level\n"
1950 " --"OPT_LOG_LEVEL"=<type-match>:<int>\n"
1951 " Set specific log level\n"
1952 #ifndef RTE_EXEC_ENV_WINDOWS
1953 " --"OPT_TRACE"=<regex-match>\n"
1954 " Enable trace based on regular expression trace name.\n"
1955 " By default, the trace is disabled.\n"
1956 " User must specify this option to enable trace.\n"
1957 " --"OPT_TRACE_DIR"=<directory path>\n"
1958 " Specify trace directory for trace output.\n"
1959 " By default, trace output will created at\n"
1960 " $HOME directory and parameter must be\n"
1961 " specified once only.\n"
1962 " --"OPT_TRACE_BUF_SIZE"=<int>\n"
1963 " Specify maximum size of allocated memory\n"
1964 " for trace output for each thread. Valid\n"
1965 " unit can be either 'B|K|M' for 'Bytes',\n"
1966 " 'KBytes' and 'MBytes' respectively.\n"
1967 " Default is 1MB and parameter must be\n"
1968 " specified once only.\n"
1969 " --"OPT_TRACE_MODE"=<o[verwrite] | d[iscard]>\n"
1970 " Specify the mode of update of trace\n"
1971 " output file. Either update on a file can\n"
1972 " be wrapped or discarded when file size\n"
1973 " reaches its maximum limit.\n"
1974 " Default mode is 'overwrite' and parameter\n"
1975 " must be specified once only.\n"
1976 #endif /* !RTE_EXEC_ENV_WINDOWS */
1977 " -v Display version information on startup\n"
1978 " -h, --help This help\n"
1979 " --"OPT_IN_MEMORY" Operate entirely in memory. This will\n"
1980 " disable secondary process support\n"
1981 " --"OPT_BASE_VIRTADDR" Base virtual address\n"
1982 " --"OPT_TELEMETRY" Enable telemetry support (on by default)\n"
1983 " --"OPT_NO_TELEMETRY" Disable telemetry support\n"
1984 "\nEAL options for DEBUG use only:\n"
1985 " --"OPT_HUGE_UNLINK" Unlink hugepage files after init\n"
1986 " --"OPT_NO_HUGE" Use malloc instead of hugetlbfs\n"
1987 " --"OPT_NO_PCI" Disable PCI\n"
1988 " --"OPT_NO_HPET" Disable HPET\n"
1989 " --"OPT_NO_SHCONF" No shared config (mmap'd files)\n"
1990 "\n", RTE_MAX_LCORE);