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_VMWARE_TSC_MAP, 0, NULL, OPT_VMWARE_TSC_MAP_NUM },
99 {OPT_LEGACY_MEM, 0, NULL, OPT_LEGACY_MEM_NUM },
100 {OPT_SINGLE_FILE_SEGMENTS, 0, NULL, OPT_SINGLE_FILE_SEGMENTS_NUM},
101 {OPT_MATCH_ALLOCATIONS, 0, NULL, OPT_MATCH_ALLOCATIONS_NUM},
102 {OPT_TELEMETRY, 0, NULL, OPT_TELEMETRY_NUM },
103 {OPT_NO_TELEMETRY, 0, NULL, OPT_NO_TELEMETRY_NUM },
107 TAILQ_HEAD(shared_driver_list, shared_driver);
109 /* Definition for shared object drivers. */
110 struct shared_driver {
111 TAILQ_ENTRY(shared_driver) next;
117 /* List of external loadable drivers */
118 static struct shared_driver_list solib_list =
119 TAILQ_HEAD_INITIALIZER(solib_list);
121 #ifndef RTE_EXEC_ENV_WINDOWS
122 /* Default path of external loadable drivers */
123 static const char *default_solib_dir = RTE_EAL_PMD_PATH;
127 * Stringified version of solib path used by dpdk-pmdinfo.py
128 * Note: PLEASE DO NOT ALTER THIS without making a corresponding
129 * change to usertools/dpdk-pmdinfo.py
131 static const char dpdk_solib_path[] __rte_used =
132 "DPDK_PLUGIN_PATH=" RTE_EAL_PMD_PATH;
134 TAILQ_HEAD(device_option_list, device_option);
136 struct device_option {
137 TAILQ_ENTRY(device_option) next;
139 enum rte_devtype type;
143 static struct device_option_list devopt_list =
144 TAILQ_HEAD_INITIALIZER(devopt_list);
146 static int master_lcore_parsed;
147 static int mem_parsed;
148 static int core_parsed;
150 /* Allow the application to print its usage message too if set */
151 static rte_usage_hook_t rte_application_usage_hook;
153 /* Returns rte_usage_hook_t */
155 eal_get_application_usage_hook(void)
157 return rte_application_usage_hook;
160 /* Set a per-application usage message */
162 rte_set_application_usage_hook(rte_usage_hook_t usage_func)
164 rte_usage_hook_t old_func;
166 /* Will be NULL on the first call to denote the last usage routine. */
167 old_func = rte_application_usage_hook;
168 rte_application_usage_hook = usage_func;
173 #ifndef RTE_EXEC_ENV_WINDOWS
174 static char **eal_args;
175 static char **eal_app_args;
177 #define EAL_PARAM_REQ "/eal/params"
178 #define EAL_APP_PARAM_REQ "/eal/app_params"
180 /* callback handler for telemetry library to report out EAL flags */
182 handle_eal_info_request(const char *cmd, const char *params __rte_unused,
183 struct rte_tel_data *d)
189 if (strcmp(cmd, EAL_PARAM_REQ) == 0)
194 rte_tel_data_start_array(d, RTE_TEL_STRING_VAL);
195 if (args == NULL || args[0] == NULL)
198 for ( ; args[i] != NULL; i++)
199 used = rte_tel_data_add_array_string(d, args[i]);
204 eal_save_args(int argc, char **argv)
208 rte_telemetry_register_cmd(EAL_PARAM_REQ, handle_eal_info_request,
209 "Returns EAL commandline parameters used. Takes no parameters");
210 rte_telemetry_register_cmd(EAL_APP_PARAM_REQ, handle_eal_info_request,
211 "Returns app commandline parameters used. Takes no parameters");
213 /* clone argv to report out later. We overprovision, but
214 * this does not waste huge amounts of memory
216 eal_args = calloc(argc + 1, sizeof(*eal_args));
217 if (eal_args == NULL)
220 for (i = 0; i < argc; i++) {
221 eal_args[i] = strdup(argv[i]);
222 if (strcmp(argv[i], "--") == 0)
225 eal_args[i++] = NULL; /* always finish with NULL */
227 /* allow reporting of any app args we know about too */
231 eal_app_args = calloc(argc - i + 1, sizeof(*eal_args));
232 if (eal_app_args == NULL)
235 for (j = 0; i < argc; j++, i++)
236 eal_app_args[j] = strdup(argv[i]);
237 eal_app_args[j] = NULL;
244 eal_option_device_add(enum rte_devtype type, const char *optarg)
246 struct device_option *devopt;
250 optlen = strlen(optarg) + 1;
251 devopt = calloc(1, sizeof(*devopt) + optlen);
252 if (devopt == NULL) {
253 RTE_LOG(ERR, EAL, "Unable to allocate device option\n");
258 ret = strlcpy(devopt->arg, optarg, optlen);
260 RTE_LOG(ERR, EAL, "Unable to copy device option\n");
264 TAILQ_INSERT_TAIL(&devopt_list, devopt, next);
269 eal_option_device_parse(void)
271 struct device_option *devopt;
275 TAILQ_FOREACH_SAFE(devopt, &devopt_list, next, tmp) {
277 ret = rte_devargs_add(devopt->type, devopt->arg);
279 RTE_LOG(ERR, EAL, "Unable to parse device '%s'\n",
282 TAILQ_REMOVE(&devopt_list, devopt, next);
289 eal_get_hugefile_prefix(void)
291 const struct internal_config *internal_conf =
292 eal_get_internal_configuration();
294 if (internal_conf->hugefile_prefix != NULL)
295 return internal_conf->hugefile_prefix;
296 return HUGEFILE_PREFIX_DEFAULT;
300 eal_reset_internal_config(struct internal_config *internal_cfg)
304 internal_cfg->memory = 0;
305 internal_cfg->force_nrank = 0;
306 internal_cfg->force_nchannel = 0;
307 internal_cfg->hugefile_prefix = NULL;
308 internal_cfg->hugepage_dir = NULL;
309 internal_cfg->force_sockets = 0;
310 /* zero out the NUMA config */
311 for (i = 0; i < RTE_MAX_NUMA_NODES; i++)
312 internal_cfg->socket_mem[i] = 0;
313 internal_cfg->force_socket_limits = 0;
314 /* zero out the NUMA limits config */
315 for (i = 0; i < RTE_MAX_NUMA_NODES; i++)
316 internal_cfg->socket_limit[i] = 0;
317 /* zero out hugedir descriptors */
318 for (i = 0; i < MAX_HUGEPAGE_SIZES; i++) {
319 memset(&internal_cfg->hugepage_info[i], 0,
320 sizeof(internal_cfg->hugepage_info[0]));
321 internal_cfg->hugepage_info[i].lock_descriptor = -1;
323 internal_cfg->base_virtaddr = 0;
326 internal_cfg->syslog_facility = LOG_DAEMON;
329 /* if set to NONE, interrupt mode is determined automatically */
330 internal_cfg->vfio_intr_mode = RTE_INTR_MODE_NONE;
332 #ifdef RTE_LIBEAL_USE_HPET
333 internal_cfg->no_hpet = 0;
335 internal_cfg->no_hpet = 1;
337 internal_cfg->vmware_tsc_map = 0;
338 internal_cfg->create_uio_dev = 0;
339 internal_cfg->iova_mode = RTE_IOVA_DC;
340 internal_cfg->user_mbuf_pool_ops_name = NULL;
341 CPU_ZERO(&internal_cfg->ctrl_cpuset);
342 internal_cfg->init_complete = 0;
346 eal_plugin_add(const char *path)
348 struct shared_driver *solib;
350 solib = malloc(sizeof(*solib));
352 RTE_LOG(ERR, EAL, "malloc(solib) failed\n");
355 memset(solib, 0, sizeof(*solib));
356 strlcpy(solib->name, path, PATH_MAX);
357 TAILQ_INSERT_TAIL(&solib_list, solib, next);
362 #ifdef RTE_EXEC_ENV_WINDOWS
364 eal_plugins_init(void)
371 eal_plugindir_init(const char *path)
374 struct dirent *dent = NULL;
375 char sopath[PATH_MAX];
377 if (path == NULL || *path == '\0')
382 RTE_LOG(ERR, EAL, "failed to open directory %s: %s\n",
383 path, strerror(errno));
387 while ((dent = readdir(d)) != NULL) {
389 int nlen = strnlen(dent->d_name, sizeof(dent->d_name));
391 /* check if name ends in .so */
392 if (strcmp(&dent->d_name[nlen - 3], ".so") != 0)
395 snprintf(sopath, sizeof(sopath), "%s/%s", path, dent->d_name);
397 /* if a regular file, add to list to load */
398 if (!(stat(sopath, &sb) == 0 && S_ISREG(sb.st_mode)))
401 if (eal_plugin_add(sopath) == -1)
406 /* XXX this ignores failures from readdir() itself */
407 return (dent == NULL) ? 0 : -1;
411 verify_perms(const char *dirpath)
415 /* if not root, check down one level first */
416 if (strcmp(dirpath, "/") != 0) {
419 strlcpy(copy, dirpath, PATH_MAX);
420 if (verify_perms(dirname(copy)) != 0)
424 /* call stat to check for permissions and ensure not world writable */
425 if (stat(dirpath, &st) != 0) {
426 RTE_LOG(ERR, EAL, "Error with stat on %s, %s\n",
427 dirpath, strerror(errno));
430 if (st.st_mode & S_IWOTH) {
432 "Error, directory path %s is world-writable and insecure\n",
441 eal_dlopen(const char *pathname)
444 char *realp = realpath(pathname, NULL);
446 if (realp == NULL && errno == ENOENT) {
447 /* not a full or relative path, try a load from system dirs */
448 retval = dlopen(pathname, RTLD_NOW);
450 RTE_LOG(ERR, EAL, "%s\n", dlerror());
454 RTE_LOG(ERR, EAL, "Error with realpath for %s, %s\n",
455 pathname, strerror(errno));
458 if (strnlen(realp, PATH_MAX) == PATH_MAX) {
459 RTE_LOG(ERR, EAL, "Error, driver path greater than PATH_MAX\n");
463 /* do permissions checks */
464 if (verify_perms(realp) != 0)
467 retval = dlopen(realp, RTLD_NOW);
469 RTE_LOG(ERR, EAL, "%s\n", dlerror());
476 eal_plugins_init(void)
478 struct shared_driver *solib = NULL;
481 if (*default_solib_dir != '\0' && stat(default_solib_dir, &sb) == 0 &&
483 eal_plugin_add(default_solib_dir);
485 TAILQ_FOREACH(solib, &solib_list, next) {
487 if (stat(solib->name, &sb) == 0 && S_ISDIR(sb.st_mode)) {
488 if (eal_plugindir_init(solib->name) == -1) {
490 "Cannot init plugin directory %s\n",
495 RTE_LOG(DEBUG, EAL, "open shared lib %s\n",
497 solib->lib_handle = eal_dlopen(solib->name);
498 if (solib->lib_handle == NULL)
508 * Parse the coremask given as argument (hexadecimal string) and fill
509 * the global configuration (core role and core count) with the parsed
512 static int xdigit2val(unsigned char c)
526 eal_parse_service_coremask(const char *coremask)
528 struct rte_config *cfg = rte_eal_get_configuration();
530 unsigned int count = 0;
533 uint32_t taken_lcore_count = 0;
535 if (coremask == NULL)
537 /* Remove all blank characters ahead and after .
538 * Remove 0x/0X if exists.
540 while (isblank(*coremask))
542 if (coremask[0] == '0' && ((coremask[1] == 'x')
543 || (coremask[1] == 'X')))
545 i = strlen(coremask);
546 while ((i > 0) && isblank(coremask[i - 1]))
552 for (i = i - 1; i >= 0 && idx < RTE_MAX_LCORE; i--) {
554 if (isxdigit(c) == 0) {
555 /* invalid characters */
559 for (j = 0; j < BITS_PER_HEX && idx < RTE_MAX_LCORE;
561 if ((1 << j) & val) {
562 /* handle master lcore already parsed */
563 uint32_t lcore = idx;
564 if (master_lcore_parsed &&
565 cfg->master_lcore == lcore) {
567 "lcore %u is master lcore, cannot use as service core\n",
572 if (eal_cpu_detected(idx) == 0) {
574 "lcore %u unavailable\n", idx);
578 if (cfg->lcore_role[idx] == ROLE_RTE)
581 lcore_config[idx].core_role = ROLE_SERVICE;
588 if (coremask[i] != '0')
591 for (; idx < RTE_MAX_LCORE; idx++)
592 lcore_config[idx].core_index = -1;
597 if (core_parsed && taken_lcore_count != count) {
598 RTE_LOG(WARNING, EAL,
599 "Not all service cores are in the coremask. "
600 "Please ensure -c or -l includes service cores\n");
603 cfg->service_lcore_count = count;
608 eal_service_cores_parsed(void)
611 for (idx = 0; idx < RTE_MAX_LCORE; idx++) {
612 if (lcore_config[idx].core_role == ROLE_SERVICE)
619 update_lcore_config(int *cores)
621 struct rte_config *cfg = rte_eal_get_configuration();
622 unsigned int count = 0;
626 for (i = 0; i < RTE_MAX_LCORE; i++) {
627 if (cores[i] != -1) {
628 if (eal_cpu_detected(i) == 0) {
629 RTE_LOG(ERR, EAL, "lcore %u unavailable\n", i);
633 cfg->lcore_role[i] = ROLE_RTE;
636 cfg->lcore_role[i] = ROLE_OFF;
638 lcore_config[i].core_index = cores[i];
641 cfg->lcore_count = count;
646 eal_parse_coremask(const char *coremask, int *cores)
653 for (idx = 0; idx < RTE_MAX_LCORE; idx++)
657 /* Remove all blank characters ahead and after .
658 * Remove 0x/0X if exists.
660 while (isblank(*coremask))
662 if (coremask[0] == '0' && ((coremask[1] == 'x')
663 || (coremask[1] == 'X')))
665 i = strlen(coremask);
666 while ((i > 0) && isblank(coremask[i - 1]))
671 for (i = i - 1; i >= 0 && idx < RTE_MAX_LCORE; i--) {
673 if (isxdigit(c) == 0) {
674 /* invalid characters */
678 for (j = 0; j < BITS_PER_HEX && idx < RTE_MAX_LCORE; j++, idx++)
680 if ((1 << j) & val) {
687 if (coremask[i] != '0')
695 eal_parse_service_corelist(const char *corelist)
697 struct rte_config *cfg = rte_eal_get_configuration();
702 uint32_t taken_lcore_count = 0;
704 if (corelist == NULL)
707 /* Remove all blank characters ahead and after */
708 while (isblank(*corelist))
710 i = strlen(corelist);
711 while ((i > 0) && isblank(corelist[i - 1]))
714 /* Get list of cores */
717 while (isblank(*corelist))
719 if (*corelist == '\0')
722 idx = strtoul(corelist, &end, 10);
723 if (errno || end == NULL)
725 while (isblank(*end))
729 } else if ((*end == ',') || (*end == '\0')) {
731 if (min == RTE_MAX_LCORE)
733 for (idx = min; idx <= max; idx++) {
734 if (cfg->lcore_role[idx] != ROLE_SERVICE) {
735 /* handle master lcore already parsed */
736 uint32_t lcore = idx;
737 if (cfg->master_lcore == lcore &&
738 master_lcore_parsed) {
740 "Error: lcore %u is master lcore, cannot use as service core\n",
744 if (cfg->lcore_role[idx] == ROLE_RTE)
747 lcore_config[idx].core_role =
756 } while (*end != '\0');
761 if (core_parsed && taken_lcore_count != count) {
762 RTE_LOG(WARNING, EAL,
763 "Not all service cores were in the coremask. "
764 "Please ensure -c or -l includes service cores\n");
771 eal_parse_corelist(const char *corelist, int *cores)
778 for (idx = 0; idx < RTE_MAX_LCORE; idx++)
781 /* Remove all blank characters ahead */
782 while (isblank(*corelist))
785 /* Get list of cores */
788 while (isblank(*corelist))
790 if (*corelist == '\0')
793 idx = strtol(corelist, &end, 10);
794 if (errno || end == NULL)
796 if (idx < 0 || idx >= RTE_MAX_LCORE)
798 while (isblank(*end))
802 } else if ((*end == ',') || (*end == '\0')) {
804 if (min == RTE_MAX_LCORE)
806 for (idx = min; idx <= max; idx++) {
807 if (cores[idx] == -1) {
816 } while (*end != '\0');
823 /* Changes the lcore id of the master thread */
825 eal_parse_master_lcore(const char *arg)
828 struct rte_config *cfg = rte_eal_get_configuration();
831 cfg->master_lcore = (uint32_t) strtol(arg, &parsing_end, 0);
832 if (errno || parsing_end[0] != 0)
834 if (cfg->master_lcore >= RTE_MAX_LCORE)
836 master_lcore_parsed = 1;
838 /* ensure master core is not used as service core */
839 if (lcore_config[cfg->master_lcore].core_role == ROLE_SERVICE) {
841 "Error: Master lcore is used as a service core\n");
849 * Parse elem, the elem could be single number/range or '(' ')' group
850 * 1) A single number elem, it's just a simple digit. e.g. 9
851 * 2) A single range elem, two digits with a '-' between. e.g. 2-6
852 * 3) A group elem, combines multiple 1) or 2) with '( )'. e.g (0,2-4,6)
853 * Within group elem, '-' used for a range separator;
854 * ',' used for a single number.
857 eal_parse_set(const char *input, rte_cpuset_t *set)
860 const char *str = input;
866 while (isblank(*str))
869 /* only digit or left bracket is qualify for start point */
870 if ((!isdigit(*str) && *str != '(') || *str == '\0')
873 /* process single number or single range of number */
876 idx = strtoul(str, &end, 10);
877 if (errno || end == NULL || idx >= CPU_SETSIZE)
880 while (isblank(*end))
886 /* process single <number>-<number> */
888 while (isblank(*end))
894 idx = strtoul(end, &end, 10);
895 if (errno || end == NULL || idx >= CPU_SETSIZE)
898 while (isblank(*end))
900 if (*end != ',' && *end != '\0')
904 if (*end != ',' && *end != '\0' &&
908 for (idx = RTE_MIN(min, max);
909 idx <= RTE_MAX(min, max); idx++)
916 /* process set within bracket */
918 while (isblank(*str))
926 /* go ahead to the first digit */
927 while (isblank(*str))
932 /* get the digit value */
934 idx = strtoul(str, &end, 10);
935 if (errno || end == NULL || idx >= CPU_SETSIZE)
938 /* go ahead to separator '-',',' and ')' */
939 while (isblank(*end))
942 if (min == RTE_MAX_LCORE)
944 else /* avoid continuous '-' */
946 } else if ((*end == ',') || (*end == ')')) {
948 if (min == RTE_MAX_LCORE)
950 for (idx = RTE_MIN(min, max);
951 idx <= RTE_MAX(min, max); idx++)
959 } while (*end != '\0' && *end != ')');
962 * to avoid failure that tail blank makes end character check fail
963 * in eal_parse_lcores( )
965 while (isblank(*str))
972 check_cpuset(rte_cpuset_t *set)
976 for (idx = 0; idx < CPU_SETSIZE; idx++) {
977 if (!CPU_ISSET(idx, set))
980 if (eal_cpu_detected(idx) == 0) {
981 RTE_LOG(ERR, EAL, "core %u "
982 "unavailable\n", idx);
990 * The format pattern: --lcores='<lcores[@cpus]>[<,lcores[@cpus]>...]'
991 * lcores, cpus could be a single digit/range or a group.
992 * '(' and ')' are necessary if it's a group.
993 * If not supply '@cpus', the value of cpus uses the same as lcores.
994 * e.g. '1,2@(5-7),(3-5)@(0,2),(0,6),7-8' means start 9 EAL thread as below
995 * lcore 0 runs on cpuset 0x41 (cpu 0,6)
996 * lcore 1 runs on cpuset 0x2 (cpu 1)
997 * lcore 2 runs on cpuset 0xe0 (cpu 5,6,7)
998 * lcore 3,4,5 runs on cpuset 0x5 (cpu 0,2)
999 * lcore 6 runs on cpuset 0x41 (cpu 0,6)
1000 * lcore 7 runs on cpuset 0x80 (cpu 7)
1001 * lcore 8 runs on cpuset 0x100 (cpu 8)
1004 eal_parse_lcores(const char *lcores)
1006 struct rte_config *cfg = rte_eal_get_configuration();
1007 rte_cpuset_t lcore_set;
1008 unsigned int set_count;
1011 const char *lcore_start = NULL;
1012 const char *end = NULL;
1014 rte_cpuset_t cpuset;
1021 /* Remove all blank characters ahead and after */
1022 while (isblank(*lcores))
1027 /* Reset lcore config */
1028 for (idx = 0; idx < RTE_MAX_LCORE; idx++) {
1029 cfg->lcore_role[idx] = ROLE_OFF;
1030 lcore_config[idx].core_index = -1;
1031 CPU_ZERO(&lcore_config[idx].cpuset);
1034 /* Get list of cores */
1036 while (isblank(*lcores))
1038 if (*lcores == '\0')
1043 /* record lcore_set start point */
1044 lcore_start = lcores;
1046 /* go across a complete bracket */
1047 if (*lcore_start == '(') {
1048 lcores += strcspn(lcores, ")");
1049 if (*lcores++ == '\0')
1053 /* scan the separator '@', ','(next) or '\0'(finish) */
1054 lcores += strcspn(lcores, "@,");
1056 if (*lcores == '@') {
1057 /* explicit assign cpuset and update the end cursor */
1058 offset = eal_parse_set(lcores + 1, &cpuset);
1061 end = lcores + 1 + offset;
1062 } else { /* ',' or '\0' */
1063 /* haven't given cpuset, current loop done */
1066 /* go back to check <number>-<number> */
1067 offset = strcspn(lcore_start, "(-");
1068 if (offset < (end - lcore_start) &&
1069 *(lcore_start + offset) != '(')
1073 if (*end != ',' && *end != '\0')
1076 /* parse lcore_set from start point */
1077 if (eal_parse_set(lcore_start, &lcore_set) < 0)
1080 /* without '@', by default using lcore_set as cpuset */
1082 rte_memcpy(&cpuset, &lcore_set, sizeof(cpuset));
1084 set_count = CPU_COUNT(&lcore_set);
1085 /* start to update lcore_set */
1086 for (idx = 0; idx < RTE_MAX_LCORE; idx++) {
1087 if (!CPU_ISSET(idx, &lcore_set))
1091 if (cfg->lcore_role[idx] != ROLE_RTE) {
1092 lcore_config[idx].core_index = count;
1093 cfg->lcore_role[idx] = ROLE_RTE;
1099 CPU_SET(idx, &cpuset);
1102 if (check_cpuset(&cpuset) < 0)
1104 rte_memcpy(&lcore_config[idx].cpuset, &cpuset,
1105 sizeof(rte_cpuset_t));
1108 /* some cores from the lcore_set can't be handled by EAL */
1113 } while (*end != '\0');
1118 cfg->lcore_count = count;
1126 #ifndef RTE_EXEC_ENV_WINDOWS
1128 eal_parse_syslog(const char *facility, struct internal_config *conf)
1131 static const struct {
1135 { "auth", LOG_AUTH },
1136 { "cron", LOG_CRON },
1137 { "daemon", LOG_DAEMON },
1139 { "kern", LOG_KERN },
1141 { "mail", LOG_MAIL },
1142 { "news", LOG_NEWS },
1143 { "syslog", LOG_SYSLOG },
1144 { "user", LOG_USER },
1145 { "uucp", LOG_UUCP },
1146 { "local0", LOG_LOCAL0 },
1147 { "local1", LOG_LOCAL1 },
1148 { "local2", LOG_LOCAL2 },
1149 { "local3", LOG_LOCAL3 },
1150 { "local4", LOG_LOCAL4 },
1151 { "local5", LOG_LOCAL5 },
1152 { "local6", LOG_LOCAL6 },
1153 { "local7", LOG_LOCAL7 },
1157 for (i = 0; map[i].name; i++) {
1158 if (!strcmp(facility, map[i].name)) {
1159 conf->syslog_facility = map[i].value;
1168 eal_parse_log_priority(const char *level)
1170 static const char * const levels[] = {
1171 [RTE_LOG_EMERG] = "emergency",
1172 [RTE_LOG_ALERT] = "alert",
1173 [RTE_LOG_CRIT] = "critical",
1174 [RTE_LOG_ERR] = "error",
1175 [RTE_LOG_WARNING] = "warning",
1176 [RTE_LOG_NOTICE] = "notice",
1177 [RTE_LOG_INFO] = "info",
1178 [RTE_LOG_DEBUG] = "debug",
1180 size_t len = strlen(level);
1188 /* look for named values, skip 0 which is not a valid level */
1189 for (i = 1; i < RTE_DIM(levels); i++) {
1190 if (strncmp(levels[i], level, len) == 0)
1194 /* not a string, maybe it is numeric */
1196 tmp = strtoul(level, &end, 0);
1198 /* check for errors */
1199 if (errno != 0 || end == NULL || *end != '\0' ||
1207 eal_parse_log_level(const char *arg)
1209 const char *pattern = NULL;
1210 const char *regex = NULL;
1218 if ((level = strchr(str, ','))) {
1221 } else if ((level = strchr(str, ':'))) {
1228 priority = eal_parse_log_priority(level);
1230 fprintf(stderr, "invalid log priority: %s\n", level);
1235 if (rte_log_set_level_regexp(regex, priority) < 0) {
1236 fprintf(stderr, "cannot set log level %s,%d\n",
1240 if (rte_log_save_regexp(regex, priority) < 0)
1242 } else if (pattern) {
1243 if (rte_log_set_level_pattern(pattern, priority) < 0) {
1244 fprintf(stderr, "cannot set log level %s:%d\n",
1248 if (rte_log_save_pattern(pattern, priority) < 0)
1251 rte_log_set_global_level(priority);
1262 static enum rte_proc_type_t
1263 eal_parse_proc_type(const char *arg)
1265 if (strncasecmp(arg, "primary", sizeof("primary")) == 0)
1266 return RTE_PROC_PRIMARY;
1267 if (strncasecmp(arg, "secondary", sizeof("secondary")) == 0)
1268 return RTE_PROC_SECONDARY;
1269 if (strncasecmp(arg, "auto", sizeof("auto")) == 0)
1270 return RTE_PROC_AUTO;
1272 return RTE_PROC_INVALID;
1276 eal_parse_iova_mode(const char *name)
1279 struct internal_config *internal_conf =
1280 eal_get_internal_configuration();
1285 if (!strcmp("pa", name))
1287 else if (!strcmp("va", name))
1292 internal_conf->iova_mode = mode;
1297 eal_parse_base_virtaddr(const char *arg)
1301 struct internal_config *internal_conf =
1302 eal_get_internal_configuration();
1305 addr = strtoull(arg, &end, 16);
1307 /* check for errors */
1308 if ((errno != 0) || (arg[0] == '\0') || end == NULL || (*end != '\0'))
1311 /* make sure we don't exceed 32-bit boundary on 32-bit target */
1313 if (addr >= UINTPTR_MAX)
1317 /* align the addr on 16M boundary, 16MB is the minimum huge page
1318 * size on IBM Power architecture. If the addr is aligned to 16MB,
1319 * it can align to 2MB for x86. So this alignment can also be used
1320 * on x86 and other architectures.
1322 internal_conf->base_virtaddr =
1323 RTE_PTR_ALIGN_CEIL((uintptr_t)addr, (size_t)RTE_PGSIZE_16M);
1328 /* caller is responsible for freeing the returned string */
1330 available_cores(void)
1338 /* find the first available cpu */
1339 for (idx = 0; idx < RTE_MAX_LCORE; idx++) {
1340 if (eal_cpu_detected(idx) == 0)
1344 if (idx >= RTE_MAX_LCORE)
1347 /* first sequence */
1348 if (asprintf(&str, "%d", idx) < 0)
1353 for (idx++ ; idx < RTE_MAX_LCORE; idx++) {
1354 if (eal_cpu_detected(idx) == 0)
1357 if (idx == previous + 1) {
1363 /* finish current sequence */
1365 if (asprintf(&tmp, "%s-%d", str, previous) < 0) {
1374 if (asprintf(&tmp, "%s,%d", str, idx) < 0) {
1384 /* finish last sequence */
1386 if (asprintf(&tmp, "%s-%d", str, previous) < 0) {
1398 eal_parse_common_option(int opt, const char *optarg,
1399 struct internal_config *conf)
1409 if (eal_option_device_add(RTE_DEVTYPE_BLACKLISTED_PCI,
1419 if (eal_option_device_add(RTE_DEVTYPE_WHITELISTED_PCI,
1427 int lcore_indexes[RTE_MAX_LCORE];
1429 if (eal_service_cores_parsed())
1430 RTE_LOG(WARNING, EAL,
1431 "Service cores parsed before dataplane cores. Please ensure -c is before -s or -S\n");
1432 if (eal_parse_coremask(optarg, lcore_indexes) < 0) {
1433 RTE_LOG(ERR, EAL, "invalid coremask syntax\n");
1436 if (update_lcore_config(lcore_indexes) < 0) {
1437 char *available = available_cores();
1440 "invalid coremask, please check specified cores are part of %s\n",
1447 RTE_LOG(ERR, EAL, "Option -c is ignored, because (%s) is set!\n",
1448 (core_parsed == LCORE_OPT_LST) ? "-l" :
1449 (core_parsed == LCORE_OPT_MAP) ? "--lcore" :
1454 core_parsed = LCORE_OPT_MSK;
1459 int lcore_indexes[RTE_MAX_LCORE];
1461 if (eal_service_cores_parsed())
1462 RTE_LOG(WARNING, EAL,
1463 "Service cores parsed before dataplane cores. Please ensure -l is before -s or -S\n");
1465 if (eal_parse_corelist(optarg, lcore_indexes) < 0) {
1466 RTE_LOG(ERR, EAL, "invalid core list syntax\n");
1469 if (update_lcore_config(lcore_indexes) < 0) {
1470 char *available = available_cores();
1473 "invalid core list, please check specified cores are part of %s\n",
1480 RTE_LOG(ERR, EAL, "Option -l is ignored, because (%s) is set!\n",
1481 (core_parsed == LCORE_OPT_MSK) ? "-c" :
1482 (core_parsed == LCORE_OPT_MAP) ? "--lcore" :
1487 core_parsed = LCORE_OPT_LST;
1490 /* service coremask */
1492 if (eal_parse_service_coremask(optarg) < 0) {
1493 RTE_LOG(ERR, EAL, "invalid service coremask\n");
1497 /* service corelist */
1499 if (eal_parse_service_corelist(optarg) < 0) {
1500 RTE_LOG(ERR, EAL, "invalid service core list\n");
1504 /* size of memory */
1506 conf->memory = atoi(optarg);
1507 conf->memory *= 1024ULL;
1508 conf->memory *= 1024ULL;
1511 /* force number of channels */
1513 conf->force_nchannel = atoi(optarg);
1514 if (conf->force_nchannel == 0) {
1515 RTE_LOG(ERR, EAL, "invalid channel number\n");
1519 /* force number of ranks */
1521 conf->force_nrank = atoi(optarg);
1522 if (conf->force_nrank == 0 ||
1523 conf->force_nrank > 16) {
1524 RTE_LOG(ERR, EAL, "invalid rank number\n");
1528 /* force loading of external driver */
1530 if (eal_plugin_add(optarg) == -1)
1534 /* since message is explicitly requested by user, we
1535 * write message at highest log level so it can always
1537 * even if info or warning messages are disabled */
1538 RTE_LOG(CRIT, EAL, "RTE Version: '%s'\n", rte_version());
1542 case OPT_HUGE_UNLINK_NUM:
1543 conf->hugepage_unlink = 1;
1546 case OPT_NO_HUGE_NUM:
1547 conf->no_hugetlbfs = 1;
1548 /* no-huge is legacy mem */
1549 conf->legacy_mem = 1;
1552 case OPT_NO_PCI_NUM:
1556 case OPT_NO_HPET_NUM:
1560 case OPT_VMWARE_TSC_MAP_NUM:
1561 conf->vmware_tsc_map = 1;
1564 case OPT_NO_SHCONF_NUM:
1565 conf->no_shconf = 1;
1568 case OPT_IN_MEMORY_NUM:
1569 conf->in_memory = 1;
1570 /* in-memory is a superset of noshconf and huge-unlink */
1571 conf->no_shconf = 1;
1572 conf->hugepage_unlink = 1;
1575 case OPT_PROC_TYPE_NUM:
1576 conf->process_type = eal_parse_proc_type(optarg);
1579 case OPT_MASTER_LCORE_NUM:
1580 if (eal_parse_master_lcore(optarg) < 0) {
1581 RTE_LOG(ERR, EAL, "invalid parameter for --"
1582 OPT_MASTER_LCORE "\n");
1588 if (eal_option_device_add(RTE_DEVTYPE_VIRTUAL,
1594 #ifndef RTE_EXEC_ENV_WINDOWS
1595 case OPT_SYSLOG_NUM:
1596 if (eal_parse_syslog(optarg, conf) < 0) {
1597 RTE_LOG(ERR, EAL, "invalid parameters for --"
1604 case OPT_LOG_LEVEL_NUM: {
1605 if (eal_parse_log_level(optarg) < 0) {
1607 "invalid parameters for --"
1608 OPT_LOG_LEVEL "\n");
1614 #ifndef RTE_EXEC_ENV_WINDOWS
1615 case OPT_TRACE_NUM: {
1616 if (eal_trace_args_save(optarg) < 0) {
1617 RTE_LOG(ERR, EAL, "invalid parameters for --"
1624 case OPT_TRACE_DIR_NUM: {
1625 if (eal_trace_dir_args_save(optarg) < 0) {
1626 RTE_LOG(ERR, EAL, "invalid parameters for --"
1627 OPT_TRACE_DIR "\n");
1633 case OPT_TRACE_BUF_SIZE_NUM: {
1634 if (eal_trace_bufsz_args_save(optarg) < 0) {
1635 RTE_LOG(ERR, EAL, "invalid parameters for --"
1636 OPT_TRACE_BUF_SIZE "\n");
1642 case OPT_TRACE_MODE_NUM: {
1643 if (eal_trace_mode_args_save(optarg) < 0) {
1644 RTE_LOG(ERR, EAL, "invalid parameters for --"
1645 OPT_TRACE_MODE "\n");
1650 #endif /* !RTE_EXEC_ENV_WINDOWS */
1652 case OPT_LCORES_NUM:
1653 if (eal_parse_lcores(optarg) < 0) {
1654 RTE_LOG(ERR, EAL, "invalid parameter for --"
1660 RTE_LOG(ERR, EAL, "Option --lcore is ignored, because (%s) is set!\n",
1661 (core_parsed == LCORE_OPT_LST) ? "-l" :
1662 (core_parsed == LCORE_OPT_MSK) ? "-c" :
1667 core_parsed = LCORE_OPT_MAP;
1669 case OPT_LEGACY_MEM_NUM:
1670 conf->legacy_mem = 1;
1672 case OPT_SINGLE_FILE_SEGMENTS_NUM:
1673 conf->single_file_segments = 1;
1675 case OPT_IOVA_MODE_NUM:
1676 if (eal_parse_iova_mode(optarg) < 0) {
1677 RTE_LOG(ERR, EAL, "invalid parameters for --"
1678 OPT_IOVA_MODE "\n");
1682 case OPT_BASE_VIRTADDR_NUM:
1683 if (eal_parse_base_virtaddr(optarg) < 0) {
1684 RTE_LOG(ERR, EAL, "invalid parameter for --"
1685 OPT_BASE_VIRTADDR "\n");
1689 case OPT_TELEMETRY_NUM:
1691 case OPT_NO_TELEMETRY_NUM:
1692 conf->no_telemetry = 1;
1695 /* don't know what to do, leave this to caller */
1703 RTE_LOG(ERR, EAL, "Options blacklist (-b) and whitelist (-w) "
1704 "cannot be used at the same time\n");
1709 eal_auto_detect_cores(struct rte_config *cfg)
1711 unsigned int lcore_id;
1712 unsigned int removed = 0;
1713 rte_cpuset_t affinity_set;
1715 if (pthread_getaffinity_np(pthread_self(), sizeof(rte_cpuset_t),
1717 CPU_ZERO(&affinity_set);
1719 for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {
1720 if (cfg->lcore_role[lcore_id] == ROLE_RTE &&
1721 !CPU_ISSET(lcore_id, &affinity_set)) {
1722 cfg->lcore_role[lcore_id] = ROLE_OFF;
1727 cfg->lcore_count -= removed;
1731 compute_ctrl_threads_cpuset(struct internal_config *internal_cfg)
1733 rte_cpuset_t *cpuset = &internal_cfg->ctrl_cpuset;
1734 rte_cpuset_t default_set;
1735 unsigned int lcore_id;
1737 for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {
1738 if (rte_lcore_has_role(lcore_id, ROLE_OFF))
1740 RTE_CPU_OR(cpuset, cpuset, &lcore_config[lcore_id].cpuset);
1742 RTE_CPU_NOT(cpuset, cpuset);
1744 if (pthread_getaffinity_np(pthread_self(), sizeof(rte_cpuset_t),
1746 CPU_ZERO(&default_set);
1748 RTE_CPU_AND(cpuset, cpuset, &default_set);
1750 /* if no remaining cpu, use master lcore cpu affinity */
1751 if (!CPU_COUNT(cpuset)) {
1752 memcpy(cpuset, &lcore_config[rte_get_master_lcore()].cpuset,
1758 eal_cleanup_config(struct internal_config *internal_cfg)
1760 if (internal_cfg->hugefile_prefix != NULL)
1761 free(internal_cfg->hugefile_prefix);
1762 if (internal_cfg->hugepage_dir != NULL)
1763 free(internal_cfg->hugepage_dir);
1764 if (internal_cfg->user_mbuf_pool_ops_name != NULL)
1765 free(internal_cfg->user_mbuf_pool_ops_name);
1771 eal_adjust_config(struct internal_config *internal_cfg)
1774 struct rte_config *cfg = rte_eal_get_configuration();
1775 struct internal_config *internal_conf =
1776 eal_get_internal_configuration();
1779 eal_auto_detect_cores(cfg);
1781 if (internal_conf->process_type == RTE_PROC_AUTO)
1782 internal_conf->process_type = eal_proc_type_detect();
1784 /* default master lcore is the first one */
1785 if (!master_lcore_parsed) {
1786 cfg->master_lcore = rte_get_next_lcore(-1, 0, 0);
1787 if (cfg->master_lcore >= RTE_MAX_LCORE)
1789 lcore_config[cfg->master_lcore].core_role = ROLE_RTE;
1792 compute_ctrl_threads_cpuset(internal_cfg);
1794 /* if no memory amounts were requested, this will result in 0 and
1795 * will be overridden later, right after eal_hugepage_info_init() */
1796 for (i = 0; i < RTE_MAX_NUMA_NODES; i++)
1797 internal_cfg->memory += internal_cfg->socket_mem[i];
1803 eal_check_common_options(struct internal_config *internal_cfg)
1805 struct rte_config *cfg = rte_eal_get_configuration();
1806 const struct internal_config *internal_conf =
1807 eal_get_internal_configuration();
1809 if (cfg->lcore_role[cfg->master_lcore] != ROLE_RTE) {
1810 RTE_LOG(ERR, EAL, "Master lcore is not enabled for DPDK\n");
1814 if (internal_cfg->process_type == RTE_PROC_INVALID) {
1815 RTE_LOG(ERR, EAL, "Invalid process type specified\n");
1818 if (internal_cfg->hugefile_prefix != NULL &&
1819 strlen(internal_cfg->hugefile_prefix) < 1) {
1820 RTE_LOG(ERR, EAL, "Invalid length of --" OPT_FILE_PREFIX " option\n");
1823 if (internal_cfg->hugepage_dir != NULL &&
1824 strlen(internal_cfg->hugepage_dir) < 1) {
1825 RTE_LOG(ERR, EAL, "Invalid length of --" OPT_HUGE_DIR" option\n");
1828 if (internal_cfg->user_mbuf_pool_ops_name != NULL &&
1829 strlen(internal_cfg->user_mbuf_pool_ops_name) < 1) {
1830 RTE_LOG(ERR, EAL, "Invalid length of --" OPT_MBUF_POOL_OPS_NAME" option\n");
1833 if (index(eal_get_hugefile_prefix(), '%') != NULL) {
1834 RTE_LOG(ERR, EAL, "Invalid char, '%%', in --"OPT_FILE_PREFIX" "
1838 if (mem_parsed && internal_cfg->force_sockets == 1) {
1839 RTE_LOG(ERR, EAL, "Options -m and --"OPT_SOCKET_MEM" cannot "
1840 "be specified at the same time\n");
1843 if (internal_cfg->no_hugetlbfs && internal_cfg->force_sockets == 1) {
1844 RTE_LOG(ERR, EAL, "Option --"OPT_SOCKET_MEM" cannot "
1845 "be specified together with --"OPT_NO_HUGE"\n");
1848 if (internal_cfg->no_hugetlbfs && internal_cfg->hugepage_unlink &&
1849 !internal_cfg->in_memory) {
1850 RTE_LOG(ERR, EAL, "Option --"OPT_HUGE_UNLINK" cannot "
1851 "be specified together with --"OPT_NO_HUGE"\n");
1854 if (internal_conf->force_socket_limits && internal_conf->legacy_mem) {
1855 RTE_LOG(ERR, EAL, "Option --"OPT_SOCKET_LIMIT
1856 " is only supported in non-legacy memory mode\n");
1858 if (internal_cfg->single_file_segments &&
1859 internal_cfg->hugepage_unlink &&
1860 !internal_cfg->in_memory) {
1861 RTE_LOG(ERR, EAL, "Option --"OPT_SINGLE_FILE_SEGMENTS" is "
1862 "not compatible with --"OPT_HUGE_UNLINK"\n");
1865 if (internal_cfg->legacy_mem &&
1866 internal_cfg->in_memory) {
1867 RTE_LOG(ERR, EAL, "Option --"OPT_LEGACY_MEM" is not compatible "
1868 "with --"OPT_IN_MEMORY"\n");
1871 if (internal_cfg->legacy_mem && internal_cfg->match_allocations) {
1872 RTE_LOG(ERR, EAL, "Option --"OPT_LEGACY_MEM" is not compatible "
1873 "with --"OPT_MATCH_ALLOCATIONS"\n");
1876 if (internal_cfg->no_hugetlbfs && internal_cfg->match_allocations) {
1877 RTE_LOG(ERR, EAL, "Option --"OPT_NO_HUGE" is not compatible "
1878 "with --"OPT_MATCH_ALLOCATIONS"\n");
1881 if (internal_cfg->legacy_mem && internal_cfg->memory == 0) {
1882 RTE_LOG(NOTICE, EAL, "Static memory layout is selected, "
1883 "amount of reserved memory can be adjusted with "
1884 "-m or --"OPT_SOCKET_MEM"\n");
1891 eal_common_usage(void)
1893 printf("[options]\n\n"
1894 "EAL common options:\n"
1895 " -c COREMASK Hexadecimal bitmask of cores to run on\n"
1896 " -l CORELIST List of cores to run on\n"
1897 " The argument format is <c1>[-c2][,c3[-c4],...]\n"
1898 " where c1, c2, etc are core indexes between 0 and %d\n"
1899 " --"OPT_LCORES" COREMAP Map lcore set to physical cpu set\n"
1900 " The argument format is\n"
1901 " '<lcores[@cpus]>[<,lcores[@cpus]>...]'\n"
1902 " lcores and cpus list are grouped by '(' and ')'\n"
1903 " Within the group, '-' is used for range separator,\n"
1904 " ',' is used for single number separator.\n"
1905 " '( )' can be omitted for single element group,\n"
1906 " '@' can be omitted if cpus and lcores have the same value\n"
1907 " -s SERVICE COREMASK Hexadecimal bitmask of cores to be used as service cores\n"
1908 " --"OPT_MASTER_LCORE" ID Core ID that is used as master\n"
1909 " --"OPT_MBUF_POOL_OPS_NAME" Pool ops name for mbuf to use\n"
1910 " -n CHANNELS Number of memory channels\n"
1911 " -m MB Memory to allocate (see also --"OPT_SOCKET_MEM")\n"
1912 " -r RANKS Force number of memory ranks (don't detect)\n"
1913 " -b, --"OPT_PCI_BLACKLIST" Add a PCI device in black list.\n"
1914 " Prevent EAL from using this PCI device. The argument\n"
1915 " format is <domain:bus:devid.func>.\n"
1916 " -w, --"OPT_PCI_WHITELIST" Add a PCI device in white list.\n"
1917 " Only use the specified PCI devices. The argument format\n"
1918 " is <[domain:]bus:devid.func>. This option can be present\n"
1919 " several times (once per device).\n"
1920 " [NOTE: PCI whitelist cannot be used with -b option]\n"
1921 " --"OPT_VDEV" Add a virtual device.\n"
1922 " The argument format is <driver><id>[,key=val,...]\n"
1923 " (ex: --vdev=net_pcap0,iface=eth2).\n"
1924 " --"OPT_IOVA_MODE" Set IOVA mode. 'pa' for IOVA_PA\n"
1925 " 'va' for IOVA_VA\n"
1926 " -d LIB.so|DIR Add a driver or driver directory\n"
1927 " (can be used multiple times)\n"
1928 " --"OPT_VMWARE_TSC_MAP" Use VMware TSC map instead of native RDTSC\n"
1929 " --"OPT_PROC_TYPE" Type of this process (primary|secondary|auto)\n"
1930 #ifndef RTE_EXEC_ENV_WINDOWS
1931 " --"OPT_SYSLOG" Set syslog facility\n"
1933 " --"OPT_LOG_LEVEL"=<int> Set global log level\n"
1934 " --"OPT_LOG_LEVEL"=<type-match>:<int>\n"
1935 " Set specific log level\n"
1936 #ifndef RTE_EXEC_ENV_WINDOWS
1937 " --"OPT_TRACE"=<regex-match>\n"
1938 " Enable trace based on regular expression trace name.\n"
1939 " By default, the trace is disabled.\n"
1940 " User must specify this option to enable trace.\n"
1941 " --"OPT_TRACE_DIR"=<directory path>\n"
1942 " Specify trace directory for trace output.\n"
1943 " By default, trace output will created at\n"
1944 " $HOME directory and parameter must be\n"
1945 " specified once only.\n"
1946 " --"OPT_TRACE_BUF_SIZE"=<int>\n"
1947 " Specify maximum size of allocated memory\n"
1948 " for trace output for each thread. Valid\n"
1949 " unit can be either 'B|K|M' for 'Bytes',\n"
1950 " 'KBytes' and 'MBytes' respectively.\n"
1951 " Default is 1MB and parameter must be\n"
1952 " specified once only.\n"
1953 " --"OPT_TRACE_MODE"=<o[verwrite] | d[iscard]>\n"
1954 " Specify the mode of update of trace\n"
1955 " output file. Either update on a file can\n"
1956 " be wrapped or discarded when file size\n"
1957 " reaches its maximum limit.\n"
1958 " Default mode is 'overwrite' and parameter\n"
1959 " must be specified once only.\n"
1960 #endif /* !RTE_EXEC_ENV_WINDOWS */
1961 " -v Display version information on startup\n"
1962 " -h, --help This help\n"
1963 " --"OPT_IN_MEMORY" Operate entirely in memory. This will\n"
1964 " disable secondary process support\n"
1965 " --"OPT_BASE_VIRTADDR" Base virtual address\n"
1966 " --"OPT_TELEMETRY" Enable telemetry support (on by default)\n"
1967 " --"OPT_NO_TELEMETRY" Disable telemetry support\n"
1968 "\nEAL options for DEBUG use only:\n"
1969 " --"OPT_HUGE_UNLINK" Unlink hugepage files after init\n"
1970 " --"OPT_NO_HUGE" Use malloc instead of hugetlbfs\n"
1971 " --"OPT_NO_PCI" Disable PCI\n"
1972 " --"OPT_NO_HPET" Disable HPET\n"
1973 " --"OPT_NO_SHCONF" No shared config (mmap'd files)\n"
1974 "\n", RTE_MAX_LCORE);