eal: do not create runtime dir in --no-shconf mode
[dpdk.git] / lib / librte_eal / common / eal_common_options.c
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2010-2014 Intel Corporation.
3  * Copyright(c) 2014 6WIND S.A.
4  */
5
6 #include <stdlib.h>
7 #include <unistd.h>
8 #include <string.h>
9 #include <syslog.h>
10 #include <ctype.h>
11 #include <limits.h>
12 #include <errno.h>
13 #include <getopt.h>
14 #include <dlfcn.h>
15 #include <sys/types.h>
16 #include <sys/stat.h>
17 #include <dirent.h>
18
19 #include <rte_eal.h>
20 #include <rte_log.h>
21 #include <rte_lcore.h>
22 #include <rte_tailq.h>
23 #include <rte_version.h>
24 #include <rte_devargs.h>
25 #include <rte_memcpy.h>
26
27 #include "eal_internal_cfg.h"
28 #include "eal_options.h"
29 #include "eal_filesystem.h"
30 #include "eal_private.h"
31
32 #define BITS_PER_HEX 4
33 #define LCORE_OPT_LST 1
34 #define LCORE_OPT_MSK 2
35 #define LCORE_OPT_MAP 3
36
37 const char
38 eal_short_options[] =
39         "b:" /* pci-blacklist */
40         "c:" /* coremask */
41         "s:" /* service coremask */
42         "d:" /* driver */
43         "h"  /* help */
44         "l:" /* corelist */
45         "S:" /* service corelist */
46         "m:" /* memory size */
47         "n:" /* memory channels */
48         "r:" /* memory ranks */
49         "v"  /* version */
50         "w:" /* pci-whitelist */
51         ;
52
53 const struct option
54 eal_long_options[] = {
55         {OPT_BASE_VIRTADDR,     1, NULL, OPT_BASE_VIRTADDR_NUM    },
56         {OPT_CREATE_UIO_DEV,    0, NULL, OPT_CREATE_UIO_DEV_NUM   },
57         {OPT_FILE_PREFIX,       1, NULL, OPT_FILE_PREFIX_NUM      },
58         {OPT_HELP,              0, NULL, OPT_HELP_NUM             },
59         {OPT_HUGE_DIR,          1, NULL, OPT_HUGE_DIR_NUM         },
60         {OPT_HUGE_UNLINK,       0, NULL, OPT_HUGE_UNLINK_NUM      },
61         {OPT_LCORES,            1, NULL, OPT_LCORES_NUM           },
62         {OPT_LOG_LEVEL,         1, NULL, OPT_LOG_LEVEL_NUM        },
63         {OPT_MASTER_LCORE,      1, NULL, OPT_MASTER_LCORE_NUM     },
64         {OPT_MBUF_POOL_OPS_NAME, 1, NULL, OPT_MBUF_POOL_OPS_NAME_NUM},
65         {OPT_NO_HPET,           0, NULL, OPT_NO_HPET_NUM          },
66         {OPT_NO_HUGE,           0, NULL, OPT_NO_HUGE_NUM          },
67         {OPT_NO_PCI,            0, NULL, OPT_NO_PCI_NUM           },
68         {OPT_NO_SHCONF,         0, NULL, OPT_NO_SHCONF_NUM        },
69         {OPT_PCI_BLACKLIST,     1, NULL, OPT_PCI_BLACKLIST_NUM    },
70         {OPT_PCI_WHITELIST,     1, NULL, OPT_PCI_WHITELIST_NUM    },
71         {OPT_PROC_TYPE,         1, NULL, OPT_PROC_TYPE_NUM        },
72         {OPT_SOCKET_MEM,        1, NULL, OPT_SOCKET_MEM_NUM       },
73         {OPT_SOCKET_LIMIT,      1, NULL, OPT_SOCKET_LIMIT_NUM     },
74         {OPT_SYSLOG,            1, NULL, OPT_SYSLOG_NUM           },
75         {OPT_VDEV,              1, NULL, OPT_VDEV_NUM             },
76         {OPT_VFIO_INTR,         1, NULL, OPT_VFIO_INTR_NUM        },
77         {OPT_VMWARE_TSC_MAP,    0, NULL, OPT_VMWARE_TSC_MAP_NUM   },
78         {OPT_LEGACY_MEM,        0, NULL, OPT_LEGACY_MEM_NUM       },
79         {OPT_SINGLE_FILE_SEGMENTS, 0, NULL, OPT_SINGLE_FILE_SEGMENTS_NUM},
80         {0,                     0, NULL, 0                        }
81 };
82
83 TAILQ_HEAD(shared_driver_list, shared_driver);
84
85 /* Definition for shared object drivers. */
86 struct shared_driver {
87         TAILQ_ENTRY(shared_driver) next;
88
89         char    name[PATH_MAX];
90         void*   lib_handle;
91 };
92
93 /* List of external loadable drivers */
94 static struct shared_driver_list solib_list =
95 TAILQ_HEAD_INITIALIZER(solib_list);
96
97 /* Default path of external loadable drivers */
98 static const char *default_solib_dir = RTE_EAL_PMD_PATH;
99
100 /*
101  * Stringified version of solib path used by dpdk-pmdinfo.py
102  * Note: PLEASE DO NOT ALTER THIS without making a corresponding
103  * change to usertools/dpdk-pmdinfo.py
104  */
105 static const char dpdk_solib_path[] __attribute__((used)) =
106 "DPDK_PLUGIN_PATH=" RTE_EAL_PMD_PATH;
107
108 TAILQ_HEAD(device_option_list, device_option);
109
110 struct device_option {
111         TAILQ_ENTRY(device_option) next;
112
113         enum rte_devtype type;
114         char arg[];
115 };
116
117 static struct device_option_list devopt_list =
118 TAILQ_HEAD_INITIALIZER(devopt_list);
119
120 static int master_lcore_parsed;
121 static int mem_parsed;
122 static int core_parsed;
123
124 static int
125 eal_option_device_add(enum rte_devtype type, const char *optarg)
126 {
127         struct device_option *devopt;
128         size_t optlen;
129         int ret;
130
131         optlen = strlen(optarg) + 1;
132         devopt = calloc(1, sizeof(*devopt) + optlen);
133         if (devopt == NULL) {
134                 RTE_LOG(ERR, EAL, "Unable to allocate device option\n");
135                 return -ENOMEM;
136         }
137
138         devopt->type = type;
139         ret = snprintf(devopt->arg, optlen, "%s", optarg);
140         if (ret < 0) {
141                 RTE_LOG(ERR, EAL, "Unable to copy device option\n");
142                 free(devopt);
143                 return -EINVAL;
144         }
145         TAILQ_INSERT_TAIL(&devopt_list, devopt, next);
146         return 0;
147 }
148
149 int
150 eal_option_device_parse(void)
151 {
152         struct device_option *devopt;
153         void *tmp;
154         int ret = 0;
155
156         TAILQ_FOREACH_SAFE(devopt, &devopt_list, next, tmp) {
157                 if (ret == 0) {
158                         ret = rte_devargs_add(devopt->type, devopt->arg);
159                         if (ret)
160                                 RTE_LOG(ERR, EAL, "Unable to parse device '%s'\n",
161                                         devopt->arg);
162                 }
163                 TAILQ_REMOVE(&devopt_list, devopt, next);
164                 free(devopt);
165         }
166         return ret;
167 }
168
169 void
170 eal_reset_internal_config(struct internal_config *internal_cfg)
171 {
172         int i;
173
174         internal_cfg->memory = 0;
175         internal_cfg->force_nrank = 0;
176         internal_cfg->force_nchannel = 0;
177         internal_cfg->hugefile_prefix = HUGEFILE_PREFIX_DEFAULT;
178         internal_cfg->hugepage_dir = NULL;
179         internal_cfg->force_sockets = 0;
180         /* zero out the NUMA config */
181         for (i = 0; i < RTE_MAX_NUMA_NODES; i++)
182                 internal_cfg->socket_mem[i] = 0;
183         internal_cfg->force_socket_limits = 0;
184         /* zero out the NUMA limits config */
185         for (i = 0; i < RTE_MAX_NUMA_NODES; i++)
186                 internal_cfg->socket_limit[i] = 0;
187         /* zero out hugedir descriptors */
188         for (i = 0; i < MAX_HUGEPAGE_SIZES; i++) {
189                 memset(&internal_cfg->hugepage_info[i], 0,
190                                 sizeof(internal_cfg->hugepage_info[0]));
191                 internal_cfg->hugepage_info[i].lock_descriptor = -1;
192         }
193         internal_cfg->base_virtaddr = 0;
194
195         internal_cfg->syslog_facility = LOG_DAEMON;
196
197         /* if set to NONE, interrupt mode is determined automatically */
198         internal_cfg->vfio_intr_mode = RTE_INTR_MODE_NONE;
199
200 #ifdef RTE_LIBEAL_USE_HPET
201         internal_cfg->no_hpet = 0;
202 #else
203         internal_cfg->no_hpet = 1;
204 #endif
205         internal_cfg->vmware_tsc_map = 0;
206         internal_cfg->create_uio_dev = 0;
207         internal_cfg->user_mbuf_pool_ops_name = NULL;
208         internal_cfg->init_complete = 0;
209 }
210
211 static int
212 eal_plugin_add(const char *path)
213 {
214         struct shared_driver *solib;
215
216         solib = malloc(sizeof(*solib));
217         if (solib == NULL) {
218                 RTE_LOG(ERR, EAL, "malloc(solib) failed\n");
219                 return -1;
220         }
221         memset(solib, 0, sizeof(*solib));
222         strncpy(solib->name, path, PATH_MAX-1);
223         solib->name[PATH_MAX-1] = 0;
224         TAILQ_INSERT_TAIL(&solib_list, solib, next);
225
226         return 0;
227 }
228
229 static int
230 eal_plugindir_init(const char *path)
231 {
232         DIR *d = NULL;
233         struct dirent *dent = NULL;
234         char sopath[PATH_MAX];
235
236         if (path == NULL || *path == '\0')
237                 return 0;
238
239         d = opendir(path);
240         if (d == NULL) {
241                 RTE_LOG(ERR, EAL, "failed to open directory %s: %s\n",
242                         path, strerror(errno));
243                 return -1;
244         }
245
246         while ((dent = readdir(d)) != NULL) {
247                 struct stat sb;
248
249                 snprintf(sopath, PATH_MAX-1, "%s/%s", path, dent->d_name);
250                 sopath[PATH_MAX-1] = 0;
251
252                 if (!(stat(sopath, &sb) == 0 && S_ISREG(sb.st_mode)))
253                         continue;
254
255                 if (eal_plugin_add(sopath) == -1)
256                         break;
257         }
258
259         closedir(d);
260         /* XXX this ignores failures from readdir() itself */
261         return (dent == NULL) ? 0 : -1;
262 }
263
264 int
265 eal_plugins_init(void)
266 {
267         struct shared_driver *solib = NULL;
268         struct stat sb;
269
270         if (*default_solib_dir != '\0' && stat(default_solib_dir, &sb) == 0 &&
271                                 S_ISDIR(sb.st_mode))
272                 eal_plugin_add(default_solib_dir);
273
274         TAILQ_FOREACH(solib, &solib_list, next) {
275
276                 if (stat(solib->name, &sb) == 0 && S_ISDIR(sb.st_mode)) {
277                         if (eal_plugindir_init(solib->name) == -1) {
278                                 RTE_LOG(ERR, EAL,
279                                         "Cannot init plugin directory %s\n",
280                                         solib->name);
281                                 return -1;
282                         }
283                 } else {
284                         RTE_LOG(DEBUG, EAL, "open shared lib %s\n",
285                                 solib->name);
286                         solib->lib_handle = dlopen(solib->name, RTLD_NOW);
287                         if (solib->lib_handle == NULL) {
288                                 RTE_LOG(ERR, EAL, "%s\n", dlerror());
289                                 return -1;
290                         }
291                 }
292
293         }
294         return 0;
295 }
296
297 /*
298  * Parse the coremask given as argument (hexadecimal string) and fill
299  * the global configuration (core role and core count) with the parsed
300  * value.
301  */
302 static int xdigit2val(unsigned char c)
303 {
304         int val;
305
306         if (isdigit(c))
307                 val = c - '0';
308         else if (isupper(c))
309                 val = c - 'A' + 10;
310         else
311                 val = c - 'a' + 10;
312         return val;
313 }
314
315 static int
316 eal_parse_service_coremask(const char *coremask)
317 {
318         struct rte_config *cfg = rte_eal_get_configuration();
319         int i, j, idx = 0;
320         unsigned int count = 0;
321         char c;
322         int val;
323
324         if (coremask == NULL)
325                 return -1;
326         /* Remove all blank characters ahead and after .
327          * Remove 0x/0X if exists.
328          */
329         while (isblank(*coremask))
330                 coremask++;
331         if (coremask[0] == '0' && ((coremask[1] == 'x')
332                 || (coremask[1] == 'X')))
333                 coremask += 2;
334         i = strlen(coremask);
335         while ((i > 0) && isblank(coremask[i - 1]))
336                 i--;
337
338         if (i == 0)
339                 return -1;
340
341         for (i = i - 1; i >= 0 && idx < RTE_MAX_LCORE; i--) {
342                 c = coremask[i];
343                 if (isxdigit(c) == 0) {
344                         /* invalid characters */
345                         return -1;
346                 }
347                 val = xdigit2val(c);
348                 for (j = 0; j < BITS_PER_HEX && idx < RTE_MAX_LCORE;
349                                 j++, idx++) {
350                         if ((1 << j) & val) {
351                                 /* handle master lcore already parsed */
352                                 uint32_t lcore = idx;
353                                 if (master_lcore_parsed &&
354                                                 cfg->master_lcore == lcore) {
355                                         RTE_LOG(ERR, EAL,
356                                                 "Error: lcore %u is master lcore, cannot use as service core\n",
357                                                 idx);
358                                         return -1;
359                                 }
360
361                                 if (!lcore_config[idx].detected) {
362                                         RTE_LOG(ERR, EAL,
363                                                 "lcore %u unavailable\n", idx);
364                                         return -1;
365                                 }
366                                 lcore_config[idx].core_role = ROLE_SERVICE;
367                                 count++;
368                         }
369                 }
370         }
371
372         for (; i >= 0; i--)
373                 if (coremask[i] != '0')
374                         return -1;
375
376         for (; idx < RTE_MAX_LCORE; idx++)
377                 lcore_config[idx].core_index = -1;
378
379         if (count == 0)
380                 return -1;
381
382         cfg->service_lcore_count = count;
383         return 0;
384 }
385
386 static int
387 eal_parse_coremask(const char *coremask)
388 {
389         struct rte_config *cfg = rte_eal_get_configuration();
390         int i, j, idx = 0;
391         unsigned count = 0;
392         char c;
393         int val;
394
395         if (coremask == NULL)
396                 return -1;
397         /* Remove all blank characters ahead and after .
398          * Remove 0x/0X if exists.
399          */
400         while (isblank(*coremask))
401                 coremask++;
402         if (coremask[0] == '0' && ((coremask[1] == 'x')
403                 || (coremask[1] == 'X')))
404                 coremask += 2;
405         i = strlen(coremask);
406         while ((i > 0) && isblank(coremask[i - 1]))
407                 i--;
408         if (i == 0)
409                 return -1;
410
411         for (i = i - 1; i >= 0 && idx < RTE_MAX_LCORE; i--) {
412                 c = coremask[i];
413                 if (isxdigit(c) == 0) {
414                         /* invalid characters */
415                         return -1;
416                 }
417                 val = xdigit2val(c);
418                 for (j = 0; j < BITS_PER_HEX && idx < RTE_MAX_LCORE; j++, idx++)
419                 {
420                         if ((1 << j) & val) {
421                                 if (!lcore_config[idx].detected) {
422                                         RTE_LOG(ERR, EAL, "lcore %u "
423                                                 "unavailable\n", idx);
424                                         return -1;
425                                 }
426                                 cfg->lcore_role[idx] = ROLE_RTE;
427                                 lcore_config[idx].core_index = count;
428                                 count++;
429                         } else {
430                                 cfg->lcore_role[idx] = ROLE_OFF;
431                                 lcore_config[idx].core_index = -1;
432                         }
433                 }
434         }
435         for (; i >= 0; i--)
436                 if (coremask[i] != '0')
437                         return -1;
438         for (; idx < RTE_MAX_LCORE; idx++) {
439                 cfg->lcore_role[idx] = ROLE_OFF;
440                 lcore_config[idx].core_index = -1;
441         }
442         if (count == 0)
443                 return -1;
444         /* Update the count of enabled logical cores of the EAL configuration */
445         cfg->lcore_count = count;
446         return 0;
447 }
448
449 static int
450 eal_parse_service_corelist(const char *corelist)
451 {
452         struct rte_config *cfg = rte_eal_get_configuration();
453         int i, idx = 0;
454         unsigned count = 0;
455         char *end = NULL;
456         int min, max;
457
458         if (corelist == NULL)
459                 return -1;
460
461         /* Remove all blank characters ahead and after */
462         while (isblank(*corelist))
463                 corelist++;
464         i = strlen(corelist);
465         while ((i > 0) && isblank(corelist[i - 1]))
466                 i--;
467
468         /* Get list of cores */
469         min = RTE_MAX_LCORE;
470         do {
471                 while (isblank(*corelist))
472                         corelist++;
473                 if (*corelist == '\0')
474                         return -1;
475                 errno = 0;
476                 idx = strtoul(corelist, &end, 10);
477                 if (errno || end == NULL)
478                         return -1;
479                 while (isblank(*end))
480                         end++;
481                 if (*end == '-') {
482                         min = idx;
483                 } else if ((*end == ',') || (*end == '\0')) {
484                         max = idx;
485                         if (min == RTE_MAX_LCORE)
486                                 min = idx;
487                         for (idx = min; idx <= max; idx++) {
488                                 if (cfg->lcore_role[idx] != ROLE_SERVICE) {
489                                         /* handle master lcore already parsed */
490                                         uint32_t lcore = idx;
491                                         if (cfg->master_lcore == lcore &&
492                                                         master_lcore_parsed) {
493                                                 RTE_LOG(ERR, EAL,
494                                                         "Error: lcore %u is master lcore, cannot use as service core\n",
495                                                         idx);
496                                                 return -1;
497                                         }
498                                         lcore_config[idx].core_role =
499                                                         ROLE_SERVICE;
500                                         count++;
501                                 }
502                         }
503                         min = RTE_MAX_LCORE;
504                 } else
505                         return -1;
506                 corelist = end + 1;
507         } while (*end != '\0');
508
509         if (count == 0)
510                 return -1;
511
512         return 0;
513 }
514
515 static int
516 eal_parse_corelist(const char *corelist)
517 {
518         struct rte_config *cfg = rte_eal_get_configuration();
519         int i, idx = 0;
520         unsigned count = 0;
521         char *end = NULL;
522         int min, max;
523
524         if (corelist == NULL)
525                 return -1;
526
527         /* Remove all blank characters ahead and after */
528         while (isblank(*corelist))
529                 corelist++;
530         i = strlen(corelist);
531         while ((i > 0) && isblank(corelist[i - 1]))
532                 i--;
533
534         /* Reset config */
535         for (idx = 0; idx < RTE_MAX_LCORE; idx++) {
536                 cfg->lcore_role[idx] = ROLE_OFF;
537                 lcore_config[idx].core_index = -1;
538         }
539
540         /* Get list of cores */
541         min = RTE_MAX_LCORE;
542         do {
543                 while (isblank(*corelist))
544                         corelist++;
545                 if (*corelist == '\0')
546                         return -1;
547                 errno = 0;
548                 idx = strtoul(corelist, &end, 10);
549                 if (errno || end == NULL)
550                         return -1;
551                 while (isblank(*end))
552                         end++;
553                 if (*end == '-') {
554                         min = idx;
555                 } else if ((*end == ',') || (*end == '\0')) {
556                         max = idx;
557                         if (min == RTE_MAX_LCORE)
558                                 min = idx;
559                         for (idx = min; idx <= max; idx++) {
560                                 if (cfg->lcore_role[idx] != ROLE_RTE) {
561                                         cfg->lcore_role[idx] = ROLE_RTE;
562                                         lcore_config[idx].core_index = count;
563                                         count++;
564                                 }
565                         }
566                         min = RTE_MAX_LCORE;
567                 } else
568                         return -1;
569                 corelist = end + 1;
570         } while (*end != '\0');
571
572         if (count == 0)
573                 return -1;
574
575         /* Update the count of enabled logical cores of the EAL configuration */
576         cfg->lcore_count = count;
577
578         return 0;
579 }
580
581 /* Changes the lcore id of the master thread */
582 static int
583 eal_parse_master_lcore(const char *arg)
584 {
585         char *parsing_end;
586         struct rte_config *cfg = rte_eal_get_configuration();
587
588         errno = 0;
589         cfg->master_lcore = (uint32_t) strtol(arg, &parsing_end, 0);
590         if (errno || parsing_end[0] != 0)
591                 return -1;
592         if (cfg->master_lcore >= RTE_MAX_LCORE)
593                 return -1;
594         master_lcore_parsed = 1;
595
596         /* ensure master core is not used as service core */
597         if (lcore_config[cfg->master_lcore].core_role == ROLE_SERVICE) {
598                 RTE_LOG(ERR, EAL, "Error: Master lcore is used as a service core.\n");
599                 return -1;
600         }
601
602         return 0;
603 }
604
605 /*
606  * Parse elem, the elem could be single number/range or '(' ')' group
607  * 1) A single number elem, it's just a simple digit. e.g. 9
608  * 2) A single range elem, two digits with a '-' between. e.g. 2-6
609  * 3) A group elem, combines multiple 1) or 2) with '( )'. e.g (0,2-4,6)
610  *    Within group elem, '-' used for a range separator;
611  *                       ',' used for a single number.
612  */
613 static int
614 eal_parse_set(const char *input, uint16_t set[], unsigned num)
615 {
616         unsigned idx;
617         const char *str = input;
618         char *end = NULL;
619         unsigned min, max;
620
621         memset(set, 0, num * sizeof(uint16_t));
622
623         while (isblank(*str))
624                 str++;
625
626         /* only digit or left bracket is qualify for start point */
627         if ((!isdigit(*str) && *str != '(') || *str == '\0')
628                 return -1;
629
630         /* process single number or single range of number */
631         if (*str != '(') {
632                 errno = 0;
633                 idx = strtoul(str, &end, 10);
634                 if (errno || end == NULL || idx >= num)
635                         return -1;
636                 else {
637                         while (isblank(*end))
638                                 end++;
639
640                         min = idx;
641                         max = idx;
642                         if (*end == '-') {
643                                 /* process single <number>-<number> */
644                                 end++;
645                                 while (isblank(*end))
646                                         end++;
647                                 if (!isdigit(*end))
648                                         return -1;
649
650                                 errno = 0;
651                                 idx = strtoul(end, &end, 10);
652                                 if (errno || end == NULL || idx >= num)
653                                         return -1;
654                                 max = idx;
655                                 while (isblank(*end))
656                                         end++;
657                                 if (*end != ',' && *end != '\0')
658                                         return -1;
659                         }
660
661                         if (*end != ',' && *end != '\0' &&
662                             *end != '@')
663                                 return -1;
664
665                         for (idx = RTE_MIN(min, max);
666                              idx <= RTE_MAX(min, max); idx++)
667                                 set[idx] = 1;
668
669                         return end - input;
670                 }
671         }
672
673         /* process set within bracket */
674         str++;
675         while (isblank(*str))
676                 str++;
677         if (*str == '\0')
678                 return -1;
679
680         min = RTE_MAX_LCORE;
681         do {
682
683                 /* go ahead to the first digit */
684                 while (isblank(*str))
685                         str++;
686                 if (!isdigit(*str))
687                         return -1;
688
689                 /* get the digit value */
690                 errno = 0;
691                 idx = strtoul(str, &end, 10);
692                 if (errno || end == NULL || idx >= num)
693                         return -1;
694
695                 /* go ahead to separator '-',',' and ')' */
696                 while (isblank(*end))
697                         end++;
698                 if (*end == '-') {
699                         if (min == RTE_MAX_LCORE)
700                                 min = idx;
701                         else /* avoid continuous '-' */
702                                 return -1;
703                 } else if ((*end == ',') || (*end == ')')) {
704                         max = idx;
705                         if (min == RTE_MAX_LCORE)
706                                 min = idx;
707                         for (idx = RTE_MIN(min, max);
708                              idx <= RTE_MAX(min, max); idx++)
709                                 set[idx] = 1;
710
711                         min = RTE_MAX_LCORE;
712                 } else
713                         return -1;
714
715                 str = end + 1;
716         } while (*end != '\0' && *end != ')');
717
718         /*
719          * to avoid failure that tail blank makes end character check fail
720          * in eal_parse_lcores( )
721          */
722         while (isblank(*str))
723                 str++;
724
725         return str - input;
726 }
727
728 /* convert from set array to cpuset bitmap */
729 static int
730 convert_to_cpuset(rte_cpuset_t *cpusetp,
731               uint16_t *set, unsigned num)
732 {
733         unsigned idx;
734
735         CPU_ZERO(cpusetp);
736
737         for (idx = 0; idx < num; idx++) {
738                 if (!set[idx])
739                         continue;
740
741                 if (!lcore_config[idx].detected) {
742                         RTE_LOG(ERR, EAL, "core %u "
743                                 "unavailable\n", idx);
744                         return -1;
745                 }
746
747                 CPU_SET(idx, cpusetp);
748         }
749
750         return 0;
751 }
752
753 /*
754  * The format pattern: --lcores='<lcores[@cpus]>[<,lcores[@cpus]>...]'
755  * lcores, cpus could be a single digit/range or a group.
756  * '(' and ')' are necessary if it's a group.
757  * If not supply '@cpus', the value of cpus uses the same as lcores.
758  * e.g. '1,2@(5-7),(3-5)@(0,2),(0,6),7-8' means start 9 EAL thread as below
759  *   lcore 0 runs on cpuset 0x41 (cpu 0,6)
760  *   lcore 1 runs on cpuset 0x2 (cpu 1)
761  *   lcore 2 runs on cpuset 0xe0 (cpu 5,6,7)
762  *   lcore 3,4,5 runs on cpuset 0x5 (cpu 0,2)
763  *   lcore 6 runs on cpuset 0x41 (cpu 0,6)
764  *   lcore 7 runs on cpuset 0x80 (cpu 7)
765  *   lcore 8 runs on cpuset 0x100 (cpu 8)
766  */
767 static int
768 eal_parse_lcores(const char *lcores)
769 {
770         struct rte_config *cfg = rte_eal_get_configuration();
771         static uint16_t set[RTE_MAX_LCORE];
772         unsigned idx = 0;
773         unsigned count = 0;
774         const char *lcore_start = NULL;
775         const char *end = NULL;
776         int offset;
777         rte_cpuset_t cpuset;
778         int lflags;
779         int ret = -1;
780
781         if (lcores == NULL)
782                 return -1;
783
784         /* Remove all blank characters ahead and after */
785         while (isblank(*lcores))
786                 lcores++;
787
788         CPU_ZERO(&cpuset);
789
790         /* Reset lcore config */
791         for (idx = 0; idx < RTE_MAX_LCORE; idx++) {
792                 cfg->lcore_role[idx] = ROLE_OFF;
793                 lcore_config[idx].core_index = -1;
794                 CPU_ZERO(&lcore_config[idx].cpuset);
795         }
796
797         /* Get list of cores */
798         do {
799                 while (isblank(*lcores))
800                         lcores++;
801                 if (*lcores == '\0')
802                         goto err;
803
804                 lflags = 0;
805
806                 /* record lcore_set start point */
807                 lcore_start = lcores;
808
809                 /* go across a complete bracket */
810                 if (*lcore_start == '(') {
811                         lcores += strcspn(lcores, ")");
812                         if (*lcores++ == '\0')
813                                 goto err;
814                 }
815
816                 /* scan the separator '@', ','(next) or '\0'(finish) */
817                 lcores += strcspn(lcores, "@,");
818
819                 if (*lcores == '@') {
820                         /* explicit assign cpu_set */
821                         offset = eal_parse_set(lcores + 1, set, RTE_DIM(set));
822                         if (offset < 0)
823                                 goto err;
824
825                         /* prepare cpu_set and update the end cursor */
826                         if (0 > convert_to_cpuset(&cpuset,
827                                                   set, RTE_DIM(set)))
828                                 goto err;
829                         end = lcores + 1 + offset;
830                 } else { /* ',' or '\0' */
831                         /* haven't given cpu_set, current loop done */
832                         end = lcores;
833
834                         /* go back to check <number>-<number> */
835                         offset = strcspn(lcore_start, "(-");
836                         if (offset < (end - lcore_start) &&
837                             *(lcore_start + offset) != '(')
838                                 lflags = 1;
839                 }
840
841                 if (*end != ',' && *end != '\0')
842                         goto err;
843
844                 /* parse lcore_set from start point */
845                 if (0 > eal_parse_set(lcore_start, set, RTE_DIM(set)))
846                         goto err;
847
848                 /* without '@', by default using lcore_set as cpu_set */
849                 if (*lcores != '@' &&
850                     0 > convert_to_cpuset(&cpuset, set, RTE_DIM(set)))
851                         goto err;
852
853                 /* start to update lcore_set */
854                 for (idx = 0; idx < RTE_MAX_LCORE; idx++) {
855                         if (!set[idx])
856                                 continue;
857
858                         if (cfg->lcore_role[idx] != ROLE_RTE) {
859                                 lcore_config[idx].core_index = count;
860                                 cfg->lcore_role[idx] = ROLE_RTE;
861                                 count++;
862                         }
863
864                         if (lflags) {
865                                 CPU_ZERO(&cpuset);
866                                 CPU_SET(idx, &cpuset);
867                         }
868                         rte_memcpy(&lcore_config[idx].cpuset, &cpuset,
869                                    sizeof(rte_cpuset_t));
870                 }
871
872                 lcores = end + 1;
873         } while (*end != '\0');
874
875         if (count == 0)
876                 goto err;
877
878         cfg->lcore_count = count;
879         ret = 0;
880
881 err:
882
883         return ret;
884 }
885
886 static int
887 eal_parse_syslog(const char *facility, struct internal_config *conf)
888 {
889         int i;
890         static const struct {
891                 const char *name;
892                 int value;
893         } map[] = {
894                 { "auth", LOG_AUTH },
895                 { "cron", LOG_CRON },
896                 { "daemon", LOG_DAEMON },
897                 { "ftp", LOG_FTP },
898                 { "kern", LOG_KERN },
899                 { "lpr", LOG_LPR },
900                 { "mail", LOG_MAIL },
901                 { "news", LOG_NEWS },
902                 { "syslog", LOG_SYSLOG },
903                 { "user", LOG_USER },
904                 { "uucp", LOG_UUCP },
905                 { "local0", LOG_LOCAL0 },
906                 { "local1", LOG_LOCAL1 },
907                 { "local2", LOG_LOCAL2 },
908                 { "local3", LOG_LOCAL3 },
909                 { "local4", LOG_LOCAL4 },
910                 { "local5", LOG_LOCAL5 },
911                 { "local6", LOG_LOCAL6 },
912                 { "local7", LOG_LOCAL7 },
913                 { NULL, 0 }
914         };
915
916         for (i = 0; map[i].name; i++) {
917                 if (!strcmp(facility, map[i].name)) {
918                         conf->syslog_facility = map[i].value;
919                         return 0;
920                 }
921         }
922         return -1;
923 }
924
925 static int
926 eal_parse_log_priority(const char *level)
927 {
928         static const char * const levels[] = {
929                 [RTE_LOG_EMERG]   = "emergency",
930                 [RTE_LOG_ALERT]   = "alert",
931                 [RTE_LOG_CRIT]    = "critical",
932                 [RTE_LOG_ERR]     = "error",
933                 [RTE_LOG_WARNING] = "warning",
934                 [RTE_LOG_NOTICE]  = "notice",
935                 [RTE_LOG_INFO]    = "info",
936                 [RTE_LOG_DEBUG]   = "debug",
937         };
938         size_t len = strlen(level);
939         unsigned long tmp;
940         char *end;
941         unsigned int i;
942
943         if (len == 0)
944                 return -1;
945
946         /* look for named values, skip 0 which is not a valid level */
947         for (i = 1; i < RTE_DIM(levels); i++) {
948                 if (strncmp(levels[i], level, len) == 0)
949                         return i;
950         }
951
952         /* not a string, maybe it is numeric */
953         errno = 0;
954         tmp = strtoul(level, &end, 0);
955
956         /* check for errors */
957         if (errno != 0 || end == NULL || *end != '\0' ||
958             tmp >= UINT32_MAX)
959                 return -1;
960
961         return tmp;
962 }
963
964 static int
965 eal_parse_log_level(const char *arg)
966 {
967         const char *pattern = NULL;
968         const char *regex = NULL;
969         char *str, *level;
970         int priority;
971
972         str = strdup(arg);
973         if (str == NULL)
974                 return -1;
975
976         if ((level = strchr(str, ','))) {
977                 regex = str;
978                 *level++ = '\0';
979         } else if ((level = strchr(str, ':'))) {
980                 pattern = str;
981                 *level++ = '\0';
982         } else {
983                 level = str;
984         }
985
986         priority = eal_parse_log_priority(level);
987         if (priority < 0) {
988                 fprintf(stderr, "invalid log priority: %s\n", level);
989                 goto fail;
990         }
991
992         if (regex) {
993                 if (rte_log_set_level_regexp(regex, priority) < 0) {
994                         fprintf(stderr, "cannot set log level %s,%d\n",
995                                 pattern, priority);
996                         goto fail;
997                 }
998                 if (rte_log_save_regexp(regex, priority) < 0)
999                         goto fail;
1000         } else if (pattern) {
1001                 if (rte_log_set_level_pattern(pattern, priority) < 0) {
1002                         fprintf(stderr, "cannot set log level %s:%d\n",
1003                                 pattern, priority);
1004                         goto fail;
1005                 }
1006                 if (rte_log_save_pattern(pattern, priority) < 0)
1007                         goto fail;
1008         } else {
1009                 rte_log_set_global_level(priority);
1010         }
1011
1012         free(str);
1013         return 0;
1014
1015 fail:
1016         free(str);
1017         return -1;
1018 }
1019
1020 static enum rte_proc_type_t
1021 eal_parse_proc_type(const char *arg)
1022 {
1023         if (strncasecmp(arg, "primary", sizeof("primary")) == 0)
1024                 return RTE_PROC_PRIMARY;
1025         if (strncasecmp(arg, "secondary", sizeof("secondary")) == 0)
1026                 return RTE_PROC_SECONDARY;
1027         if (strncasecmp(arg, "auto", sizeof("auto")) == 0)
1028                 return RTE_PROC_AUTO;
1029
1030         return RTE_PROC_INVALID;
1031 }
1032
1033 int
1034 eal_parse_common_option(int opt, const char *optarg,
1035                         struct internal_config *conf)
1036 {
1037         static int b_used;
1038         static int w_used;
1039
1040         switch (opt) {
1041         /* blacklist */
1042         case 'b':
1043                 if (w_used)
1044                         goto bw_used;
1045                 if (eal_option_device_add(RTE_DEVTYPE_BLACKLISTED_PCI,
1046                                 optarg) < 0) {
1047                         return -1;
1048                 }
1049                 b_used = 1;
1050                 break;
1051         /* whitelist */
1052         case 'w':
1053                 if (b_used)
1054                         goto bw_used;
1055                 if (eal_option_device_add(RTE_DEVTYPE_WHITELISTED_PCI,
1056                                 optarg) < 0) {
1057                         return -1;
1058                 }
1059                 w_used = 1;
1060                 break;
1061         /* coremask */
1062         case 'c':
1063                 if (eal_parse_coremask(optarg) < 0) {
1064                         RTE_LOG(ERR, EAL, "invalid coremask\n");
1065                         return -1;
1066                 }
1067
1068                 if (core_parsed) {
1069                         RTE_LOG(ERR, EAL, "Option -c is ignored, because (%s) is set!\n",
1070                                 (core_parsed == LCORE_OPT_LST) ? "-l" :
1071                                 (core_parsed == LCORE_OPT_MAP) ? "--lcore" :
1072                                 "-c");
1073                         return -1;
1074                 }
1075
1076                 core_parsed = LCORE_OPT_MSK;
1077                 break;
1078         /* corelist */
1079         case 'l':
1080                 if (eal_parse_corelist(optarg) < 0) {
1081                         RTE_LOG(ERR, EAL, "invalid core list\n");
1082                         return -1;
1083                 }
1084
1085                 if (core_parsed) {
1086                         RTE_LOG(ERR, EAL, "Option -l is ignored, because (%s) is set!\n",
1087                                 (core_parsed == LCORE_OPT_MSK) ? "-c" :
1088                                 (core_parsed == LCORE_OPT_MAP) ? "--lcore" :
1089                                 "-l");
1090                         return -1;
1091                 }
1092
1093                 core_parsed = LCORE_OPT_LST;
1094                 break;
1095         /* service coremask */
1096         case 's':
1097                 if (eal_parse_service_coremask(optarg) < 0) {
1098                         RTE_LOG(ERR, EAL, "invalid service coremask\n");
1099                         return -1;
1100                 }
1101                 break;
1102         /* service corelist */
1103         case 'S':
1104                 if (eal_parse_service_corelist(optarg) < 0) {
1105                         RTE_LOG(ERR, EAL, "invalid service core list\n");
1106                         return -1;
1107                 }
1108                 break;
1109         /* size of memory */
1110         case 'm':
1111                 conf->memory = atoi(optarg);
1112                 conf->memory *= 1024ULL;
1113                 conf->memory *= 1024ULL;
1114                 mem_parsed = 1;
1115                 break;
1116         /* force number of channels */
1117         case 'n':
1118                 conf->force_nchannel = atoi(optarg);
1119                 if (conf->force_nchannel == 0) {
1120                         RTE_LOG(ERR, EAL, "invalid channel number\n");
1121                         return -1;
1122                 }
1123                 break;
1124         /* force number of ranks */
1125         case 'r':
1126                 conf->force_nrank = atoi(optarg);
1127                 if (conf->force_nrank == 0 ||
1128                     conf->force_nrank > 16) {
1129                         RTE_LOG(ERR, EAL, "invalid rank number\n");
1130                         return -1;
1131                 }
1132                 break;
1133         /* force loading of external driver */
1134         case 'd':
1135                 if (eal_plugin_add(optarg) == -1)
1136                         return -1;
1137                 break;
1138         case 'v':
1139                 /* since message is explicitly requested by user, we
1140                  * write message at highest log level so it can always
1141                  * be seen
1142                  * even if info or warning messages are disabled */
1143                 RTE_LOG(CRIT, EAL, "RTE Version: '%s'\n", rte_version());
1144                 break;
1145
1146         /* long options */
1147         case OPT_HUGE_UNLINK_NUM:
1148                 conf->hugepage_unlink = 1;
1149                 break;
1150
1151         case OPT_NO_HUGE_NUM:
1152                 conf->no_hugetlbfs = 1;
1153                 /* no-huge is legacy mem */
1154                 conf->legacy_mem = 1;
1155                 break;
1156
1157         case OPT_NO_PCI_NUM:
1158                 conf->no_pci = 1;
1159                 break;
1160
1161         case OPT_NO_HPET_NUM:
1162                 conf->no_hpet = 1;
1163                 break;
1164
1165         case OPT_VMWARE_TSC_MAP_NUM:
1166                 conf->vmware_tsc_map = 1;
1167                 break;
1168
1169         case OPT_NO_SHCONF_NUM:
1170                 conf->no_shconf = 1;
1171                 break;
1172
1173         case OPT_PROC_TYPE_NUM:
1174                 conf->process_type = eal_parse_proc_type(optarg);
1175                 break;
1176
1177         case OPT_MASTER_LCORE_NUM:
1178                 if (eal_parse_master_lcore(optarg) < 0) {
1179                         RTE_LOG(ERR, EAL, "invalid parameter for --"
1180                                         OPT_MASTER_LCORE "\n");
1181                         return -1;
1182                 }
1183                 break;
1184
1185         case OPT_VDEV_NUM:
1186                 if (eal_option_device_add(RTE_DEVTYPE_VIRTUAL,
1187                                 optarg) < 0) {
1188                         return -1;
1189                 }
1190                 break;
1191
1192         case OPT_SYSLOG_NUM:
1193                 if (eal_parse_syslog(optarg, conf) < 0) {
1194                         RTE_LOG(ERR, EAL, "invalid parameters for --"
1195                                         OPT_SYSLOG "\n");
1196                         return -1;
1197                 }
1198                 break;
1199
1200         case OPT_LOG_LEVEL_NUM: {
1201                 if (eal_parse_log_level(optarg) < 0) {
1202                         RTE_LOG(ERR, EAL,
1203                                 "invalid parameters for --"
1204                                 OPT_LOG_LEVEL "\n");
1205                         return -1;
1206                 }
1207                 break;
1208         }
1209         case OPT_LCORES_NUM:
1210                 if (eal_parse_lcores(optarg) < 0) {
1211                         RTE_LOG(ERR, EAL, "invalid parameter for --"
1212                                 OPT_LCORES "\n");
1213                         return -1;
1214                 }
1215
1216                 if (core_parsed) {
1217                         RTE_LOG(ERR, EAL, "Option --lcore is ignored, because (%s) is set!\n",
1218                                 (core_parsed == LCORE_OPT_LST) ? "-l" :
1219                                 (core_parsed == LCORE_OPT_MSK) ? "-c" :
1220                                 "--lcore");
1221                         return -1;
1222                 }
1223
1224                 core_parsed = LCORE_OPT_MAP;
1225                 break;
1226         case OPT_LEGACY_MEM_NUM:
1227                 conf->legacy_mem = 1;
1228                 break;
1229         case OPT_SINGLE_FILE_SEGMENTS_NUM:
1230                 conf->single_file_segments = 1;
1231                 break;
1232
1233         /* don't know what to do, leave this to caller */
1234         default:
1235                 return 1;
1236
1237         }
1238
1239         return 0;
1240 bw_used:
1241         RTE_LOG(ERR, EAL, "Options blacklist (-b) and whitelist (-w) "
1242                 "cannot be used at the same time\n");
1243         return -1;
1244 }
1245
1246 static void
1247 eal_auto_detect_cores(struct rte_config *cfg)
1248 {
1249         unsigned int lcore_id;
1250         unsigned int removed = 0;
1251         rte_cpuset_t affinity_set;
1252         pthread_t tid = pthread_self();
1253
1254         if (pthread_getaffinity_np(tid, sizeof(rte_cpuset_t),
1255                                 &affinity_set) < 0)
1256                 CPU_ZERO(&affinity_set);
1257
1258         for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {
1259                 if (cfg->lcore_role[lcore_id] == ROLE_RTE &&
1260                     !CPU_ISSET(lcore_id, &affinity_set)) {
1261                         cfg->lcore_role[lcore_id] = ROLE_OFF;
1262                         removed++;
1263                 }
1264         }
1265
1266         cfg->lcore_count -= removed;
1267 }
1268
1269 int
1270 eal_adjust_config(struct internal_config *internal_cfg)
1271 {
1272         int i;
1273         struct rte_config *cfg = rte_eal_get_configuration();
1274
1275         if (!core_parsed)
1276                 eal_auto_detect_cores(cfg);
1277
1278         if (internal_config.process_type == RTE_PROC_AUTO)
1279                 internal_config.process_type = eal_proc_type_detect();
1280
1281         /* default master lcore is the first one */
1282         if (!master_lcore_parsed) {
1283                 cfg->master_lcore = rte_get_next_lcore(-1, 0, 0);
1284                 lcore_config[cfg->master_lcore].core_role = ROLE_RTE;
1285         }
1286
1287         /* if no memory amounts were requested, this will result in 0 and
1288          * will be overridden later, right after eal_hugepage_info_init() */
1289         for (i = 0; i < RTE_MAX_NUMA_NODES; i++)
1290                 internal_cfg->memory += internal_cfg->socket_mem[i];
1291
1292         return 0;
1293 }
1294
1295 int
1296 eal_check_common_options(struct internal_config *internal_cfg)
1297 {
1298         struct rte_config *cfg = rte_eal_get_configuration();
1299
1300         if (cfg->lcore_role[cfg->master_lcore] != ROLE_RTE) {
1301                 RTE_LOG(ERR, EAL, "Master lcore is not enabled for DPDK\n");
1302                 return -1;
1303         }
1304
1305         if (internal_cfg->process_type == RTE_PROC_INVALID) {
1306                 RTE_LOG(ERR, EAL, "Invalid process type specified\n");
1307                 return -1;
1308         }
1309         if (index(internal_cfg->hugefile_prefix, '%') != NULL) {
1310                 RTE_LOG(ERR, EAL, "Invalid char, '%%', in --"OPT_FILE_PREFIX" "
1311                         "option\n");
1312                 return -1;
1313         }
1314         if (mem_parsed && internal_cfg->force_sockets == 1) {
1315                 RTE_LOG(ERR, EAL, "Options -m and --"OPT_SOCKET_MEM" cannot "
1316                         "be specified at the same time\n");
1317                 return -1;
1318         }
1319         if (internal_cfg->no_hugetlbfs && internal_cfg->force_sockets == 1) {
1320                 RTE_LOG(ERR, EAL, "Option --"OPT_SOCKET_MEM" cannot "
1321                         "be specified together with --"OPT_NO_HUGE"\n");
1322                 return -1;
1323         }
1324
1325         if (internal_cfg->no_hugetlbfs && internal_cfg->hugepage_unlink) {
1326                 RTE_LOG(ERR, EAL, "Option --"OPT_HUGE_UNLINK" cannot "
1327                         "be specified together with --"OPT_NO_HUGE"\n");
1328                 return -1;
1329         }
1330         if (internal_config.force_socket_limits && internal_config.legacy_mem) {
1331                 RTE_LOG(ERR, EAL, "Option --"OPT_SOCKET_LIMIT
1332                         " is only supported in non-legacy memory mode\n");
1333                 return -1;
1334         }
1335
1336         return 0;
1337 }
1338
1339 void
1340 eal_common_usage(void)
1341 {
1342         printf("[options]\n\n"
1343                "EAL common options:\n"
1344                "  -c COREMASK         Hexadecimal bitmask of cores to run on\n"
1345                "  -l CORELIST         List of cores to run on\n"
1346                "                      The argument format is <c1>[-c2][,c3[-c4],...]\n"
1347                "                      where c1, c2, etc are core indexes between 0 and %d\n"
1348                "  --"OPT_LCORES" COREMAP    Map lcore set to physical cpu set\n"
1349                "                      The argument format is\n"
1350                "                            '<lcores[@cpus]>[<,lcores[@cpus]>...]'\n"
1351                "                      lcores and cpus list are grouped by '(' and ')'\n"
1352                "                      Within the group, '-' is used for range separator,\n"
1353                "                      ',' is used for single number separator.\n"
1354                "                      '( )' can be omitted for single element group,\n"
1355                "                      '@' can be omitted if cpus and lcores have the same value\n"
1356                "  -s SERVICE COREMASK Hexadecimal bitmask of cores to be used as service cores\n"
1357                "  --"OPT_MASTER_LCORE" ID   Core ID that is used as master\n"
1358                "  --"OPT_MBUF_POOL_OPS_NAME" Pool ops name for mbuf to use\n"
1359                "  -n CHANNELS         Number of memory channels\n"
1360                "  -m MB               Memory to allocate (see also --"OPT_SOCKET_MEM")\n"
1361                "  -r RANKS            Force number of memory ranks (don't detect)\n"
1362                "  -b, --"OPT_PCI_BLACKLIST" Add a PCI device in black list.\n"
1363                "                      Prevent EAL from using this PCI device. The argument\n"
1364                "                      format is <domain:bus:devid.func>.\n"
1365                "  -w, --"OPT_PCI_WHITELIST" Add a PCI device in white list.\n"
1366                "                      Only use the specified PCI devices. The argument format\n"
1367                "                      is <[domain:]bus:devid.func>. This option can be present\n"
1368                "                      several times (once per device).\n"
1369                "                      [NOTE: PCI whitelist cannot be used with -b option]\n"
1370                "  --"OPT_VDEV"              Add a virtual device.\n"
1371                "                      The argument format is <driver><id>[,key=val,...]\n"
1372                "                      (ex: --vdev=net_pcap0,iface=eth2).\n"
1373                "  -d LIB.so|DIR       Add a driver or driver directory\n"
1374                "                      (can be used multiple times)\n"
1375                "  --"OPT_VMWARE_TSC_MAP"    Use VMware TSC map instead of native RDTSC\n"
1376                "  --"OPT_PROC_TYPE"         Type of this process (primary|secondary|auto)\n"
1377                "  --"OPT_SYSLOG"            Set syslog facility\n"
1378                "  --"OPT_LOG_LEVEL"=<int>   Set global log level\n"
1379                "  --"OPT_LOG_LEVEL"=<type-match>:<int>\n"
1380                "                      Set specific log level\n"
1381                "  -v                  Display version information on startup\n"
1382                "  -h, --help          This help\n"
1383                "\nEAL options for DEBUG use only:\n"
1384                "  --"OPT_HUGE_UNLINK"       Unlink hugepage files after init\n"
1385                "  --"OPT_NO_HUGE"           Use malloc instead of hugetlbfs\n"
1386                "  --"OPT_NO_PCI"            Disable PCI\n"
1387                "  --"OPT_NO_HPET"           Disable HPET\n"
1388                "  --"OPT_NO_SHCONF"         No shared config (mmap'd files)\n"
1389                "\n", RTE_MAX_LCORE);
1390 }